Path: blob/main/crypto/libecc/src/utils/print_nn.c
34889 views
/*1* Copyright (C) 2017 - This file is part of libecc project2*3* Authors:4* Ryad BENADJILA <[email protected]>5* Arnaud EBALARD <[email protected]>6* Jean-Pierre FLORI <[email protected]>7*8* Contributors:9* Nicolas VIVET <[email protected]>10* Karim KHALFALLAH <[email protected]>11*12* This software is licensed under a dual BSD and GPL v2 license.13* See LICENSE file at the root folder of the project.14*/15#include <libecc/utils/print_nn.h>1617/* Print out given nn, prepending msg to the output */18void nn_print(const char *msg, nn_src_t a)19{20int ret, w;2122ret = nn_check_initialized(a); EG(ret, err);23MUST_HAVE(msg != NULL, ret, err);2425ext_printf("%s (%d words, i.e. %d bits): 0x", msg, a->wlen,26a->wlen * WORD_BYTES * 8);2728for (w = a->wlen - 1; w >= 0; w--) {29ext_printf(PRINTF_WORD_HEX_FMT, a->val[w]);30}3132ext_printf("\n");3334err:35return;36}373839