| 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 | * See README for full list of copyright holders. |
| 7 | * |
| 8 | * Copyright 2013 Ian Jackson |
| 9 | * Copyright 2013 Mark Wooding |
| 10 | * |
| 11 | * You may redistribute secnet as a whole and/or modify it under the |
| 12 | * terms of the GNU General Public License as published by the Free |
| 13 | * Software Foundation; either version 3, or (at your option) any |
| 14 | * later version. |
| 15 | * |
| 16 | * You may redistribute this file and/or modify it under the terms of |
| 17 | * the GNU General Public License as published by the Free Software |
| 18 | * Foundation; either version 2, or (at your option) any later |
| 19 | * version. |
| 20 | * |
| 21 | * This software is distributed in the hope that it will be useful, |
| 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 24 | * GNU General Public License for more details. |
| 25 | * |
| 26 | * You should have received a copy of the GNU General Public License |
| 27 | * along with this software; if not, see |
| 28 | * https://www.gnu.org/licenses/gpl.html. |
| 29 | */ |
| 30 | |
| 31 | |
| 32 | #ifndef EAX_TEST_H |
| 33 | #define EAX_TEST_H |
| 34 | |
| 35 | #include <stdint.h> |
| 36 | #include <string.h> |
| 37 | #include <assert.h> |
| 38 | #include <stdio.h> |
| 39 | #include <stdlib.h> |
| 40 | #include <ctype.h> |
| 41 | #include <sys/types.h> |
| 42 | |
| 43 | #define INFO int dummy_info |
| 44 | #define I dummy_info |
| 45 | #define EAX_ENTRYPOINT_DECL /* empty */ |
| 46 | |
| 47 | #define EAX_DECLARATIONS_ONLY |
| 48 | #include "eax.c" |
| 49 | #undef EAX_DECLARATIONS_ONLY |
| 50 | |
| 51 | void eaxtest_blockcipher_key_setup(const uint8_t *keydata, uint8_t bytes); |
| 52 | |
| 53 | #define consttime_memeq(s1,s2,sz) (!memcmp((s1),(s2),(sz))) |
| 54 | /* fine for running test vectors */ |
| 55 | |
| 56 | extern const size_t blocksize; |
| 57 | |
| 58 | #define EAX_SOME_TEST \ |
| 59 | const size_t blocksize = BLOCK_SIZE; \ |
| 60 | static uint8_t INFO_B[BLOCK_SIZE], INFO_P[BLOCK_SIZE] |
| 61 | |
| 62 | #endif /* EAX_TEST_H */ |