|
6 | 6 | #define MLK_FIPS202_NATIVE_AARCH64_SRC_FIPS202_NATIVE_AARCH64_H |
7 | 7 |
|
8 | 8 | #include <stdint.h> |
| 9 | +#include "../../../../cbmc.h" |
9 | 10 | #include "../../../../common.h" |
10 | 11 |
|
| 12 | + |
| 13 | +#define mlk_keccakf1600_round_constants \ |
| 14 | + MLK_NAMESPACE(keccakf1600_round_constants) |
| 15 | +extern const uint64_t mlk_keccakf1600_round_constants[]; |
| 16 | + |
11 | 17 | #define mlk_keccak_f1600_x1_scalar_asm MLK_NAMESPACE(keccak_f1600_x1_scalar_asm) |
12 | | -void mlk_keccak_f1600_x1_scalar_asm(uint64_t *state, uint64_t const *rc); |
| 18 | +void mlk_keccak_f1600_x1_scalar_asm(uint64_t *state, uint64_t const *rc) |
| 19 | +__contract__( |
| 20 | + requires(memory_no_alias(state, sizeof(uint64_t) * 25 * 1)) |
| 21 | + requires(rc == mlk_keccakf1600_round_constants) |
| 22 | + assigns(memory_slice(state, sizeof(uint64_t) * 25 * 1)) |
| 23 | +); |
13 | 24 |
|
14 | 25 | #define mlk_keccak_f1600_x1_v84a_asm MLK_NAMESPACE(keccak_f1600_x1_v84a_asm) |
15 | | -void mlk_keccak_f1600_x1_v84a_asm(uint64_t *state, uint64_t const *rc); |
| 26 | +void mlk_keccak_f1600_x1_v84a_asm(uint64_t *state, uint64_t const *rc) |
| 27 | +__contract__( |
| 28 | + requires(memory_no_alias(state, sizeof(uint64_t) * 25 * 1)) |
| 29 | + requires(rc == mlk_keccakf1600_round_constants) |
| 30 | + assigns(memory_slice(state, sizeof(uint64_t) * 25 * 1)) |
| 31 | +); |
16 | 32 |
|
17 | 33 | #define mlk_keccak_f1600_x2_v84a_asm MLK_NAMESPACE(keccak_f1600_x2_v84a_asm) |
18 | | -void mlk_keccak_f1600_x2_v84a_asm(uint64_t *state, uint64_t const *rc); |
19 | | - |
20 | | -#define mlk_keccak_f1600_x2_v8a_v84a_asm_hybrid \ |
21 | | - MLK_NAMESPACE(keccak_f1600_x2_v8a_v84a_asm_hybrid) |
22 | | -void mlk_keccak_f1600_x2_v8a_v84a_asm_hybrid(uint64_t *state, |
23 | | - uint64_t const *rc); |
24 | | - |
25 | | -#define mlk_keccak_f1600_x4_scalar_v8a_asm_hybrid \ |
26 | | - MLK_NAMESPACE(keccak_f1600_x4_scalar_v8a_asm_hybrid) |
27 | | -void mlk_keccak_f1600_x4_scalar_v8a_asm_hybrid(uint64_t *state, |
28 | | - uint64_t const *rc); |
29 | | - |
30 | | -#define mlk_keccak_f1600_x4_scalar_v84a_asm_hybrid \ |
31 | | - MLK_NAMESPACE(keccak_f1600_x4_scalar_v84a_asm_hybrid) |
32 | | -void mlk_keccak_f1600_x4_scalar_v84a_asm_hybrid(uint64_t *state, |
33 | | - uint64_t const *rc); |
| 34 | +void mlk_keccak_f1600_x2_v84a_asm(uint64_t *state, uint64_t const *rc) |
| 35 | +__contract__( |
| 36 | + requires(memory_no_alias(state, sizeof(uint64_t) * 25 * 2)) |
| 37 | + requires(rc == mlk_keccakf1600_round_constants) |
| 38 | + assigns(memory_slice(state, sizeof(uint64_t) * 25 * 2)) |
| 39 | +); |
| 40 | + |
| 41 | +#define mlk_keccak_f1600_x4_scalar_v8a_hybrid_asm \ |
| 42 | + MLK_NAMESPACE(keccak_f1600_x4_scalar_v8a_hybrid_asm) |
| 43 | +void mlk_keccak_f1600_x4_scalar_v8a_hybrid_asm(uint64_t *state, |
| 44 | + uint64_t const *rc) |
| 45 | +__contract__( |
| 46 | + requires(memory_no_alias(state, sizeof(uint64_t) * 25 * 4)) |
| 47 | + requires(rc == mlk_keccakf1600_round_constants) |
| 48 | + assigns(memory_slice(state, sizeof(uint64_t) * 25 * 4)) |
| 49 | +); |
34 | 50 |
|
35 | 51 | #define mlk_keccak_f1600_x4_scalar_v8a_v84a_hybrid_asm \ |
36 | 52 | MLK_NAMESPACE(keccak_f1600_x4_scalar_v8a_v84a_hybrid_asm) |
37 | 53 | void mlk_keccak_f1600_x4_scalar_v8a_v84a_hybrid_asm(uint64_t *state, |
38 | | - uint64_t const *rc); |
39 | | - |
40 | | -#define mlk_keccakf1600_round_constants \ |
41 | | - MLK_NAMESPACE(keccakf1600_round_constants) |
42 | | -extern const uint64_t mlk_keccakf1600_round_constants[]; |
| 54 | + uint64_t const *rc) |
| 55 | +__contract__( |
| 56 | + requires(memory_no_alias(state, sizeof(uint64_t) * 25 * 4)) |
| 57 | + requires(rc == mlk_keccakf1600_round_constants) |
| 58 | + assigns(memory_slice(state, sizeof(uint64_t) * 25 * 4)) |
| 59 | +); |
43 | 60 |
|
44 | 61 | #endif /* !MLK_FIPS202_NATIVE_AARCH64_SRC_FIPS202_NATIVE_AARCH64_H */ |
0 commit comments