Etienne Carriere | 7514117 | 2020-05-16 11:58:23 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2014, STMicroelectronics International N.V. |
| 4 | * All rights reserved. |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef GUARD_testframework_H |
| 8 | #define GUARD_testframework_H |
| 9 | |
| 10 | #include "tee_internal_api.h" |
| 11 | |
| 12 | #include "tee_arith_internal.h" |
| 13 | |
| 14 | #include "tb_macros.h" |
| 15 | #include "tb_asserts.h" |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 16 | |
| 17 | /* define the max size of generated numbers */ |
| 18 | /* this is number of hex chars in the number */ |
| 19 | #define MAX_RAND_DIGITS 256 |
| 20 | #define MAX_RAND_STRING_SIZE (MAX_RAND_DIGITS + 2) |
| 21 | |
| 22 | size_t my_strlen(const char *string); |
| 23 | int my_strcmp(const char *s1, const char *s2); |
| 24 | size_t my_strlcpy(char *dst, const char *src, size_t siz); |
| 25 | |
| 26 | void tb_set_random_value(TEE_BigInt *a, char *str, int allow_neg); |
| 27 | void tb_get_random_str(char *str, int allow_neg); |
| 28 | |
| 29 | void tb_main(void); |
| 30 | |
| 31 | void tb_var(void); |
| 32 | void tb_conv(void); |
| 33 | void tb_cmp(void); |
| 34 | void tb_addsub(void); |
| 35 | void tb_mul(void); |
| 36 | void tb_shift(void); |
| 37 | void tb_div(void); |
| 38 | void tb_gcd(void); |
| 39 | void tb_modulus(void); |
| 40 | void tb_fmm(void); |
| 41 | void tb_prime(void); |
| 42 | |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 43 | int TEE_BigIntConvertFromString(TEE_BigInt *dest, const char *src); |
Jens Wiklander | 50657b7 | 2015-07-22 16:02:43 +0200 | [diff] [blame] | 44 | char *TEE_BigIntConvertToString(char *dest, int mode, const TEE_BigInt *src); |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 45 | |
| 46 | #endif /* include guard */ |