| 1 | /* |
| 2 | * eax-test.c: test harness for EAX, common declarations |
| 3 | */ |
| 4 | /* |
| 5 | * This file is Free Software. It was originally written for secnet. |
| 6 | * |
| 7 | * You may redistribute it and/or modify it under the terms of the GNU |
| 8 | * General Public License as published by the Free Software |
| 9 | * Foundation; either version 2, or (at your option) any later |
| 10 | * version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 20 | */ |
| 21 | |
| 22 | |
| 23 | #ifndef EAX_TEST_H |
| 24 | #define EAX_TEST_H |
| 25 | |
| 26 | #include <stdint.h> |
| 27 | #include <string.h> |
| 28 | #include <assert.h> |
| 29 | #include <stdio.h> |
| 30 | #include <stdlib.h> |
| 31 | #include <ctype.h> |
| 32 | #include <sys/types.h> |
| 33 | |
| 34 | #define INFO int dummy_info |
| 35 | #define I dummy_info |
| 36 | #define EAX_ENTRYPOINT_DECL /* empty */ |
| 37 | |
| 38 | #define EAX_DECLARATIONS_ONLY |
| 39 | #include "eax.c" |
| 40 | #undef EAX_DECLARATIONS_ONLY |
| 41 | |
| 42 | void eaxtest_blockcipher_key_setup(const uint8_t *keydata, uint8_t bytes); |
| 43 | |
| 44 | #define consttime_memeq(s1,s2,sz) (!memcmp((s1),(s2),(sz))) |
| 45 | /* fine for running test vectors */ |
| 46 | |
| 47 | extern const size_t blocksize; |
| 48 | |
| 49 | #define EAX_SOME_TEST \ |
| 50 | const size_t blocksize = BLOCK_SIZE; \ |
| 51 | static uint8_t INFO_B[BLOCK_SIZE], INFO_P[BLOCK_SIZE] |
| 52 | |
| 53 | #endif /* EAX_TEST_H */ |