Debian Codegraph @

crt/aws-c-common/include/aws/common/predicates.h

raw symbols SCIP
1 #ifndef AWS_COMMON_PREDICATES_H
2 #define AWS_COMMON_PREDICATES_H
3 /**
4 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5 * SPDX-License-Identifier: Apache-2.0.
6 */
7
8 /**
9 * Returns whether all bytes of the two byte arrays match.
10 */
11 #if defined(AWS_DEEP_CHECKS) && (AWS_DEEP_CHECKS == 1)
12 # ifdef CBMC
13 /* clang-format off */
14 # define AWS_BYTES_EQ(arr1, arr2, len) \
15 __CPROVER_forall { \
16 int i; \
17 (i >= 0 && i < len) ==> ((const uint8_t *)&arr1)[i] == ((const uint8_t *)&arr2)[i] \
18 }
19 /* clang-format on */
20 # else
21 # define AWS_BYTES_EQ(arr1, arr2, len) (memcmp(arr1, arr2, len) == 0)
22 # endif /* CBMC */
23 #else
24 # define AWS_BYTES_EQ(arr1, arr2, len) (1)
25 #endif /* (AWS_DEEP_CHECKS == 1) */
26
27 #endif /* AWS_COMMON_PREDICATES_H */