/* * Copyright (C) 2017 - This file is part of libecc project * * Authors: * Ryad BENADJILA * Arnaud EBALARD * Jean-Pierre FLORI * * Contributors: * Nicolas VIVET * Karim KHALFALLAH * * This software is licensed under a dual BSD and GPL v2 license. * See LICENSE file at the root folder of the project. */ #include /* Print out given nn, prepending msg to the output */ void nn_print(const char *msg, nn_src_t a) { int ret, w; ret = nn_check_initialized(a); EG(ret, err); MUST_HAVE(msg != NULL, ret, err); ext_printf("%s (%d words, i.e. %d bits): 0x", msg, a->wlen, a->wlen * WORD_BYTES * 8); for (w = a->wlen - 1; w >= 0; w--) { ext_printf(PRINTF_WORD_HEX_FMT, a->val[w]); } ext_printf("\n"); err: return; }