Debian Codegraph @

crt/aws-c-common/verification/cbmc/proofs/aws_nospec_mask/aws_nospec_mask_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/byte_buf.h>
7 #include <aws/common/private/byte_buf.h>
8 #include <proof_helpers/make_common_data_structures.h>
9
10 void aws_nospec_mask_harness() {
11 /* parameters */
12 size_t index;
13 size_t bound;
14
15 /* operation under verification */
16 size_t rval = aws_nospec_mask(index, bound);
17
18 /* assertions */
19 if (rval == 0) {
20 assert((index >= bound) || (bound > (SIZE_MAX / 2)) || (index > (SIZE_MAX / 2)));
21 } else {
22 assert(rval == UINTPTR_MAX);
23 assert(!((index >= bound) || (bound > (SIZE_MAX / 2)) || (index > (SIZE_MAX / 2))));
24 }
25 }