| 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_copy_harness() |
| 23 |
{ |
| 24 |
|
| 25 |
struct s2n_hmac_state *to = cbmc_allocate_s2n_hmac_state(); |
| 26 |
struct s2n_hmac_state *from = cbmc_allocate_s2n_hmac_state(); |
| 27 |
|
| 28 |
|
| 29 |
__CPROVER_assume(s2n_result_is_ok(s2n_hmac_state_validate(to))); |
| 30 |
__CPROVER_assume(s2n_result_is_ok(s2n_hmac_state_validate(from))); |
| 31 |
|
| 32 |
|
| 33 |
if (s2n_hmac_copy(to, from) == S2N_SUCCESS) |
| 34 |
{ |
| 35 |
|
| 36 |
assert(s2n_result_is_ok(s2n_hmac_state_validate(to))); |
| 37 |
assert(s2n_result_is_ok(s2n_hmac_state_validate(from))); |
| 38 |
assert(from->inner.hash_impl->copy != NULL); |
| 39 |
assert(from->inner_just_key.hash_impl->copy != NULL); |
| 40 |
assert(from->outer.hash_impl->copy != NULL); |
| 41 |
assert(from->outer_just_key.hash_impl->copy != NULL); |
| 42 |
} |
| 43 |
} |