This repository has been archived by the owner on Jan 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 86
/
dbg_sig.h
61 lines (56 loc) · 1.81 KB
/
dbg_sig.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* Copyright (C) 2017 - This file is part of libecc project
*
* Authors:
* Ryad BENADJILA <[email protected]>
* Arnaud EBALARD <[email protected]>
* Jean-Pierre FLORI <[email protected]>
*
* Contributors:
* Nicolas VIVET <[email protected]>
* Karim KHALFALLAH <[email protected]>
*
* This software is licensed under a dual BSD and GPL v2 license.
* See LICENSE file at the root folder of the project.
*/
#ifndef __DBG_SIG_H__
#define __DBG_SIG_H__
#include "print_curves.h"
#include "print_keys.h"
#include "print_buf.h"
/* Macro to allow inner values of tests vectors print */
#ifdef VERBOSE_INNER_VALUES
#ifndef EC_SIG_ALG
#define EC_SIG_ALG "UNKNOWN_ALG"
#endif
#define dbg_buf_print(msg, ...) do {\
buf_print(EC_SIG_ALG " " msg, __VA_ARGS__);\
} while(0)
#define dbg_nn_print(msg, ...) do {\
nn_print(EC_SIG_ALG " " msg, __VA_ARGS__);\
} while(0)
#define dbg_ec_point_print(msg, ...) do {\
ec_point_print(EC_SIG_ALG " " msg, __VA_ARGS__);\
} while(0)
#define dbg_ec_montgomery_point_print(msg, ...) do {\
ec_montgomery_point_print(EC_SIG_ALG " " msg, __VA_ARGS__);\
} while(0)
#define dbg_ec_edwards_point_print(msg, ...) do {\
ec_edwards_point_print(EC_SIG_ALG " " msg, __VA_ARGS__);\
} while(0)
#define dbg_priv_key_print(msg, ...) do {\
priv_key_print(EC_SIG_ALG " " msg, __VA_ARGS__);\
} while(0)
#define dbg_pub_key_print(msg, ...) do {\
pub_key_print(EC_SIG_ALG " " msg, __VA_ARGS__);\
} while(0)
#else /* VERBOSE_INNER_VALUES not defined */
#define dbg_buf_print(msg, ...)
#define dbg_nn_print(msg, ...)
#define dbg_ec_point_print(msg, ...)
#define dbg_ec_montgomery_point_print(msg, ...)
#define dbg_ec_edwards_point_print(msg, ...)
#define dbg_priv_key_print(msg, ...)
#define dbg_pub_key_print(msg, ...)
#endif
#endif /* __DBG_SIG_H__ */