crt/aws-c-common/verification/cbmc/proofs/aws_hash_string/aws_hash_string_harness.c
raw symbols SCIP| 1 | /** |
| 2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 3 | * SPDX-License-Identifier: Apache-2.0. |
| 4 | */ |
| 5 | |
| 6 | #include <aws/common/hash_table.h> |
| 7 | #include <aws/common/private/hash_table_impl.h> |
| 8 | #include <proof_helpers/make_common_data_structures.h> |
| 9 | #include <proof_helpers/utils.h> |
| 10 | |
| 11 | void aws_hash_string_harness() { |
| 12 | struct aws_string *str = nondet_allocate_string_bounded_length(MAX_STRING_SIZE); |
| 13 | __CPROVER_assume(aws_string_is_valid(str)); |
| 14 | /* |
| 15 | * #TODO: Currently, CBMC is unable to check all possible paths in these proof. |
| 16 | * aws_hash_string function calls hashlittle2 function, which calculates two 32-bit |
| 17 | * hash values. Internally, it contains two conditions that test for alignment to |
| 18 | * 4 byte/2 byte boundaries, but CBMC is unable to correctly evaluate such conditions, |
| 19 | * due to its pointer encoding. A potential fix to this problem is under development. |
| 20 | * For more details, see https://github.com/diffblue/cbmc/pull/1086. |
| 21 | */ |
| 22 | uint64_t rval = aws_hash_string(str); |
| 23 | } |