Mercurial > dropbear
view demos/test/test.h @ 144:7ed585a2c53b libtomcrypt
propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sun, 19 Dec 2004 11:47:33 +0000 |
parents | 5d99163f7e32 |
children |
line wrap: on
line source
#ifndef __TEST_H_ #define __TEST_H_ #include "mycrypt.h" /* enable stack testing */ // #define STACK_TEST /* stack testing, define this if stack usage goes downwards [e.g. x86] */ #define STACK_DOWN typedef struct { char *name, *prov, *req; int (*entry)(void); } test_entry; extern prng_state test_yarrow; void stack_masker(void); void stack_check(void); extern unsigned long stack_cur; #define stack_chk(x) { stack_check(); if (stack_cur >= 1024) { fprintf(stderr, " Warning: Stack usage of %lu in %s, %s:%d\n", stack_cur, x, __FILE__, __LINE__); } } void run_cmd(int res, int line, char *file, char *cmd); #define DO(x) { stack_masker(); run_cmd((x), __LINE__, __FILE__, #x); stack_chk(#x); } /* TESTS */ int cipher_hash_test(void); int modes_test(void); int mac_test(void); int pkcs_1_test(void); int store_test(void); int rsa_test(void); int ecc_tests(void); int dsa_test(void); int dh_tests(void); int der_tests(void); #endif