1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
3 * LibTomCrypt is a library that provides various cryptographic
4 * algorithms in a highly modular and flexible manner.
6 * The library is free for all purposes without any express
10 /* Defines the LTC_ARGCHK macro used within the library */
11 /* ARGTYPE is defined in tomcrypt_cfg.h */
16 /* this is the default LibTomCrypt macro */
17 #if defined(__clang__) || defined(__GNUC_MINOR__)
18 #define NORETURN __attribute__ ((noreturn))
23 void crypt_argchk(const char *v, const char *s, int d) NORETURN;
24 #define LTC_ARGCHK(x) do { if (!(x)) { crypt_argchk(#x, __FILE__, __LINE__); } }while(0)
25 #define LTC_ARGCHKVD(x) do { if (!(x)) { crypt_argchk(#x, __FILE__, __LINE__); } }while(0)
29 /* fatal type of error */
30 #define LTC_ARGCHK(x) assert((x))
31 #define LTC_ARGCHKVD(x) LTC_ARGCHK(x)
35 #define LTC_ARGCHK(x) if (!(x)) { fprintf(stderr, "\nwarning: ARGCHK failed at %s:%d\n", __FILE__, __LINE__); }
36 #define LTC_ARGCHKVD(x) LTC_ARGCHK(x)
41 #define LTC_ARGCHKVD(x) LTC_ARGCHK(x)
45 #define LTC_ARGCHK(x) if (!(x)) return CRYPT_INVALID_ARG;
46 #define LTC_ARGCHKVD(x) if (!(x)) return;
51 /* ref: $Format:%D$ */
52 /* git commit: $Format:%H$ */
53 /* commit time: $Format:%ai$ */