| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
#include "crypto/s2n_hmac.h" |
| 17 |
|
| 18 |
#include <cbmc_proof/make_common_datastructures.h> |
| 19 |
|
| 20 |
#include <assert.h> |
| 21 |
|
| 22 |
void s2n_hmac_digest_harness() |
| 23 |
{ |
| 24 |
|
| 25 |
struct s2n_hmac_state *state = cbmc_allocate_s2n_hmac_state(); |
| 26 |
uint32_t size; |
| 27 |
void* out = malloc(size); |
| 28 |
|
| 29 |
|
| 30 |
__CPROVER_assume(s2n_result_is_ok(s2n_hmac_state_validate(state))); |
| 31 |
|
| 32 |
|
| 33 |
if (s2n_hmac_digest(state, out, size) == S2N_SUCCESS) |
| 34 |
{ |
| 35 |
|
| 36 |
assert(s2n_result_is_ok(s2n_hmac_state_validate(state))); |
| 37 |
assert(state->inner.hash_impl->digest != NULL); |
| 38 |
assert(state->outer.hash_impl->digest != NULL); |
| 39 |
assert(state->outer.hash_impl->update != NULL); |
| 40 |
assert(state->outer_just_key.hash_impl->copy != NULL); |
| 41 |
} |
| 42 |
} |