# -fsanitize=undefined suppressions
# =================================
# The suppressions would be `sanitize-type:ClassName::MethodName`,
# however due to a bug in clang the symbolizer is disabled and thus no symbol
# names can be used.
# See https://github.com/google/sanitizers/issues/1364

# https://github.com/bitcoin/bitcoin/pull/21798#issuecomment-829180719
signed-integer-overflow:policy/feerate.cpp

# -fsanitize=integer suppressions
# ===============================
# Dependencies
# ------------
# Suppressions in dependencies that are developed outside this repository.
unsigned-integer-overflow:*/include/c++/
unsigned-integer-overflow:bench/bench.h
# unsigned-integer-overflow in FuzzedDataProvider's ConsumeIntegralInRange
unsigned-integer-overflow:FuzzedDataProvider.h
unsigned-integer-overflow:leveldb/
unsigned-integer-overflow:minisketch/
unsigned-integer-overflow:test/fuzz/crypto_diff_fuzz_chacha20.cpp
implicit-integer-sign-change:*/include/boost/
implicit-integer-sign-change:*/include/c++/
implicit-integer-sign-change:*/new_allocator.h
implicit-integer-sign-change:crc32c/
# implicit-integer-sign-change in FuzzedDataProvider's ConsumeIntegralInRange
implicit-integer-sign-change:FuzzedDataProvider.h
implicit-integer-sign-change:minisketch/
implicit-signed-integer-truncation:leveldb/
implicit-unsigned-integer-truncation:*/include/c++/
implicit-unsigned-integer-truncation:leveldb/
implicit-unsigned-integer-truncation:test/fuzz/crypto_diff_fuzz_chacha20.cpp
# std::variant warning fixed in https://github.com/gcc-mirror/gcc/commit/074436cf8cdd2a9ce75cadd36deb8301f00e55b9
implicit-unsigned-integer-truncation:std::__detail::__variant::_Variant_storage
shift-base:*/include/c++/
shift-base:leveldb/
shift-base:minisketch/
shift-base:test/fuzz/crypto_diff_fuzz_chacha20.cpp
# Unsigned integer overflow occurs when the result of an unsigned integer
# computation cannot be represented in its type. Unlike signed integer overflow,
# this is not undefined behavior, but it is often unintentional. The list below
# contains files in which we expect unsigned integer overflows to occur. The
# list is used to suppress -fsanitize=integer warnings when running our CI UBSan
# job.
unsigned-integer-overflow:arith_uint256.h
unsigned-integer-overflow:common/bloom.cpp
unsigned-integer-overflow:coins.cpp
unsigned-integer-overflow:compressor.cpp
unsigned-integer-overflow:crypto/
unsigned-integer-overflow:hash.cpp
unsigned-integer-overflow:policy/fees.cpp
unsigned-integer-overflow:prevector.h
unsigned-integer-overflow:script/interpreter.cpp
unsigned-integer-overflow:txmempool.cpp
implicit-integer-sign-change:compat/stdin.cpp
implicit-integer-sign-change:compressor.h
implicit-integer-sign-change:crypto/
implicit-integer-sign-change:policy/fees.cpp
implicit-integer-sign-change:prevector.h
implicit-integer-sign-change:script/bitcoinconsensus.cpp
implicit-integer-sign-change:script/interpreter.cpp
implicit-integer-sign-change:serialize.h
implicit-integer-sign-change:txmempool.cpp
implicit-signed-integer-truncation:addrman.cpp
implicit-signed-integer-truncation:crypto/
implicit-unsigned-integer-truncation:crypto/
shift-base:arith_uint256.cpp
shift-base:crypto/
shift-base:hash.cpp
shift-base:streams.h
shift-base:util/bip32.cpp

# ELEMENTS
# copied from bech32.cpp above
implicit-integer-sign-change:blech32.cpp
implicit-signed-integer-truncation:script/interpreter.cpp
implicit-integer-sign-change:blech32.cpp
implicit-integer-sign-change:primitives/block.h
implicit-integer-sign-change:primitives/confidential.cpp
implicit-integer-sign-change:primitives/confidential.h
shift-base:simplicity/jets.c
unsigned-integer-overflow:simplicity/jets.c
implicit-unsigned-integer-truncation:simplicity/jets.c
shift-base:simplicity/sha256.c
unsigned-integer-overflow:simplicity/sha256.c
unsigned-integer-overflow:simplicity/secp256k1/modinv64_impl.h
implicit-integer-sign-change:simplicity/secp256k1/modinv64_impl.h
implicit-unsigned-integer-truncation:simplicity/secp256k1/modinv64_impl.h
shift-base:simplicity/secp256k1/modinv64_impl.h
shift-base:simplicity/secp256k1/field_5x52_impl.h
unsigned-integer-overflow:simplicity/secp256k1/field_5x52_impl.h
shift-base:simplicity/secp256k1/scalar_4x64_impl.h
implicit-unsigned-integer-truncation:simplicity/secp256k1/scalar_4x64_impl.h
unsigned-integer-overflow:simplicity/secp256k1/scalar_4x64_impl.h
# This one, in secp256k1_ge_table_set_globalz, looks dangerous (len - 1 with
# len = 0) but is ok since the rest of the function is guarded on len > 0.
unsigned-integer-overflow:simplicity/secp256k1/group_impl.h
# This one involves careful roconnor code
shift-base:simplicity/frame.c
# See comment in simplicity/primitive/elements/env.c line 303
unsigned-integer-overflow:simplicity/elements/env.c
