/src/botan/build/include/internal/botan/internal/ct_utils.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Functions for constant time operations on data and testing of |
3 | | * constant time annotations using valgrind. |
4 | | * |
5 | | * For more information about constant time programming see |
6 | | * Wagner, Molnar, et al "The Program Counter Security Model" |
7 | | * |
8 | | * (C) 2010 Falko Strenzke |
9 | | * (C) 2015,2016,2018,2024 Jack Lloyd |
10 | | * |
11 | | * Botan is released under the Simplified BSD License (see license.txt) |
12 | | */ |
13 | | |
14 | | #ifndef BOTAN_CT_UTILS_H_ |
15 | | #define BOTAN_CT_UTILS_H_ |
16 | | |
17 | | #include <botan/concepts.h> |
18 | | #include <botan/secmem.h> |
19 | | #include <botan/internal/bit_ops.h> |
20 | | #include <botan/internal/stl_util.h> |
21 | | |
22 | | #include <optional> |
23 | | #include <span> |
24 | | #include <type_traits> |
25 | | |
26 | | #if defined(BOTAN_HAS_VALGRIND) |
27 | | #include <valgrind/memcheck.h> |
28 | | #endif |
29 | | |
30 | | namespace Botan::CT { |
31 | | |
32 | | /// @name Constant Time Check Annotation Helpers |
33 | | /// @{ |
34 | | |
35 | | /** |
36 | | * Use valgrind to mark the contents of memory as being undefined. |
37 | | * Valgrind will accept operations which manipulate undefined values, |
38 | | * but will warn if an undefined value is used to decided a conditional |
39 | | * jump or a load/store address. So if we poison all of our inputs we |
40 | | * can confirm that the operations in question are truly const time |
41 | | * when compiled by whatever compiler is in use. |
42 | | * |
43 | | * Even better, the VALGRIND_MAKE_MEM_* macros work even when the |
44 | | * program is not run under valgrind (though with a few cycles of |
45 | | * overhead, which is unfortunate in final binaries as these |
46 | | * annotations tend to be used in fairly important loops). |
47 | | * |
48 | | * This approach was first used in ctgrind (https://github.com/agl/ctgrind) |
49 | | * but calling the valgrind mecheck API directly works just as well and |
50 | | * doesn't require a custom patched valgrind. |
51 | | */ |
52 | | template <typename T> |
53 | 214k | constexpr inline void poison(const T* p, size_t n) { |
54 | | #if defined(BOTAN_HAS_VALGRIND) |
55 | | if(!std::is_constant_evaluated()) { |
56 | | VALGRIND_MAKE_MEM_UNDEFINED(p, n * sizeof(T)); |
57 | | } |
58 | | #endif |
59 | | |
60 | 214k | BOTAN_UNUSED(p, n); |
61 | 214k | } void Botan::CT::poison<unsigned char>(unsigned char const*, unsigned long) Line | Count | Source | 53 | 36.7k | constexpr inline void poison(const T* p, size_t n) { | 54 | | #if defined(BOTAN_HAS_VALGRIND) | 55 | | if(!std::is_constant_evaluated()) { | 56 | | VALGRIND_MAKE_MEM_UNDEFINED(p, n * sizeof(T)); | 57 | | } | 58 | | #endif | 59 | | | 60 | 36.7k | BOTAN_UNUSED(p, n); | 61 | 36.7k | } |
Unexecuted instantiation: void Botan::CT::poison<unsigned short>(unsigned short const*, unsigned long) void Botan::CT::poison<unsigned long>(unsigned long const*, unsigned long) Line | Count | Source | 53 | 178k | constexpr inline void poison(const T* p, size_t n) { | 54 | | #if defined(BOTAN_HAS_VALGRIND) | 55 | | if(!std::is_constant_evaluated()) { | 56 | | VALGRIND_MAKE_MEM_UNDEFINED(p, n * sizeof(T)); | 57 | | } | 58 | | #endif | 59 | | | 60 | 178k | BOTAN_UNUSED(p, n); | 61 | 178k | } |
Unexecuted instantiation: void Botan::CT::poison<unsigned int>(unsigned int const*, unsigned long) Unexecuted instantiation: void Botan::CT::poison<short>(short const*, unsigned long) Unexecuted instantiation: void Botan::CT::poison<Botan::Classic_McEliece_GF>(Botan::Classic_McEliece_GF const*, unsigned long) Unexecuted instantiation: void Botan::CT::poison<int>(int const*, unsigned long) |
62 | | |
63 | | template <typename T> |
64 | 260M | constexpr inline void unpoison(const T* p, size_t n) { |
65 | | #if defined(BOTAN_HAS_VALGRIND) |
66 | | if(!std::is_constant_evaluated()) { |
67 | | VALGRIND_MAKE_MEM_DEFINED(p, n * sizeof(T)); |
68 | | } |
69 | | #endif |
70 | | |
71 | 260M | BOTAN_UNUSED(p, n); |
72 | 260M | } void Botan::CT::unpoison<unsigned long>(unsigned long const*, unsigned long) Line | Count | Source | 64 | 260M | constexpr inline void unpoison(const T* p, size_t n) { | 65 | | #if defined(BOTAN_HAS_VALGRIND) | 66 | | if(!std::is_constant_evaluated()) { | 67 | | VALGRIND_MAKE_MEM_DEFINED(p, n * sizeof(T)); | 68 | | } | 69 | | #endif | 70 | | | 71 | 260M | BOTAN_UNUSED(p, n); | 72 | 260M | } |
void Botan::CT::unpoison<unsigned char>(unsigned char const*, unsigned long) Line | Count | Source | 64 | 198k | constexpr inline void unpoison(const T* p, size_t n) { | 65 | | #if defined(BOTAN_HAS_VALGRIND) | 66 | | if(!std::is_constant_evaluated()) { | 67 | | VALGRIND_MAKE_MEM_DEFINED(p, n * sizeof(T)); | 68 | | } | 69 | | #endif | 70 | | | 71 | 198k | BOTAN_UNUSED(p, n); | 72 | 198k | } |
void Botan::CT::unpoison<unsigned short>(unsigned short const*, unsigned long) Line | Count | Source | 64 | 141 | constexpr inline void unpoison(const T* p, size_t n) { | 65 | | #if defined(BOTAN_HAS_VALGRIND) | 66 | | if(!std::is_constant_evaluated()) { | 67 | | VALGRIND_MAKE_MEM_DEFINED(p, n * sizeof(T)); | 68 | | } | 69 | | #endif | 70 | | | 71 | 141 | BOTAN_UNUSED(p, n); | 72 | 141 | } |
Unexecuted instantiation: void Botan::CT::unpoison<unsigned int>(unsigned int const*, unsigned long) Unexecuted instantiation: void Botan::CT::unpoison<short>(short const*, unsigned long) Unexecuted instantiation: void Botan::CT::unpoison<Botan::Classic_McEliece_GF>(Botan::Classic_McEliece_GF const*, unsigned long) Unexecuted instantiation: void Botan::CT::unpoison<bool>(bool const*, unsigned long) Unexecuted instantiation: void Botan::CT::unpoison<int>(int const*, unsigned long) |
73 | | |
74 | | /** |
75 | | * Checks whether CT::poison() and CT::unpoison() actually have an effect. |
76 | | * |
77 | | * If the build is not instrumented and/or not run using an analysis tool like |
78 | | * valgrind, the functions are no-ops and the return value is false. |
79 | | * |
80 | | * @returns true if CT::poison() and CT::unpoison() are effective |
81 | | */ |
82 | 0 | inline bool poison_has_effect() { |
83 | 0 | #if defined(BOTAN_HAS_VALGRIND) |
84 | 0 | return RUNNING_ON_VALGRIND; |
85 | 0 | #else |
86 | 0 | return false; |
87 | 0 | #endif |
88 | 0 | } |
89 | | |
90 | | /// @} |
91 | | |
92 | | /// @name Constant Time Check Annotation Convenience overloads |
93 | | /// @{ |
94 | | |
95 | | /** |
96 | | * Poison a single integral object |
97 | | */ |
98 | | template <std::integral T> |
99 | 116 | constexpr void poison(T& p) { |
100 | 116 | poison(&p, 1); |
101 | 116 | } |
102 | | |
103 | | template <std::integral T> |
104 | 260M | constexpr void unpoison(T& p) { |
105 | 260M | unpoison(&p, 1); |
106 | 260M | } _ZN5Botan2CT8unpoisonITkNSt3__18integralEmEEvRT_ Line | Count | Source | 104 | 258M | constexpr void unpoison(T& p) { | 105 | 258M | unpoison(&p, 1); | 106 | 258M | } |
_ZN5Botan2CT8unpoisonITkNSt3__18integralEKmEEvRT_ Line | Count | Source | 104 | 1.13M | constexpr void unpoison(T& p) { | 105 | 1.13M | unpoison(&p, 1); | 106 | 1.13M | } |
_ZN5Botan2CT8unpoisonITkNSt3__18integralEhEEvRT_ Line | Count | Source | 104 | 158k | constexpr void unpoison(T& p) { | 105 | 158k | unpoison(&p, 1); | 106 | 158k | } |
_ZN5Botan2CT8unpoisonITkNSt3__18integralEtEEvRT_ Line | Count | Source | 104 | 94 | constexpr void unpoison(T& p) { | 105 | 94 | unpoison(&p, 1); | 106 | 94 | } |
_ZN5Botan2CT8unpoisonITkNSt3__18integralEKhEEvRT_ Line | Count | Source | 104 | 22 | constexpr void unpoison(T& p) { | 105 | 22 | unpoison(&p, 1); | 106 | 22 | } |
Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNSt3__18integralEbEEvRT_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNSt3__18integralEjEEvRT_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNSt3__18integralEKbEEvRT_ _ZN5Botan2CT8unpoisonITkNSt3__18integralEKtEEvRT_ Line | Count | Source | 104 | 47 | constexpr void unpoison(T& p) { | 105 | 47 | unpoison(&p, 1); | 106 | 47 | } |
|
107 | | |
108 | | /** |
109 | | * Poison a contiguous buffer of trivial objects (e.g. integers and such) |
110 | | */ |
111 | | template <ranges::spanable_range R> |
112 | | requires std::is_trivially_copyable_v<std::ranges::range_value_t<R>> |
113 | 100k | constexpr void poison(R&& r) { |
114 | 100k | std::span s{r}; |
115 | 100k | poison(s.data(), s.size()); |
116 | 100k | } _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNSt3__15arrayImLm4EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_ Line | Count | Source | 113 | 42.4k | constexpr void poison(R&& r) { | 114 | 42.4k | std::span s{r}; | 115 | 42.4k | poison(s.data(), s.size()); | 116 | 42.4k | } |
_ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNSt3__15arrayImLm6EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_ Line | Count | Source | 113 | 26.9k | constexpr void poison(R&& r) { | 114 | 26.9k | std::span s{r}; | 115 | 26.9k | poison(s.data(), s.size()); | 116 | 26.9k | } |
_ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNSt3__15arrayImLm8EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_ Line | Count | Source | 113 | 6.62k | constexpr void poison(R&& r) { | 114 | 6.62k | std::span s{r}; | 115 | 6.62k | poison(s.data(), s.size()); | 116 | 6.62k | } |
_ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNSt3__15arrayImLm3EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_ Line | Count | Source | 113 | 18 | constexpr void poison(R&& r) { | 114 | 18 | std::span s{r}; | 115 | 18 | poison(s.data(), s.size()); | 116 | 18 | } |
_ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNSt3__15arrayImLm9EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_ Line | Count | Source | 113 | 21.5k | constexpr void poison(R&& r) { | 114 | 21.5k | std::span s{r}; | 115 | 21.5k | poison(s.data(), s.size()); | 116 | 21.5k | } |
_ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNSt3__16vectorIhNS_16secure_allocatorIhEEEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISH_EESI_E4type10value_typeEEEEvOSE_ Line | Count | Source | 113 | 2.33k | constexpr void poison(R&& r) { | 114 | 2.33k | std::span s{r}; | 115 | 2.33k | poison(s.data(), s.size()); | 116 | 2.33k | } |
Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_11FrodoSeedS_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISJ_EESK_E4type10value_typeEEEEvOSG_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_12FrodoSeedSE_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_15FrodoPlaintext_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_11FrodoSeedS_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNSt3__16vectorItNS_16secure_allocatorItEEEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISH_EESI_E4type10value_typeEEEEvOSE_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_28KyberImplicitRejectionValue_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_20KyberSeedRandomness_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNSt3__14spanIsLm256EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_13KyberMessage_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNSt3__14spanIKhLm18446744073709551615EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISG_EESH_E4type10value_typeEEEEvOSD_ Line | Count | Source | 113 | 116 | constexpr void poison(R&& r) { | 114 | 116 | std::span s{r}; | 115 | 116 | poison(s.data(), s.size()); | 116 | 116 | } |
Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_16CmceInitialSeed_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNSt3__16vectorINS_19Classic_McEliece_GFENS3_9allocatorIS5_EEEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISI_EESJ_E4type10value_typeEEEEvOSF_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorItNS_16secure_allocatorItEEEENS_16CmcePermutation_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_18CmceRejectionSeed_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_15CmceKeyGenSeed_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_15DilithiumSeedK_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNSt3__14spanIiLm256EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_24DilithiumSeedRandomness_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_22DilithiumSeedRhoPrime_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNS_10StrongSpanIKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_30DilithiumSerializedPrivateKey_EJEEEEEQsr3stdE23is_trivially_copyable_vINS5_11conditionalIXsr21__is_primary_templateINS5_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS5_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS5_26indirectly_readable_traitsISN_EESO_E4type10value_typeEEEEvOSK_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_24DilithiumSeedRandomness_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISJ_EESK_E4type10value_typeEEEEvOSG_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERNS_8CRYSTALS10PolynomialINS_19DilithiumPolyTraitsELNS3_6DomainE0EEEQsr3stdE23is_trivially_copyable_vINSt3__111conditionalIXsr21__is_primary_templateINS9_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS9_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS9_26indirectly_readable_traitsISH_EESI_E4type10value_typeEEEEvOSE_ Unexecuted instantiation: _ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_9LMS_SEED_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ |
117 | | |
118 | | template <ranges::spanable_range R> |
119 | | requires std::is_trivially_copyable_v<std::ranges::range_value_t<R>> |
120 | 102k | constexpr void unpoison(R&& r) { |
121 | 102k | std::span s{r}; |
122 | 102k | unpoison(s.data(), s.size()); |
123 | 102k | } _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNSt3__15arrayImLm4EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_ Line | Count | Source | 120 | 42.4k | constexpr void unpoison(R&& r) { | 121 | 42.4k | std::span s{r}; | 122 | 42.4k | unpoison(s.data(), s.size()); | 123 | 42.4k | } |
_ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNSt3__15arrayImLm6EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_ Line | Count | Source | 120 | 26.9k | constexpr void unpoison(R&& r) { | 121 | 26.9k | std::span s{r}; | 122 | 26.9k | unpoison(s.data(), s.size()); | 123 | 26.9k | } |
_ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNSt3__15arrayImLm8EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_ Line | Count | Source | 120 | 6.62k | constexpr void unpoison(R&& r) { | 121 | 6.62k | std::span s{r}; | 122 | 6.62k | unpoison(s.data(), s.size()); | 123 | 6.62k | } |
_ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNSt3__15arrayImLm3EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_ Line | Count | Source | 120 | 18 | constexpr void unpoison(R&& r) { | 121 | 18 | std::span s{r}; | 122 | 18 | unpoison(s.data(), s.size()); | 123 | 18 | } |
_ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNSt3__15arrayImLm9EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_ Line | Count | Source | 120 | 21.5k | constexpr void unpoison(R&& r) { | 121 | 21.5k | std::span s{r}; | 122 | 21.5k | unpoison(s.data(), s.size()); | 123 | 21.5k | } |
_ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNSt3__15arrayIhLm56EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISE_EESF_E4type10value_typeEEEEvOSB_ Line | Count | Source | 120 | 1.87k | constexpr void unpoison(R&& r) { | 121 | 1.87k | std::span s{r}; | 122 | 1.87k | unpoison(s.data(), s.size()); | 123 | 1.87k | } |
_ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNSt3__16vectorIhNS_16secure_allocatorIhEEEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISH_EESI_E4type10value_typeEEEEvOSE_ Line | Count | Source | 120 | 2.33k | constexpr void unpoison(R&& r) { | 121 | 2.33k | std::span s{r}; | 122 | 2.33k | unpoison(s.data(), s.size()); | 123 | 2.33k | } |
_ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNSt3__16vectorIhNS_16secure_allocatorIhEEEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISG_EESH_E4type10value_typeEEEEvOSD_ Line | Count | Source | 120 | 462 | constexpr void unpoison(R&& r) { | 121 | 462 | std::span s{r}; | 122 | 462 | unpoison(s.data(), s.size()); | 123 | 462 | } |
Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_11FrodoSeedS_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISJ_EESK_E4type10value_typeEEEEvOSG_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNSt3__16vectorItNS_16secure_allocatorItEEEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISH_EESI_E4type10value_typeEEEEvOSE_ _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNSt3__14spanIhLm18446744073709551615EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISE_EESF_E4type10value_typeEEEEvOSB_ Line | Count | Source | 120 | 116 | constexpr void unpoison(R&& r) { | 121 | 116 | std::span s{r}; | 122 | 116 | unpoison(s.data(), s.size()); | 123 | 116 | } |
Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_11FrodoSeedS_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_28KyberImplicitRejectionValue_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_20KyberSeedRandomness_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNSt3__14spanIsLm256EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNS_6StrongINSt3__16vectorIhNS4_9allocatorIhEEEENS_13KyberSeedRho_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISJ_EESK_E4type10value_typeEEEEvOSG_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNS_10StrongSpanINS_6StrongINSt3__16vectorIhNS5_9allocatorIhEEEENS_26KyberCompressedCiphertext_EJEEEEEQsr3stdE23is_trivially_copyable_vINS5_11conditionalIXsr21__is_primary_templateINS5_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS5_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS5_26indirectly_readable_traitsISL_EESM_E4type10value_typeEEEEvOSI_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNS_10StrongSpanINS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_18KyberSharedSecret_EJEEEEEQsr3stdE23is_trivially_copyable_vINS5_11conditionalIXsr21__is_primary_templateINS5_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS5_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS5_26indirectly_readable_traitsISL_EESM_E4type10value_typeEEEEvOSI_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNS_6StrongINSt3__16vectorIhNS4_9allocatorIhEEEENS_25KyberSerializedPublicKey_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISJ_EESK_E4type10value_typeEEEEvOSG_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNS_10StrongSpanIKNS_6StrongINSt3__16vectorIhNS5_9allocatorIhEEEENS_21KyberHashedPublicKey_EJEEEEEQsr3stdE23is_trivially_copyable_vINS5_11conditionalIXsr21__is_primary_templateINS5_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS5_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS5_26indirectly_readable_traitsISM_EESN_E4type10value_typeEEEEvOSJ_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_28KyberImplicitRejectionValue_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISJ_EESK_E4type10value_typeEEEEvOSG_ _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNSt3__14spanIKhLm18446744073709551615EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISG_EESH_E4type10value_typeEEEEvOSD_ Line | Count | Source | 120 | 116 | constexpr void unpoison(R&& r) { | 121 | 116 | std::span s{r}; | 122 | 116 | unpoison(s.data(), s.size()); | 123 | 116 | } |
Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_13KyberMessage_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_15CmceKeyGenSeed_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNSt3__16vectorINS_19Classic_McEliece_GFENS3_9allocatorIS5_EEEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISI_EESJ_E4type10value_typeEEEEvOSF_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorItNS_16secure_allocatorItEEEENS_16CmcePermutation_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_18CmceRejectionSeed_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNSt3__16vectorIhNS3_9allocatorIhEEEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISH_EESI_E4type10value_typeEEEEvOSE_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNSt3__15arrayIhLm57EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISE_EESF_E4type10value_typeEEEEvOSB_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNSt3__15arrayIhLm114EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNS_6StrongINSt3__16vectorIhNS4_9allocatorIhEEEENS_24DilithiumCommitmentHash_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISJ_EESK_E4type10value_typeEEEEvOSG_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNSt3__14spanIiLm256EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_15DilithiumSeedK_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_24DilithiumSeedRandomness_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_30DilithiumSerializedPrivateKey_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISJ_EESK_E4type10value_typeEEEEvOSG_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNS_6StrongINSt3__16vectorIhNS4_9allocatorIhEEEENS_20DilithiumPublicSeed_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISJ_EESK_E4type10value_typeEEEEvOSG_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNS_6StrongINSt3__16vectorIhNS4_9allocatorIhEEEENS_25DilithiumHashedPublicKey_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISJ_EESK_E4type10value_typeEEEEvOSG_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNS_10StrongSpanIKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_30DilithiumSerializedPrivateKey_EJEEEEEQsr3stdE23is_trivially_copyable_vINS5_11conditionalIXsr21__is_primary_templateINS5_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS5_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS5_26indirectly_readable_traitsISN_EESO_E4type10value_typeEEEEvOSK_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS4_9allocatorIhEEEENS_14LMS_Tree_Node_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_9LMS_SEED_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEEEvOSH_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNSt3__16vectorIhNS3_9allocatorIhEEEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISG_EESH_E4type10value_typeEEEEvOSD_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNS_6StrongINSt3__16vectorIhNS4_9allocatorIhEEEENS_15LMS_Identifier_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISJ_EESK_E4type10value_typeEEEEvOSG_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERKNSt3__14spanIhLm18446744073709551615EEEQsr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeERNS_6StrongINSt3__16vectorIhNS4_9allocatorIhEEEENS_14LMS_Tree_Node_EJEEEQsr3stdE23is_trivially_copyable_vINS4_11conditionalIXsr21__is_primary_templateINS4_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS4_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS4_26indirectly_readable_traitsISJ_EESK_E4type10value_typeEEEEvOSG_ |
124 | | |
125 | | /** |
126 | | * Poison a class type that provides a public `_const_time_poison()` method |
127 | | * For instance: BigInt, CT::Mask<>, FrodoMatrix, ... |
128 | | */ |
129 | | template <typename T> |
130 | | requires requires(const T& x) { x._const_time_poison(); } |
131 | 208k | constexpr void poison(const T& x) { |
132 | 208k | x._const_time_poison(); |
133 | 208k | } _ZN5Botan2CT6poisonINS_6BigIntEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvS5_ Line | Count | Source | 131 | 39.7k | constexpr void poison(const T& x) { | 132 | 39.7k | x._const_time_poison(); | 133 | 39.7k | } |
_ZN5Botan2CT6poisonINS_14Montgomery_IntEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvS5_ Line | Count | Source | 131 | 39.0k | constexpr void poison(const T& x) { | 132 | 39.0k | x._const_time_poison(); | 133 | 39.0k | } |
pcurves_brainpool256r1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool256r16ParamsES5_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSI_ Line | Count | Source | 131 | 7.58k | constexpr void poison(const T& x) { | 132 | 7.58k | x._const_time_poison(); | 133 | 7.58k | } |
pcurves_brainpool256r1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_16IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool256r16ParamsES4_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSG_ Line | Count | Source | 131 | 22.7k | constexpr void poison(const T& x) { | 132 | 22.7k | x._const_time_poison(); | 133 | 22.7k | } |
pcurves_brainpool384r1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool384r16ParamsES5_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSI_ Line | Count | Source | 131 | 2.55k | constexpr void poison(const T& x) { | 132 | 2.55k | x._const_time_poison(); | 133 | 2.55k | } |
pcurves_brainpool384r1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_16IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool384r16ParamsES4_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSG_ Line | Count | Source | 131 | 7.67k | constexpr void poison(const T& x) { | 132 | 7.67k | x._const_time_poison(); | 133 | 7.67k | } |
pcurves_brainpool512r1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool512r16ParamsES5_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSI_ Line | Count | Source | 131 | 2.20k | constexpr void poison(const T& x) { | 132 | 2.20k | x._const_time_poison(); | 133 | 2.20k | } |
pcurves_brainpool512r1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_16IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool512r16ParamsES4_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSG_ Line | Count | Source | 131 | 6.62k | constexpr void poison(const T& x) { | 132 | 6.62k | x._const_time_poison(); | 133 | 6.62k | } |
Unexecuted instantiation: pcurves_frp256v1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_18frp256v16ParamsES5_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSI_ Unexecuted instantiation: pcurves_frp256v1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_16IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_18frp256v16ParamsES4_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSG_ Unexecuted instantiation: pcurves_numsp512d1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_110numsp512d113Numsp512d1RepINS2_13EllipticCurveINS7_6ParamsES8_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSI_ Unexecuted instantiation: pcurves_numsp512d1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_110numsp512d113Numsp512d1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSG_ pcurves_secp192r1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_19secp192r112Secp192r1RepINS2_13EllipticCurveINS7_6ParamsES8_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSI_ Line | Count | Source | 131 | 6 | constexpr void poison(const T& x) { | 132 | 6 | x._const_time_poison(); | 133 | 6 | } |
pcurves_secp192r1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19secp192r112Secp192r1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSG_ Line | Count | Source | 131 | 18 | constexpr void poison(const T& x) { | 132 | 18 | x._const_time_poison(); | 133 | 18 | } |
pcurves_secp224r1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_19secp224r112Secp224r1RepINS2_13EllipticCurveINS7_6ParamsES8_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSI_ Line | Count | Source | 131 | 6 | constexpr void poison(const T& x) { | 132 | 6 | x._const_time_poison(); | 133 | 6 | } |
pcurves_secp224r1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19secp224r112Secp224r1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSG_ Line | Count | Source | 131 | 18 | constexpr void poison(const T& x) { | 132 | 18 | x._const_time_poison(); | 133 | 18 | } |
pcurves_secp256k1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_19secp256k112Secp256k1RepINS2_13EllipticCurveINS7_6ParamsES8_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSI_ Line | Count | Source | 131 | 6 | constexpr void poison(const T& x) { | 132 | 6 | x._const_time_poison(); | 133 | 6 | } |
pcurves_secp256k1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19secp256k112Secp256k1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSG_ Line | Count | Source | 131 | 18 | constexpr void poison(const T& x) { | 132 | 18 | x._const_time_poison(); | 133 | 18 | } |
pcurves_secp256r1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_112Secp256r1RepINS2_13EllipticCurveINS6_9secp256r16ParamsES7_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSI_ Line | Count | Source | 131 | 6.55k | constexpr void poison(const T& x) { | 132 | 6.55k | x._const_time_poison(); | 133 | 6.55k | } |
pcurves_secp256r1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_112Secp256r1RepINS2_13EllipticCurveINS5_9secp256r16ParamsES6_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSG_ Line | Count | Source | 131 | 19.6k | constexpr void poison(const T& x) { | 132 | 19.6k | x._const_time_poison(); | 133 | 19.6k | } |
pcurves_secp384r1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_112Secp384r1RepINS2_13EllipticCurveINS6_9secp384r16ParamsES7_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSI_ Line | Count | Source | 131 | 6.43k | constexpr void poison(const T& x) { | 132 | 6.43k | x._const_time_poison(); | 133 | 6.43k | } |
pcurves_secp384r1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_112Secp384r1RepINS2_13EllipticCurveINS5_9secp384r16ParamsES6_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSG_ Line | Count | Source | 131 | 19.3k | constexpr void poison(const T& x) { | 132 | 19.3k | x._const_time_poison(); | 133 | 19.3k | } |
pcurves_secp521r1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_19secp521r17P521RepINS2_13EllipticCurveINS7_6ParamsES8_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSI_ Line | Count | Source | 131 | 7.16k | constexpr void poison(const T& x) { | 132 | 7.16k | x._const_time_poison(); | 133 | 7.16k | } |
pcurves_secp521r1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19secp521r17P521RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSG_ Line | Count | Source | 131 | 21.5k | constexpr void poison(const T& x) { | 132 | 21.5k | x._const_time_poison(); | 133 | 21.5k | } |
Unexecuted instantiation: pcurves_sm2p256v1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_19sm2p256v112Sm2p256v1RepINS2_13EllipticCurveINS7_6ParamsES8_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSI_ Unexecuted instantiation: pcurves_sm2p256v1.cpp:_ZN5Botan2CT6poisonINS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19sm2p256v112Sm2p256v1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSG_ Unexecuted instantiation: _ZN5Botan2CT6poisonINS_27FrodoKEM_PrivateKeyInternalEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT6poisonINS_11FrodoMatrixEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT6poisonINS_8CRYSTALS16PolynomialVectorINS_15KyberPolyTraitsELNS2_6DomainE1EEEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvS9_ Unexecuted instantiation: _ZN5Botan2CT6poisonINS_8CRYSTALS10PolynomialINS_15KyberPolyTraitsELNS2_6DomainE1EEEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvS9_ Unexecuted instantiation: _ZN5Botan2CT6poisonINS_24Kyber_PrivateKeyInternalEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT6poisonINS_31Classic_McEliece_Field_OrderingEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT6poisonINS_35Classic_McEliece_Minimal_PolynomialEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT6poisonINS_6StrongINS_14bitvector_baseINS_16secure_allocatorEEENS_20CmceColumnSelection_EJEEEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvSA_ Unexecuted instantiation: _ZN5Botan2CT6poisonINS_35Classic_McEliece_PrivateKeyInternalEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT6poisonINS_28Dilithium_PrivateKeyInternalEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT6poisonINS_8CRYSTALS16PolynomialVectorINS_19DilithiumPolyTraitsELNS2_6DomainE0EEEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvS9_ Unexecuted instantiation: _ZN5Botan2CT6poisonINS_8CRYSTALS10PolynomialINS_19DilithiumPolyTraitsELNS2_6DomainE0EEEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvS9_ Unexecuted instantiation: _ZN5Botan2CT6poisonINS_26HSS_LMS_PrivateKeyInternalEQrQRKT__XcldtfL0p_18_const_time_poisonEEEEvS5_ |
134 | | |
135 | | template <typename T> |
136 | | requires requires(const T& x) { x._const_time_unpoison(); } |
137 | 171k | constexpr void unpoison(const T& x) { |
138 | 171k | x._const_time_unpoison(); |
139 | 171k | } _ZN5Botan2CT8unpoisonINS_6BigIntEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS5_ Line | Count | Source | 137 | 21.7k | constexpr void unpoison(const T& x) { | 138 | 21.7k | x._const_time_unpoison(); | 139 | 21.7k | } |
_ZN5Botan2CT8unpoisonINS_14Montgomery_IntEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS5_ Line | Count | Source | 137 | 19.7k | constexpr void unpoison(const T& x) { | 138 | 19.7k | x._const_time_unpoison(); | 139 | 19.7k | } |
pcurves_brainpool256r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool256r16ParamsES5_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSI_ Line | Count | Source | 137 | 7.58k | constexpr void unpoison(const T& x) { | 138 | 7.58k | x._const_time_unpoison(); | 139 | 7.58k | } |
pcurves_brainpool256r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_16IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool256r16ParamsES4_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSG_ Line | Count | Source | 137 | 22.7k | constexpr void unpoison(const T& x) { | 138 | 22.7k | x._const_time_unpoison(); | 139 | 22.7k | } |
pcurves_brainpool384r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool384r16ParamsES5_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSI_ Line | Count | Source | 137 | 2.55k | constexpr void unpoison(const T& x) { | 138 | 2.55k | x._const_time_unpoison(); | 139 | 2.55k | } |
pcurves_brainpool384r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_16IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool384r16ParamsES4_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSG_ Line | Count | Source | 137 | 7.67k | constexpr void unpoison(const T& x) { | 138 | 7.67k | x._const_time_unpoison(); | 139 | 7.67k | } |
pcurves_brainpool512r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool512r16ParamsES5_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSI_ Line | Count | Source | 137 | 2.20k | constexpr void unpoison(const T& x) { | 138 | 2.20k | x._const_time_unpoison(); | 139 | 2.20k | } |
pcurves_brainpool512r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_16IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool512r16ParamsES4_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSG_ Line | Count | Source | 137 | 6.62k | constexpr void unpoison(const T& x) { | 138 | 6.62k | x._const_time_unpoison(); | 139 | 6.62k | } |
Unexecuted instantiation: pcurves_frp256v1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_18frp256v16ParamsES5_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSI_ Unexecuted instantiation: pcurves_frp256v1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_16IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_18frp256v16ParamsES4_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSG_ Unexecuted instantiation: pcurves_numsp512d1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_110numsp512d113Numsp512d1RepINS2_13EllipticCurveINS7_6ParamsES8_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSI_ Unexecuted instantiation: pcurves_numsp512d1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_110numsp512d113Numsp512d1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSG_ pcurves_secp192r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_19secp192r112Secp192r1RepINS2_13EllipticCurveINS7_6ParamsES8_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSI_ Line | Count | Source | 137 | 6 | constexpr void unpoison(const T& x) { | 138 | 6 | x._const_time_unpoison(); | 139 | 6 | } |
pcurves_secp192r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19secp192r112Secp192r1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSG_ Line | Count | Source | 137 | 18 | constexpr void unpoison(const T& x) { | 138 | 18 | x._const_time_unpoison(); | 139 | 18 | } |
pcurves_secp224r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_19secp224r112Secp224r1RepINS2_13EllipticCurveINS7_6ParamsES8_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSI_ Line | Count | Source | 137 | 6 | constexpr void unpoison(const T& x) { | 138 | 6 | x._const_time_unpoison(); | 139 | 6 | } |
pcurves_secp224r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19secp224r112Secp224r1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSG_ Line | Count | Source | 137 | 18 | constexpr void unpoison(const T& x) { | 138 | 18 | x._const_time_unpoison(); | 139 | 18 | } |
pcurves_secp256k1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_19secp256k112Secp256k1RepINS2_13EllipticCurveINS7_6ParamsES8_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSI_ Line | Count | Source | 137 | 6 | constexpr void unpoison(const T& x) { | 138 | 6 | x._const_time_unpoison(); | 139 | 6 | } |
pcurves_secp256k1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19secp256k112Secp256k1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSG_ Line | Count | Source | 137 | 18 | constexpr void unpoison(const T& x) { | 138 | 18 | x._const_time_unpoison(); | 139 | 18 | } |
pcurves_secp256r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_112Secp256r1RepINS2_13EllipticCurveINS6_9secp256r16ParamsES7_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSI_ Line | Count | Source | 137 | 6.55k | constexpr void unpoison(const T& x) { | 138 | 6.55k | x._const_time_unpoison(); | 139 | 6.55k | } |
pcurves_secp256r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_112Secp256r1RepINS2_13EllipticCurveINS5_9secp256r16ParamsES6_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSG_ Line | Count | Source | 137 | 19.6k | constexpr void unpoison(const T& x) { | 138 | 19.6k | x._const_time_unpoison(); | 139 | 19.6k | } |
Unexecuted instantiation: pcurves_secp256r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_116AffineCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_112Secp256r1RepINS2_13EllipticCurveINS6_9secp256r16ParamsES7_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSI_ pcurves_secp384r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_112Secp384r1RepINS2_13EllipticCurveINS6_9secp384r16ParamsES7_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSI_ Line | Count | Source | 137 | 6.43k | constexpr void unpoison(const T& x) { | 138 | 6.43k | x._const_time_unpoison(); | 139 | 6.43k | } |
pcurves_secp384r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_112Secp384r1RepINS2_13EllipticCurveINS5_9secp384r16ParamsES6_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSG_ Line | Count | Source | 137 | 19.3k | constexpr void unpoison(const T& x) { | 138 | 19.3k | x._const_time_unpoison(); | 139 | 19.3k | } |
Unexecuted instantiation: pcurves_secp384r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_116AffineCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_112Secp384r1RepINS2_13EllipticCurveINS6_9secp384r16ParamsES7_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSI_ pcurves_secp521r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_19secp521r17P521RepINS2_13EllipticCurveINS7_6ParamsES8_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSI_ Line | Count | Source | 137 | 7.16k | constexpr void unpoison(const T& x) { | 138 | 7.16k | x._const_time_unpoison(); | 139 | 7.16k | } |
pcurves_secp521r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19secp521r17P521RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSG_ Line | Count | Source | 137 | 21.5k | constexpr void unpoison(const T& x) { | 138 | 21.5k | x._const_time_unpoison(); | 139 | 21.5k | } |
Unexecuted instantiation: pcurves_secp521r1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_116AffineCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_19secp521r17P521RepINS2_13EllipticCurveINS7_6ParamsES8_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSI_ Unexecuted instantiation: pcurves_sm2p256v1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_120ProjectiveCurvePointINS2_6IntModINS_6PCurve12_GLOBAL__N_19sm2p256v112Sm2p256v1RepINS2_13EllipticCurveINS7_6ParamsES8_E11FieldParamsEEEEESA_EEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSI_ Unexecuted instantiation: pcurves_sm2p256v1.cpp:_ZN5Botan2CT8unpoisonINS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19sm2p256v112Sm2p256v1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSG_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS_11FrodoMatrixEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS_27FrodoKEM_PrivateKeyInternalEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS_8CRYSTALS16PolynomialVectorINS_15KyberPolyTraitsELNS2_6DomainE1EEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS9_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS_8CRYSTALS10PolynomialINS_15KyberPolyTraitsELNS2_6DomainE1EEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS9_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS_24Kyber_PrivateKeyInternalEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS0_4MaskIhEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS6_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS_35Classic_McEliece_PrivateKeyInternalEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS_6StrongINS_14bitvector_baseINS_16secure_allocatorEEENS_20CmceColumnSelection_EJEEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvSA_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS_35Classic_McEliece_Minimal_PolynomialEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS_31Classic_McEliece_Field_OrderingEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS_34Classic_McEliece_PublicKeyInternalEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS_23Classic_McEliece_MatrixEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS_8CRYSTALS16PolynomialVectorINS_19DilithiumPolyTraitsELNS2_6DomainE0EEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS9_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS_8CRYSTALS10PolynomialINS_19DilithiumPolyTraitsELNS2_6DomainE0EEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS9_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS_28Dilithium_PrivateKeyInternalEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS_25HSS_LMS_PublicKeyInternalEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS_13LMS_PublicKeyEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS5_ Unexecuted instantiation: _ZN5Botan2CT8unpoisonINS_26HSS_LMS_PrivateKeyInternalEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS5_ _ZN5Botan2CT8unpoisonINS0_4MaskItEEQrQRKT__XcldtfL0p_20_const_time_unpoisonEEEEvS6_ Line | Count | Source | 137 | 47 | constexpr void unpoison(const T& x) { | 138 | 47 | x._const_time_unpoison(); | 139 | 47 | } |
|
140 | | |
141 | | /** |
142 | | * Poison an optional object if it has a value. |
143 | | */ |
144 | | template <typename T> |
145 | | requires requires(const T& v) { ::Botan::CT::poison(v); } |
146 | 0 | constexpr void poison(const std::optional<T>& x) { |
147 | 0 | if(x.has_value()) { |
148 | 0 | poison(x.value()); |
149 | 0 | } |
150 | 0 | } |
151 | | |
152 | | template <typename T> |
153 | | requires requires(const T& v) { ::Botan::CT::unpoison(v); } |
154 | 0 | constexpr void unpoison(const std::optional<T>& x) { |
155 | 0 | if(x.has_value()) { |
156 | 0 | unpoison(x.value()); |
157 | 0 | } |
158 | 0 | } |
159 | | |
160 | | /// @} |
161 | | |
162 | | /// @name Higher-level Constant Time Check Annotation Helpers |
163 | | /// @{ |
164 | | |
165 | | template <typename T> |
166 | | concept poisonable = requires(const T& v) { ::Botan::CT::poison(v); }; |
167 | | template <typename T> |
168 | | concept unpoisonable = requires(const T& v) { ::Botan::CT::unpoison(v); }; |
169 | | |
170 | | /** |
171 | | * Poison a range of objects by calling `poison` on each element. |
172 | | */ |
173 | | template <std::ranges::range R> |
174 | | requires poisonable<std::ranges::range_value_t<R>> |
175 | 2.44k | constexpr void poison_range(R&& r) { |
176 | 39.0k | for(const auto& v : r) { |
177 | 39.0k | poison(v); |
178 | 39.0k | } |
179 | 2.44k | } _ZN5Botan2CT12poison_rangeITkNSt3__16ranges5rangeERNS2_6vectorINS_14Montgomery_IntENS2_9allocatorIS5_EEEEQ10poisonableINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISG_EESH_E4type10value_typeEEEEvOSD_ Line | Count | Source | 175 | 2.44k | constexpr void poison_range(R&& r) { | 176 | 39.0k | for(const auto& v : r) { | 177 | 39.0k | poison(v); | 178 | 39.0k | } | 179 | 2.44k | } |
Unexecuted instantiation: _ZN5Botan2CT12poison_rangeITkNSt3__16ranges5rangeERKNS2_6vectorINS_8CRYSTALS10PolynomialINS_15KyberPolyTraitsELNS5_6DomainE1EEENS2_9allocatorIS9_EEEEQ10poisonableINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISL_EESM_E4type10value_typeEEEEvOSI_ Unexecuted instantiation: _ZN5Botan2CT12poison_rangeITkNSt3__16ranges5rangeERKNS2_6vectorINS_8CRYSTALS10PolynomialINS_19DilithiumPolyTraitsELNS5_6DomainE0EEENS2_9allocatorIS9_EEEEQ10poisonableINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISL_EESM_E4type10value_typeEEEEvOSI_ |
180 | | |
181 | | template <std::ranges::range R> |
182 | | requires unpoisonable<std::ranges::range_value_t<R>> |
183 | 0 | constexpr void unpoison_range(R&& r) { |
184 | 0 | for(const auto& v : r) { |
185 | 0 | unpoison(v); |
186 | 0 | } |
187 | 0 | } Unexecuted instantiation: _ZN5Botan2CT14unpoison_rangeITkNSt3__16ranges5rangeERKNS2_6vectorINS_8CRYSTALS10PolynomialINS_15KyberPolyTraitsELNS5_6DomainE1EEENS2_9allocatorIS9_EEEEQ12unpoisonableINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISL_EESM_E4type10value_typeEEEEvOSI_ Unexecuted instantiation: _ZN5Botan2CT14unpoison_rangeITkNSt3__16ranges5rangeERKNS2_6vectorINS_8CRYSTALS10PolynomialINS_19DilithiumPolyTraitsELNS5_6DomainE0EEENS2_9allocatorIS9_EEEEQ12unpoisonableINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISL_EESM_E4type10value_typeEEEEvOSI_ |
188 | | |
189 | | /** |
190 | | * Poisons an arbitrary number of values in a single call. |
191 | | * Mostly syntactic sugar to save clutter (i.e. lines-of-code). |
192 | | */ |
193 | | template <poisonable... Ts> |
194 | | requires(sizeof...(Ts) > 0) |
195 | 35.3k | constexpr void poison_all(Ts&&... ts) { |
196 | 35.3k | (poison(ts), ...); |
197 | 35.3k | } _ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRNS_6BigIntES3_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 195 | 329 | constexpr void poison_all(Ts&&... ts) { | 196 | 329 | (poison(ts), ...); | 197 | 329 | } |
pcurves_brainpool256r1.cpp:_ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_12_GLOBAL__N_16IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool256r16ParamsES4_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 195 | 7.58k | constexpr void poison_all(Ts&&... ts) { | 196 | 7.58k | (poison(ts), ...); | 197 | 7.58k | } |
pcurves_brainpool384r1.cpp:_ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_12_GLOBAL__N_16IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool384r16ParamsES4_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 195 | 2.55k | constexpr void poison_all(Ts&&... ts) { | 196 | 2.55k | (poison(ts), ...); | 197 | 2.55k | } |
pcurves_brainpool512r1.cpp:_ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_12_GLOBAL__N_16IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool512r16ParamsES4_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 195 | 2.20k | constexpr void poison_all(Ts&&... ts) { | 196 | 2.20k | (poison(ts), ...); | 197 | 2.20k | } |
Unexecuted instantiation: pcurves_frp256v1.cpp:_ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_12_GLOBAL__N_16IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_18frp256v16ParamsES4_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: pcurves_numsp512d1.cpp:_ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_110numsp512d113Numsp512d1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ pcurves_secp192r1.cpp:_ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19secp192r112Secp192r1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 195 | 6 | constexpr void poison_all(Ts&&... ts) { | 196 | 6 | (poison(ts), ...); | 197 | 6 | } |
pcurves_secp224r1.cpp:_ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19secp224r112Secp224r1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 195 | 6 | constexpr void poison_all(Ts&&... ts) { | 196 | 6 | (poison(ts), ...); | 197 | 6 | } |
pcurves_secp256k1.cpp:_ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19secp256k112Secp256k1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 195 | 6 | constexpr void poison_all(Ts&&... ts) { | 196 | 6 | (poison(ts), ...); | 197 | 6 | } |
pcurves_secp256r1.cpp:_ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_112Secp256r1RepINS2_13EllipticCurveINS5_9secp256r16ParamsES6_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 195 | 6.55k | constexpr void poison_all(Ts&&... ts) { | 196 | 6.55k | (poison(ts), ...); | 197 | 6.55k | } |
pcurves_secp384r1.cpp:_ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_112Secp384r1RepINS2_13EllipticCurveINS5_9secp384r16ParamsES6_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 195 | 6.43k | constexpr void poison_all(Ts&&... ts) { | 196 | 6.43k | (poison(ts), ...); | 197 | 6.43k | } |
pcurves_secp521r1.cpp:_ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19secp521r17P521RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 195 | 7.16k | constexpr void poison_all(Ts&&... ts) { | 196 | 7.16k | (poison(ts), ...); | 197 | 7.16k | } |
Unexecuted instantiation: pcurves_sm2p256v1.cpp:_ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19sm2p256v112Sm2p256v1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ _ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNSt3__16vectorIhNS_16secure_allocatorIhEEEEEQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 195 | 2.33k | constexpr void poison_all(Ts&&... ts) { | 196 | 2.33k | (poison(ts), ...); | 197 | 2.33k | } |
Unexecuted instantiation: _ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_11FrodoSeedS_EJEEERKNS2_IS7_NS_12FrodoSeedSE_EJEEEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_27FrodoKEM_PrivateKeyInternalEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_11FrodoSeedS_EJEEERKNS_11FrodoMatrixEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_8CRYSTALS16PolynomialVectorINS_15KyberPolyTraitsELNS2_6DomainE1EEERKNSt3__18optionalINS_6StrongINS9_6vectorIhNS_16secure_allocatorIhEEEENS_20KyberSeedRandomness_EJEEEEERKNSB_ISF_NS_28KyberImplicitRejectionValue_EJEEEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_24Kyber_PrivateKeyInternalEEQgtsZT_Li0EEEvDpOT_ _ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNSt3__14spanIKhLm18446744073709551615EEEEQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 195 | 116 | constexpr void poison_all(Ts&&... ts) { | 196 | 116 | (poison(ts), ...); | 197 | 116 | } |
Unexecuted instantiation: _ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_13KyberMessage_EJEEEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_15CmceKeyGenSeed_EJEEERKNS2_INS_14bitvector_baseIS5_EENS_20CmceColumnSelection_EJEEERKNS_35Classic_McEliece_Minimal_PolynomialERKNS_31Classic_McEliece_Field_OrderingERKNS2_IS7_NS_18CmceRejectionSeed_EJEEEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_35Classic_McEliece_PrivateKeyInternalEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_28Dilithium_PrivateKeyInternalEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_15DilithiumSeedK_EJEEERKNS_8CRYSTALS16PolynomialVectorINS_19DilithiumPolyTraitsELNSC_6DomainE0EEESI_SI_EQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_10StrongSpanIKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_30DilithiumSerializedPrivateKey_EJEEEEEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT10poison_allITpTkNS0_10poisonableEJRKNS_26HSS_LMS_PrivateKeyInternalEEQgtsZT_Li0EEEvDpOT_ |
198 | | |
199 | | template <unpoisonable... Ts> |
200 | | requires(sizeof...(Ts) > 0) |
201 | 35.4k | constexpr void unpoison_all(Ts&&... ts) { |
202 | 35.4k | (unpoison(ts), ...); |
203 | 35.4k | } _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRNS_6BigIntES3_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 201 | 329 | constexpr void unpoison_all(Ts&&... ts) { | 202 | 329 | (unpoison(ts), ...); | 203 | 329 | } |
pcurves_brainpool256r1.cpp:_ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_12_GLOBAL__N_16IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool256r16ParamsES4_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 201 | 7.58k | constexpr void unpoison_all(Ts&&... ts) { | 202 | 7.58k | (unpoison(ts), ...); | 203 | 7.58k | } |
pcurves_brainpool384r1.cpp:_ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_12_GLOBAL__N_16IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool384r16ParamsES4_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 201 | 2.55k | constexpr void unpoison_all(Ts&&... ts) { | 202 | 2.55k | (unpoison(ts), ...); | 203 | 2.55k | } |
pcurves_brainpool512r1.cpp:_ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_12_GLOBAL__N_16IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_114brainpool512r16ParamsES4_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 201 | 2.20k | constexpr void unpoison_all(Ts&&... ts) { | 202 | 2.20k | (unpoison(ts), ...); | 203 | 2.20k | } |
Unexecuted instantiation: pcurves_frp256v1.cpp:_ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_12_GLOBAL__N_16IntModINS2_13MontgomeryRepINS2_13EllipticCurveINS_6PCurve12_GLOBAL__N_18frp256v16ParamsES4_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: pcurves_numsp512d1.cpp:_ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_110numsp512d113Numsp512d1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ pcurves_secp192r1.cpp:_ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19secp192r112Secp192r1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 201 | 6 | constexpr void unpoison_all(Ts&&... ts) { | 202 | 6 | (unpoison(ts), ...); | 203 | 6 | } |
pcurves_secp224r1.cpp:_ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19secp224r112Secp224r1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 201 | 6 | constexpr void unpoison_all(Ts&&... ts) { | 202 | 6 | (unpoison(ts), ...); | 203 | 6 | } |
pcurves_secp256k1.cpp:_ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19secp256k112Secp256k1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 201 | 6 | constexpr void unpoison_all(Ts&&... ts) { | 202 | 6 | (unpoison(ts), ...); | 203 | 6 | } |
pcurves_secp256r1.cpp:_ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_112Secp256r1RepINS2_13EllipticCurveINS5_9secp256r16ParamsES6_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 201 | 6.55k | constexpr void unpoison_all(Ts&&... ts) { | 202 | 6.55k | (unpoison(ts), ...); | 203 | 6.55k | } |
Unexecuted instantiation: pcurves_secp256r1.cpp:_ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_112Secp256r1RepINS2_13EllipticCurveINS5_9secp256r16ParamsES6_E11FieldParamsEEEEESF_EQgtsZT_Li0EEEvDpOT_ pcurves_secp384r1.cpp:_ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_112Secp384r1RepINS2_13EllipticCurveINS5_9secp384r16ParamsES6_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 201 | 6.43k | constexpr void unpoison_all(Ts&&... ts) { | 202 | 6.43k | (unpoison(ts), ...); | 203 | 6.43k | } |
Unexecuted instantiation: pcurves_secp384r1.cpp:_ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_112Secp384r1RepINS2_13EllipticCurveINS5_9secp384r16ParamsES6_E11FieldParamsEEEEESF_EQgtsZT_Li0EEEvDpOT_ pcurves_secp521r1.cpp:_ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19secp521r17P521RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 201 | 7.16k | constexpr void unpoison_all(Ts&&... ts) { | 202 | 7.16k | (unpoison(ts), ...); | 203 | 7.16k | } |
Unexecuted instantiation: pcurves_secp521r1.cpp:_ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19secp521r17P521RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEESF_EQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: pcurves_sm2p256v1.cpp:_ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_12_GLOBAL__N_16IntModINS_6PCurve12_GLOBAL__N_19sm2p256v112Sm2p256v1RepINS2_13EllipticCurveINS6_6ParamsES7_E11FieldParamsEEEEESF_SF_EQgtsZT_Li0EEEvDpOT_ _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNSt3__16vectorIhNS_16secure_allocatorIhEEEEEQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 201 | 2.33k | constexpr void unpoison_all(Ts&&... ts) { | 202 | 2.33k | (unpoison(ts), ...); | 203 | 2.33k | } |
Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_11FrodoSeedS_EJEEERNS_11FrodoMatrixESC_EQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRNSt3__14spanIhLm18446744073709551615EEES5_EQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_27FrodoKEM_PrivateKeyInternalEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_11FrodoSeedS_EJEEERKNS_11FrodoMatrixEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_8CRYSTALS16PolynomialVectorINS_15KyberPolyTraitsELNS2_6DomainE1EEERKNSt3__18optionalINS_6StrongINS9_6vectorIhNS_16secure_allocatorIhEEEENS_20KyberSeedRandomness_EJEEEEERKNSB_ISF_NS_28KyberImplicitRejectionValue_EJEEEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_20KyberSeedRandomness_EJEEERNS_8CRYSTALS16PolynomialVectorINS_15KyberPolyTraitsELNSC_6DomainE1EEESH_EQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRNS_10StrongSpanINS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_18KyberSharedSecret_EJEEEEERNS2_INS3_INS5_IhNS4_9allocatorIhEEEENS_26KyberCompressedCiphertext_EJEEEEEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRNS_6StrongINSt3__16vectorIhNS3_9allocatorIhEEEENS_25KyberSerializedPublicKey_EJEEERNS_10StrongSpanIKNS2_IS7_NS_21KyberHashedPublicKey_EJEEEEERNS_8CRYSTALS16PolynomialVectorINS_15KyberPolyTraitsELNSH_6DomainE1EEERNS2_INS4_IhNS_16secure_allocatorIhEEEENS_28KyberImplicitRejectionValue_EJEEEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_24Kyber_PrivateKeyInternalEEQgtsZT_Li0EEEvDpOT_ _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNSt3__14spanIKhLm18446744073709551615EEEEQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 201 | 116 | constexpr void unpoison_all(Ts&&... ts) { | 202 | 116 | (unpoison(ts), ...); | 203 | 116 | } |
Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_13KyberMessage_EJEEEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRNS_35Classic_McEliece_PrivateKeyInternalERNS_34Classic_McEliece_PublicKeyInternalEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_15CmceKeyGenSeed_EJEEERKNS2_INS_14bitvector_baseIS5_EENS_20CmceColumnSelection_EJEEERKNS_35Classic_McEliece_Minimal_PolynomialERKNS_31Classic_McEliece_Field_OrderingERKNS2_IS7_NS_18CmceRejectionSeed_EJEEEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRNS_34Classic_McEliece_PublicKeyInternalERNS_35Classic_McEliece_PrivateKeyInternalEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_35Classic_McEliece_PrivateKeyInternalEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_28Dilithium_PrivateKeyInternalEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_15DilithiumSeedK_EJEEERKNS_8CRYSTALS16PolynomialVectorINS_19DilithiumPolyTraitsELNSC_6DomainE0EEESI_SI_EQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_10StrongSpanIKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_30DilithiumSerializedPrivateKey_EJEEEEEEQgtsZT_Li0EEEvDpOT_ Unexecuted instantiation: _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRKNS_26HSS_LMS_PrivateKeyInternalEEQgtsZT_Li0EEEvDpOT_ _ZN5Botan2CT12unpoison_allITpTkNS0_12unpoisonableEJRNSt3__14spanIhLm18446744073709551615EEERKmEQgtsZT_Li0EEEvDpOT_ Line | Count | Source | 201 | 116 | constexpr void unpoison_all(Ts&&... ts) { | 202 | 116 | (unpoison(ts), ...); | 203 | 116 | } |
|
204 | | |
205 | | /** |
206 | | * Poisons an arbitrary number of poisonable values, and unpoisons them when the |
207 | | * returned object runs out-of-scope |
208 | | * |
209 | | * Use this when you want to poison a value that remains valid longer than the |
210 | | * scope you are currently in. For instance, a private key structure that is a |
211 | | * member of a Signature_Operation object, that may be used for multiple |
212 | | * signatures. |
213 | | */ |
214 | | template <typename... Ts> |
215 | | requires(sizeof...(Ts) > 0) && (poisonable<Ts> && ...) && (unpoisonable<Ts> && ...) |
216 | 2.45k | [[nodiscard]] constexpr auto scoped_poison(const Ts&... xs) { |
217 | 2.45k | auto scope = scoped_cleanup([&] { unpoison_all(xs...); }); _ZZN5Botan2CT13scoped_poisonIJNSt3__16vectorIhNS_16secure_allocatorIhEEEEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableIS7_EEEDaDpRKS7_ENKUlvE_clEv Line | Count | Source | 217 | 2.33k | auto scope = scoped_cleanup([&] { unpoison_all(xs...); }); |
Unexecuted instantiation: _ZZN5Botan2CT13scoped_poisonIJNS_27FrodoKEM_PrivateKeyInternalEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableIS3_EEEDaDpRKS3_ENKUlvE_clEv Unexecuted instantiation: _ZZN5Botan2CT13scoped_poisonIJNS_24Kyber_PrivateKeyInternalEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableIS3_EEEDaDpRKS3_ENKUlvE_clEv _ZZN5Botan2CT13scoped_poisonIJNSt3__14spanIKhLm18446744073709551615EEEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableIS6_EEEDaDpRKS6_ENKUlvE_clEv Line | Count | Source | 217 | 116 | auto scope = scoped_cleanup([&] { unpoison_all(xs...); }); |
Unexecuted instantiation: _ZZN5Botan2CT13scoped_poisonIJNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_13KyberMessage_EJEEEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableISA_EEEDaDpRKSA_ENKUlvE_clEv Unexecuted instantiation: _ZZN5Botan2CT13scoped_poisonIJNS_35Classic_McEliece_PrivateKeyInternalEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableIS3_EEEDaDpRKS3_ENKUlvE_clEv Unexecuted instantiation: _ZZN5Botan2CT13scoped_poisonIJNS_28Dilithium_PrivateKeyInternalEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableIS3_EEEDaDpRKS3_ENKUlvE_clEv Unexecuted instantiation: _ZZN5Botan2CT13scoped_poisonIJNS_10StrongSpanIKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_30DilithiumSerializedPrivateKey_EJEEEEEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableISD_EEEDaDpRKSD_ENKUlvE_clEv Unexecuted instantiation: _ZZN5Botan2CT13scoped_poisonIJNS_26HSS_LMS_PrivateKeyInternalEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableIS3_EEEDaDpRKS3_ENKUlvE_clEv |
218 | 2.45k | poison_all(xs...); |
219 | 2.45k | return scope; |
220 | 2.45k | } _ZN5Botan2CT13scoped_poisonIJNSt3__16vectorIhNS_16secure_allocatorIhEEEEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableIS7_EEEDaDpRKS7_ Line | Count | Source | 216 | 2.33k | [[nodiscard]] constexpr auto scoped_poison(const Ts&... xs) { | 217 | 2.33k | auto scope = scoped_cleanup([&] { unpoison_all(xs...); }); | 218 | 2.33k | poison_all(xs...); | 219 | 2.33k | return scope; | 220 | 2.33k | } |
Unexecuted instantiation: _ZN5Botan2CT13scoped_poisonIJNS_27FrodoKEM_PrivateKeyInternalEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableIS3_EEEDaDpRKS3_ Unexecuted instantiation: _ZN5Botan2CT13scoped_poisonIJNS_24Kyber_PrivateKeyInternalEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableIS3_EEEDaDpRKS3_ _ZN5Botan2CT13scoped_poisonIJNSt3__14spanIKhLm18446744073709551615EEEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableIS6_EEEDaDpRKS6_ Line | Count | Source | 216 | 116 | [[nodiscard]] constexpr auto scoped_poison(const Ts&... xs) { | 217 | 116 | auto scope = scoped_cleanup([&] { unpoison_all(xs...); }); | 218 | 116 | poison_all(xs...); | 219 | 116 | return scope; | 220 | 116 | } |
Unexecuted instantiation: _ZN5Botan2CT13scoped_poisonIJNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_13KyberMessage_EJEEEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableISA_EEEDaDpRKSA_ Unexecuted instantiation: _ZN5Botan2CT13scoped_poisonIJNS_35Classic_McEliece_PrivateKeyInternalEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableIS3_EEEDaDpRKS3_ Unexecuted instantiation: _ZN5Botan2CT13scoped_poisonIJNS_28Dilithium_PrivateKeyInternalEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableIS3_EEEDaDpRKS3_ Unexecuted instantiation: _ZN5Botan2CT13scoped_poisonIJNS_10StrongSpanIKNS_6StrongINSt3__16vectorIhNS_16secure_allocatorIhEEEENS_30DilithiumSerializedPrivateKey_EJEEEEEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableISD_EEEDaDpRKSD_ Unexecuted instantiation: _ZN5Botan2CT13scoped_poisonIJNS_26HSS_LMS_PrivateKeyInternalEEQaaaagtsZT_Li0Efraa10poisonableIT_Efraa12unpoisonableIS3_EEEDaDpRKS3_ |
221 | | |
222 | | /** |
223 | | * Poisons an r-value @p v and forwards it as the return value. |
224 | | */ |
225 | | template <poisonable T> |
226 | | [[nodiscard]] decltype(auto) driveby_poison(T&& v) |
227 | | requires(std::is_rvalue_reference_v<decltype(v)>) |
228 | | { |
229 | | poison(v); |
230 | | return std::forward<T>(v); |
231 | | } |
232 | | |
233 | | /** |
234 | | * Unpoisons an r-value @p v and forwards it as the return value. |
235 | | */ |
236 | | template <unpoisonable T> |
237 | | [[nodiscard]] decltype(auto) driveby_unpoison(T&& v) |
238 | | requires(std::is_rvalue_reference_v<decltype(v)>) |
239 | 0 | { |
240 | 0 | unpoison(v); |
241 | 0 | return std::forward<T>(v); |
242 | 0 | } Unexecuted instantiation: _ZN5Botan2CT16driveby_unpoisonITkNS0_12unpoisonableEbEEDcOT_Qsr3stdE21is_rvalue_reference_vIDtfp_EE Unexecuted instantiation: _ZN5Botan2CT16driveby_unpoisonITkNS0_12unpoisonableENS_6StrongINSt3__16vectorIhNS3_9allocatorIhEEEENS_24DilithiumCommitmentHash_EJEEEEEDcOT_Qsr3stdE21is_rvalue_reference_vIDtfp_EE Unexecuted instantiation: _ZN5Botan2CT16driveby_unpoisonITkNS0_12unpoisonableEmEEDcOT_Qsr3stdE21is_rvalue_reference_vIDtfp_EE Unexecuted instantiation: _ZN5Botan2CT16driveby_unpoisonITkNS0_12unpoisonableENSt3__16vectorIhNS_16secure_allocatorIhEEEEEEDcOT_Qsr3stdE21is_rvalue_reference_vIDtfp_EE Unexecuted instantiation: _ZN5Botan2CT16driveby_unpoisonITkNS0_12unpoisonableENSt3__16vectorIhNS2_9allocatorIhEEEEEEDcOT_Qsr3stdE21is_rvalue_reference_vIDtfp_EE |
243 | | |
244 | | /// @} |
245 | | |
246 | | /** |
247 | | * This function returns its argument, but (if called in a non-constexpr context) |
248 | | * attempts to prevent the compiler from reasoning about the value or the possible |
249 | | * range of values. Such optimizations have a way of breaking constant time code. |
250 | | * |
251 | | * The method that is use is decided at configuration time based on the target |
252 | | * compiler and architecture (see `ct_value_barrier` blocks in `src/build-data/cc`). |
253 | | * The decision can be overridden by the user with the configure.py option |
254 | | * `--ct-value-barrier-type=` |
255 | | * |
256 | | * There are three options currently possible in the data files and with the |
257 | | * option: |
258 | | * |
259 | | * * `asm`: Use an inline assembly expression which (currently) prevents Clang |
260 | | * and GCC from optimizing based on the possible value of the input expression. |
261 | | * |
262 | | * * `volatile`: Launder the input through a volatile variable. This is likely |
263 | | * to cause significant performance regressions since the value must be |
264 | | * actually stored and loaded back from memory each time. |
265 | | * |
266 | | * * `none`: disable constant time barriers entirely. This is used |
267 | | * with MSVC, which is not known to perform optimizations that break |
268 | | * constant time code and which does not support GCC-style inline asm. |
269 | | * |
270 | | */ |
271 | | template <typename T> |
272 | | constexpr inline T value_barrier(T x) |
273 | | requires std::unsigned_integral<T> && (!std::same_as<bool, T>) |
274 | 32.9G | { |
275 | 32.9G | if(std::is_constant_evaluated()) { |
276 | 0 | return x; |
277 | 32.9G | } else { |
278 | 32.9G | #if defined(BOTAN_CT_VALUE_BARRIER_USE_ASM) |
279 | | /* |
280 | | * We may want a "stronger" statement such as |
281 | | * asm volatile("" : "+r,m"(x) : : "memory); |
282 | | * (see https://theunixzoo.co.uk/blog/2021-10-14-preventing-optimisations.html) |
283 | | * however the current approach seems sufficient with current compilers, |
284 | | * and is minimally damaging with regards to degrading code generation. |
285 | | */ |
286 | 32.9G | asm("" : "+r"(x) : /* no input */); |
287 | 32.9G | return x; |
288 | | #elif defined(BOTAN_CT_VALUE_BARRIER_USE_VOLATILE) |
289 | | volatile T vx = x; |
290 | | return vx; |
291 | | #else |
292 | | return x; |
293 | | #endif |
294 | 32.9G | } |
295 | 32.9G | } _ZN5Botan2CT13value_barrierImEET_S2_Qaasr3stdE17unsigned_integralIS2_Entsr3stdE7same_asIbS2_E Line | Count | Source | 274 | 32.7G | { | 275 | 32.7G | if(std::is_constant_evaluated()) { | 276 | 0 | return x; | 277 | 32.7G | } else { | 278 | 32.7G | #if defined(BOTAN_CT_VALUE_BARRIER_USE_ASM) | 279 | | /* | 280 | | * We may want a "stronger" statement such as | 281 | | * asm volatile("" : "+r,m"(x) : : "memory); | 282 | | * (see https://theunixzoo.co.uk/blog/2021-10-14-preventing-optimisations.html) | 283 | | * however the current approach seems sufficient with current compilers, | 284 | | * and is minimally damaging with regards to degrading code generation. | 285 | | */ | 286 | 32.7G | asm("" : "+r"(x) : /* no input */); | 287 | 32.7G | return x; | 288 | | #elif defined(BOTAN_CT_VALUE_BARRIER_USE_VOLATILE) | 289 | | volatile T vx = x; | 290 | | return vx; | 291 | | #else | 292 | | return x; | 293 | | #endif | 294 | 32.7G | } | 295 | 32.7G | } |
_ZN5Botan2CT13value_barrierIjEET_S2_Qaasr3stdE17unsigned_integralIS2_Entsr3stdE7same_asIbS2_E Line | Count | Source | 274 | 119M | { | 275 | 119M | if(std::is_constant_evaluated()) { | 276 | 0 | return x; | 277 | 119M | } else { | 278 | 119M | #if defined(BOTAN_CT_VALUE_BARRIER_USE_ASM) | 279 | | /* | 280 | | * We may want a "stronger" statement such as | 281 | | * asm volatile("" : "+r,m"(x) : : "memory); | 282 | | * (see https://theunixzoo.co.uk/blog/2021-10-14-preventing-optimisations.html) | 283 | | * however the current approach seems sufficient with current compilers, | 284 | | * and is minimally damaging with regards to degrading code generation. | 285 | | */ | 286 | 119M | asm("" : "+r"(x) : /* no input */); | 287 | 119M | return x; | 288 | | #elif defined(BOTAN_CT_VALUE_BARRIER_USE_VOLATILE) | 289 | | volatile T vx = x; | 290 | | return vx; | 291 | | #else | 292 | | return x; | 293 | | #endif | 294 | 119M | } | 295 | 119M | } |
_ZN5Botan2CT13value_barrierIhEET_S2_Qaasr3stdE17unsigned_integralIS2_Entsr3stdE7same_asIbS2_E Line | Count | Source | 274 | 68.5M | { | 275 | 68.5M | if(std::is_constant_evaluated()) { | 276 | 0 | return x; | 277 | 68.5M | } else { | 278 | 68.5M | #if defined(BOTAN_CT_VALUE_BARRIER_USE_ASM) | 279 | | /* | 280 | | * We may want a "stronger" statement such as | 281 | | * asm volatile("" : "+r,m"(x) : : "memory); | 282 | | * (see https://theunixzoo.co.uk/blog/2021-10-14-preventing-optimisations.html) | 283 | | * however the current approach seems sufficient with current compilers, | 284 | | * and is minimally damaging with regards to degrading code generation. | 285 | | */ | 286 | 68.5M | asm("" : "+r"(x) : /* no input */); | 287 | 68.5M | return x; | 288 | | #elif defined(BOTAN_CT_VALUE_BARRIER_USE_VOLATILE) | 289 | | volatile T vx = x; | 290 | | return vx; | 291 | | #else | 292 | | return x; | 293 | | #endif | 294 | 68.5M | } | 295 | 68.5M | } |
_ZN5Botan2CT13value_barrierItEET_S2_Qaasr3stdE17unsigned_integralIS2_Entsr3stdE7same_asIbS2_E Line | Count | Source | 274 | 214k | { | 275 | 214k | if(std::is_constant_evaluated()) { | 276 | 0 | return x; | 277 | 214k | } else { | 278 | 214k | #if defined(BOTAN_CT_VALUE_BARRIER_USE_ASM) | 279 | | /* | 280 | | * We may want a "stronger" statement such as | 281 | | * asm volatile("" : "+r,m"(x) : : "memory); | 282 | | * (see https://theunixzoo.co.uk/blog/2021-10-14-preventing-optimisations.html) | 283 | | * however the current approach seems sufficient with current compilers, | 284 | | * and is minimally damaging with regards to degrading code generation. | 285 | | */ | 286 | 214k | asm("" : "+r"(x) : /* no input */); | 287 | 214k | return x; | 288 | | #elif defined(BOTAN_CT_VALUE_BARRIER_USE_VOLATILE) | 289 | | volatile T vx = x; | 290 | | return vx; | 291 | | #else | 292 | | return x; | 293 | | #endif | 294 | 214k | } | 295 | 214k | } |
|
296 | | |
297 | | /** |
298 | | * A Choice is used for constant-time conditionals. |
299 | | * |
300 | | * Internally it always is either |0| (all 0 bits) or |1| (all 1 bits) |
301 | | * and measures are taken to block compilers from reasoning about the |
302 | | * expected value of a Choice. |
303 | | */ |
304 | | class Choice final { |
305 | | public: |
306 | | /** |
307 | | * If v == 0 return an unset (false) Choice, otherwise a set Choice |
308 | | */ |
309 | | template <typename T> |
310 | | requires std::unsigned_integral<T> && (!std::same_as<bool, T>) |
311 | 106M | constexpr static Choice from_int(T v) { |
312 | | // Mask of T that is either |0| or |1| |
313 | 106M | const T v_is_0 = ct_is_zero<T>(value_barrier<T>(v)); |
314 | | |
315 | | // We want the mask to be set if v != 0 so we must check that |
316 | | // v_is_0 is itself zero. |
317 | | // |
318 | | // Also sizeof(T) may not equal sizeof(uint32_t) so we must |
319 | | // use ct_is_zero<uint32_t>. It's ok to either truncate or |
320 | | // zero extend v_is_0 to 32 bits since we know it is |0| or |1| |
321 | | // so even just the low bit is sufficient. |
322 | 106M | return Choice(ct_is_zero<uint32_t>(static_cast<uint32_t>(v_is_0))); |
323 | 106M | } _ZN5Botan2CT6Choice8from_intImQaasr3stdE17unsigned_integralIT_Entsr3stdE7same_asIbS3_EEES1_S3_ Line | Count | Source | 311 | 106M | constexpr static Choice from_int(T v) { | 312 | | // Mask of T that is either |0| or |1| | 313 | 106M | const T v_is_0 = ct_is_zero<T>(value_barrier<T>(v)); | 314 | | | 315 | | // We want the mask to be set if v != 0 so we must check that | 316 | | // v_is_0 is itself zero. | 317 | | // | 318 | | // Also sizeof(T) may not equal sizeof(uint32_t) so we must | 319 | | // use ct_is_zero<uint32_t>. It's ok to either truncate or | 320 | | // zero extend v_is_0 to 32 bits since we know it is |0| or |1| | 321 | | // so even just the low bit is sufficient. | 322 | 106M | return Choice(ct_is_zero<uint32_t>(static_cast<uint32_t>(v_is_0))); | 323 | 106M | } |
_ZN5Botan2CT6Choice8from_intIhQaasr3stdE17unsigned_integralIT_Entsr3stdE7same_asIbS3_EEES1_S3_ Line | Count | Source | 311 | 552 | constexpr static Choice from_int(T v) { | 312 | | // Mask of T that is either |0| or |1| | 313 | 552 | const T v_is_0 = ct_is_zero<T>(value_barrier<T>(v)); | 314 | | | 315 | | // We want the mask to be set if v != 0 so we must check that | 316 | | // v_is_0 is itself zero. | 317 | | // | 318 | | // Also sizeof(T) may not equal sizeof(uint32_t) so we must | 319 | | // use ct_is_zero<uint32_t>. It's ok to either truncate or | 320 | | // zero extend v_is_0 to 32 bits since we know it is |0| or |1| | 321 | | // so even just the low bit is sufficient. | 322 | 552 | return Choice(ct_is_zero<uint32_t>(static_cast<uint32_t>(v_is_0))); | 323 | 552 | } |
Unexecuted instantiation: _ZN5Botan2CT6Choice8from_intIjQaasr3stdE17unsigned_integralIT_Entsr3stdE7same_asIbS3_EEES1_S3_ |
324 | | |
325 | 6 | constexpr static Choice yes() { return Choice(static_cast<uint32_t>(-1)); } |
326 | | |
327 | 135 | constexpr static Choice no() { return Choice(0); } |
328 | | |
329 | 2.45M | constexpr Choice operator!() const { return Choice(~value()); } |
330 | | |
331 | 12.9M | constexpr Choice operator&&(const Choice& other) const { return Choice(value() & other.value()); } |
332 | | |
333 | 0 | constexpr Choice operator||(const Choice& other) const { return Choice(value() | other.value()); } |
334 | | |
335 | 236 | constexpr Choice operator!=(const Choice& other) const { return Choice(value() ^ other.value()); } |
336 | | |
337 | 81 | constexpr Choice operator==(const Choice& other) const { return !(*this != other); } |
338 | | |
339 | | /** |
340 | | * Unsafe conversion to bool |
341 | | * |
342 | | * This conversion itself is (probably) constant time, but once the |
343 | | * choice is reduced to a simple bool, it's entirely possible for the |
344 | | * compiler to perform range analysis on the values, since there are just |
345 | | * the two. As a consequence even if the caller is not using this in an |
346 | | * obviously branchy way (`if(choice.as_bool()) ...`) a smart compiler |
347 | | * may introduce branches depending on the value. |
348 | | */ |
349 | 10.0M | constexpr bool as_bool() const { return m_value != 0; } |
350 | | |
351 | | /// Return the masked value |
352 | 119M | constexpr uint32_t value() const { return value_barrier(m_value); } |
353 | | |
354 | | constexpr Choice(const Choice& other) = default; |
355 | | constexpr Choice(Choice&& other) = default; |
356 | | constexpr Choice& operator=(const Choice& other) noexcept = default; |
357 | | constexpr Choice& operator=(Choice&& other) noexcept = default; |
358 | | |
359 | | private: |
360 | 122M | constexpr explicit Choice(uint32_t v) : m_value(v) {} |
361 | | |
362 | | uint32_t m_value; |
363 | | }; |
364 | | |
365 | | /** |
366 | | * A concept for a type which is conditionally assignable |
367 | | */ |
368 | | template <typename T> |
369 | | concept ct_conditional_assignable = requires(T lhs, const T& rhs, Choice c) { lhs.conditional_assign(c, rhs); }; |
370 | | |
371 | | /** |
372 | | * A Mask type used for constant-time operations. A Mask<T> always has value |
373 | | * either |0| (all bits cleared) or |1| (all bits set). All operations in a Mask<T> |
374 | | * are intended to compile to code which does not contain conditional jumps. |
375 | | * This must be verified with tooling (eg binary disassembly or using valgrind) |
376 | | * since you never know what a compiler might do. |
377 | | */ |
378 | | template <typename T> |
379 | | class Mask final { |
380 | | public: |
381 | | static_assert(std::is_unsigned<T>::value && !std::is_same<bool, T>::value, |
382 | | "Only unsigned integer types are supported by CT::Mask"); |
383 | | |
384 | | Mask(const Mask<T>& other) = default; |
385 | | Mask<T>& operator=(const Mask<T>& other) = default; |
386 | | |
387 | | /** |
388 | | * Derive a Mask from a Mask of a larger type |
389 | | */ |
390 | | template <typename U> |
391 | 5.51k | constexpr Mask(Mask<U> o) : m_mask(static_cast<T>(o.value())) { |
392 | 5.51k | static_assert(sizeof(U) > sizeof(T), "sizes ok"); |
393 | 5.51k | } Unexecuted instantiation: Botan::CT::Mask<unsigned short>::Mask<unsigned int>(Botan::CT::Mask<unsigned int>) Botan::CT::Mask<unsigned char>::Mask<unsigned long>(Botan::CT::Mask<unsigned long>) Line | Count | Source | 391 | 5.51k | constexpr Mask(Mask<U> o) : m_mask(static_cast<T>(o.value())) { | 392 | 5.51k | static_assert(sizeof(U) > sizeof(T), "sizes ok"); | 393 | 5.51k | } |
Unexecuted instantiation: Botan::CT::Mask<unsigned char>::Mask<unsigned short>(Botan::CT::Mask<unsigned short>) Unexecuted instantiation: Botan::CT::Mask<unsigned int>::Mask<unsigned long>(Botan::CT::Mask<unsigned long>) Unexecuted instantiation: Botan::CT::Mask<unsigned short>::Mask<unsigned long>(Botan::CT::Mask<unsigned long>) |
394 | | |
395 | | /** |
396 | | * Return a Mask<T> of |1| (all bits set) |
397 | | */ |
398 | 230k | static constexpr Mask<T> set() { return Mask<T>(static_cast<T>(~0)); } Botan::CT::Mask<unsigned long>::set() Line | Count | Source | 398 | 81.5k | static constexpr Mask<T> set() { return Mask<T>(static_cast<T>(~0)); } |
Botan::CT::Mask<unsigned char>::set() Line | Count | Source | 398 | 148k | static constexpr Mask<T> set() { return Mask<T>(static_cast<T>(~0)); } |
Unexecuted instantiation: Botan::CT::Mask<unsigned short>::set() Unexecuted instantiation: Botan::CT::Mask<unsigned int>::set() |
399 | | |
400 | | /** |
401 | | * Return a Mask<T> of |0| (all bits cleared) |
402 | | */ |
403 | 1.30M | static constexpr Mask<T> cleared() { return Mask<T>(0); } Botan::CT::Mask<unsigned long>::cleared() Line | Count | Source | 403 | 1.29M | static constexpr Mask<T> cleared() { return Mask<T>(0); } |
Botan::CT::Mask<unsigned char>::cleared() Line | Count | Source | 403 | 669 | static constexpr Mask<T> cleared() { return Mask<T>(0); } |
Unexecuted instantiation: Botan::CT::Mask<unsigned int>::cleared() |
404 | | |
405 | | /** |
406 | | * Return a Mask<T> which is set if v is != 0 |
407 | | */ |
408 | 968M | static constexpr Mask<T> expand(T v) { return ~Mask<T>::is_zero(value_barrier<T>(v)); } Botan::CT::Mask<unsigned long>::expand(unsigned long) Line | Count | Source | 408 | 952M | static constexpr Mask<T> expand(T v) { return ~Mask<T>::is_zero(value_barrier<T>(v)); } |
Botan::CT::Mask<unsigned char>::expand(unsigned char) Line | Count | Source | 408 | 16.0M | static constexpr Mask<T> expand(T v) { return ~Mask<T>::is_zero(value_barrier<T>(v)); } |
Botan::CT::Mask<unsigned short>::expand(unsigned short) Line | Count | Source | 408 | 47 | static constexpr Mask<T> expand(T v) { return ~Mask<T>::is_zero(value_barrier<T>(v)); } |
|
409 | | |
410 | | /** |
411 | | * Return a Mask<T> which is set if choice is set |
412 | | */ |
413 | 90.8M | static constexpr Mask<T> from_choice(Choice c) { |
414 | 90.8M | if constexpr(sizeof(T) <= sizeof(uint32_t)) { |
415 | | // Take advantage of the fact that Choice's mask is always |
416 | | // either |0| or |1| |
417 | 0 | return Mask<T>(static_cast<T>(c.value())); |
418 | 90.8M | } else { |
419 | 90.8M | return ~Mask<T>::is_zero(c.value()); |
420 | 90.8M | } |
421 | 90.8M | } Botan::CT::Mask<unsigned long>::from_choice(Botan::CT::Choice) Line | Count | Source | 413 | 90.8M | static constexpr Mask<T> from_choice(Choice c) { | 414 | | if constexpr(sizeof(T) <= sizeof(uint32_t)) { | 415 | | // Take advantage of the fact that Choice's mask is always | 416 | | // either |0| or |1| | 417 | | return Mask<T>(static_cast<T>(c.value())); | 418 | 90.8M | } else { | 419 | 90.8M | return ~Mask<T>::is_zero(c.value()); | 420 | 90.8M | } | 421 | 90.8M | } |
Unexecuted instantiation: Botan::CT::Mask<unsigned char>::from_choice(Botan::CT::Choice) Unexecuted instantiation: Botan::CT::Mask<unsigned int>::from_choice(Botan::CT::Choice) Unexecuted instantiation: Botan::CT::Mask<unsigned short>::from_choice(Botan::CT::Choice) |
422 | | |
423 | | /** |
424 | | * Return a Mask<T> which is set if the top bit of v is set |
425 | | */ |
426 | 381M | static constexpr Mask<T> expand_top_bit(T v) { return Mask<T>(Botan::expand_top_bit<T>(value_barrier<T>(v))); } Botan::CT::Mask<unsigned long>::expand_top_bit(unsigned long) Line | Count | Source | 426 | 381M | static constexpr Mask<T> expand_top_bit(T v) { return Mask<T>(Botan::expand_top_bit<T>(value_barrier<T>(v))); } |
Botan::CT::Mask<unsigned char>::expand_top_bit(unsigned char) Line | Count | Source | 426 | 138 | static constexpr Mask<T> expand_top_bit(T v) { return Mask<T>(Botan::expand_top_bit<T>(value_barrier<T>(v))); } |
Botan::CT::Mask<unsigned short>::expand_top_bit(unsigned short) Line | Count | Source | 426 | 24.0k | static constexpr Mask<T> expand_top_bit(T v) { return Mask<T>(Botan::expand_top_bit<T>(value_barrier<T>(v))); } |
Unexecuted instantiation: Botan::CT::Mask<unsigned int>::expand_top_bit(unsigned int) |
427 | | |
428 | | /** |
429 | | * Return a Mask<T> which is set if the given @p bit of @p v is set. |
430 | | * @p bit must be from 0 (LSB) to (sizeof(T) * 8 - 1) (MSB). |
431 | | */ |
432 | 134k | static constexpr Mask<T> expand_bit(T v, size_t bit) { |
433 | 134k | return CT::Mask<T>::expand_top_bit(v << (sizeof(v) * 8 - 1 - bit)); |
434 | 134k | } Unexecuted instantiation: Botan::CT::Mask<unsigned short>::expand_bit(unsigned short, unsigned long) Botan::CT::Mask<unsigned long>::expand_bit(unsigned long, unsigned long) Line | Count | Source | 432 | 134k | static constexpr Mask<T> expand_bit(T v, size_t bit) { | 433 | 134k | return CT::Mask<T>::expand_top_bit(v << (sizeof(v) * 8 - 1 - bit)); | 434 | 134k | } |
|
435 | | |
436 | | /** |
437 | | * Return a Mask<T> which is set if m is set |
438 | | */ |
439 | | template <typename U> |
440 | 222 | static constexpr Mask<T> expand(Mask<U> m) { |
441 | 222 | static_assert(sizeof(U) < sizeof(T), "sizes ok"); |
442 | 222 | return ~Mask<T>::is_zero(m.value()); |
443 | 222 | } Botan::CT::Mask<unsigned long> Botan::CT::Mask<unsigned long>::expand<unsigned char>(Botan::CT::Mask<unsigned char>) Line | Count | Source | 440 | 175 | static constexpr Mask<T> expand(Mask<U> m) { | 441 | 175 | static_assert(sizeof(U) < sizeof(T), "sizes ok"); | 442 | 175 | return ~Mask<T>::is_zero(m.value()); | 443 | 175 | } |
Unexecuted instantiation: Botan::CT::Mask<unsigned long> Botan::CT::Mask<unsigned long>::expand<unsigned short>(Botan::CT::Mask<unsigned short>) Botan::CT::Mask<unsigned short> Botan::CT::Mask<unsigned short>::expand<unsigned char>(Botan::CT::Mask<unsigned char>) Line | Count | Source | 440 | 47 | static constexpr Mask<T> expand(Mask<U> m) { | 441 | 47 | static_assert(sizeof(U) < sizeof(T), "sizes ok"); | 442 | 47 | return ~Mask<T>::is_zero(m.value()); | 443 | 47 | } |
|
444 | | |
445 | | /** |
446 | | * Return a Mask<T> which is set if v is == 0 or cleared otherwise |
447 | | */ |
448 | 2.04G | static constexpr Mask<T> is_zero(T x) { return Mask<T>(ct_is_zero<T>(value_barrier<T>(x))); } Botan::CT::Mask<unsigned long>::is_zero(unsigned long) Line | Count | Source | 448 | 2.02G | static constexpr Mask<T> is_zero(T x) { return Mask<T>(ct_is_zero<T>(value_barrier<T>(x))); } |
Botan::CT::Mask<unsigned char>::is_zero(unsigned char) Line | Count | Source | 448 | 16.8M | static constexpr Mask<T> is_zero(T x) { return Mask<T>(ct_is_zero<T>(value_barrier<T>(x))); } |
Unexecuted instantiation: Botan::CT::Mask<unsigned int>::is_zero(unsigned int) Botan::CT::Mask<unsigned short>::is_zero(unsigned short) Line | Count | Source | 448 | 23.8k | static constexpr Mask<T> is_zero(T x) { return Mask<T>(ct_is_zero<T>(value_barrier<T>(x))); } |
|
449 | | |
450 | | /** |
451 | | * Return a Mask<T> which is set if x == y |
452 | | */ |
453 | 901M | static constexpr Mask<T> is_equal(T x, T y) { |
454 | 901M | const T diff = value_barrier(x) ^ value_barrier(y); |
455 | 901M | return Mask<T>::is_zero(diff); |
456 | 901M | } Botan::CT::Mask<unsigned long>::is_equal(unsigned long, unsigned long) Line | Count | Source | 453 | 900M | static constexpr Mask<T> is_equal(T x, T y) { | 454 | 900M | const T diff = value_barrier(x) ^ value_barrier(y); | 455 | 900M | return Mask<T>::is_zero(diff); | 456 | 900M | } |
Botan::CT::Mask<unsigned char>::is_equal(unsigned char, unsigned char) Line | Count | Source | 453 | 309k | static constexpr Mask<T> is_equal(T x, T y) { | 454 | 309k | const T diff = value_barrier(x) ^ value_barrier(y); | 455 | 309k | return Mask<T>::is_zero(diff); | 456 | 309k | } |
Botan::CT::Mask<unsigned short>::is_equal(unsigned short, unsigned short) Line | Count | Source | 453 | 23.7k | static constexpr Mask<T> is_equal(T x, T y) { | 454 | 23.7k | const T diff = value_barrier(x) ^ value_barrier(y); | 455 | 23.7k | return Mask<T>::is_zero(diff); | 456 | 23.7k | } |
Unexecuted instantiation: Botan::CT::Mask<unsigned int>::is_equal(unsigned int, unsigned int) |
457 | | |
458 | | /** |
459 | | * Return a Mask<T> which is set if x < y |
460 | | */ |
461 | 307M | static constexpr Mask<T> is_lt(T x, T y) { |
462 | 307M | T u = x ^ ((x ^ y) | ((x - y) ^ x)); |
463 | 307M | return Mask<T>::expand_top_bit(u); |
464 | 307M | } Botan::CT::Mask<unsigned long>::is_lt(unsigned long, unsigned long) Line | Count | Source | 461 | 306M | static constexpr Mask<T> is_lt(T x, T y) { | 462 | 306M | T u = x ^ ((x ^ y) | ((x - y) ^ x)); | 463 | 306M | return Mask<T>::expand_top_bit(u); | 464 | 306M | } |
Botan::CT::Mask<unsigned char>::is_lt(unsigned char, unsigned char) Line | Count | Source | 461 | 138 | static constexpr Mask<T> is_lt(T x, T y) { | 462 | 138 | T u = x ^ ((x ^ y) | ((x - y) ^ x)); | 463 | 138 | return Mask<T>::expand_top_bit(u); | 464 | 138 | } |
Botan::CT::Mask<unsigned short>::is_lt(unsigned short, unsigned short) Line | Count | Source | 461 | 24.0k | static constexpr Mask<T> is_lt(T x, T y) { | 462 | 24.0k | T u = x ^ ((x ^ y) | ((x - y) ^ x)); | 463 | 24.0k | return Mask<T>::expand_top_bit(u); | 464 | 24.0k | } |
Unexecuted instantiation: Botan::CT::Mask<unsigned int>::is_lt(unsigned int, unsigned int) |
465 | | |
466 | | /** |
467 | | * Return a Mask<T> which is set if x > y |
468 | | */ |
469 | 458k | static constexpr Mask<T> is_gt(T x, T y) { return Mask<T>::is_lt(y, x); } Botan::CT::Mask<unsigned long>::is_gt(unsigned long, unsigned long) Line | Count | Source | 469 | 434k | static constexpr Mask<T> is_gt(T x, T y) { return Mask<T>::is_lt(y, x); } |
Botan::CT::Mask<unsigned char>::is_gt(unsigned char, unsigned char) Line | Count | Source | 469 | 138 | static constexpr Mask<T> is_gt(T x, T y) { return Mask<T>::is_lt(y, x); } |
Botan::CT::Mask<unsigned short>::is_gt(unsigned short, unsigned short) Line | Count | Source | 469 | 23.7k | static constexpr Mask<T> is_gt(T x, T y) { return Mask<T>::is_lt(y, x); } |
Unexecuted instantiation: Botan::CT::Mask<unsigned int>::is_gt(unsigned int, unsigned int) |
470 | | |
471 | | /** |
472 | | * Return a Mask<T> which is set if x <= y |
473 | | */ |
474 | 453k | static constexpr Mask<T> is_lte(T x, T y) { return ~Mask<T>::is_gt(x, y); } Botan::CT::Mask<unsigned long>::is_lte(unsigned long, unsigned long) Line | Count | Source | 474 | 429k | static constexpr Mask<T> is_lte(T x, T y) { return ~Mask<T>::is_gt(x, y); } |
Botan::CT::Mask<unsigned short>::is_lte(unsigned short, unsigned short) Line | Count | Source | 474 | 23.7k | static constexpr Mask<T> is_lte(T x, T y) { return ~Mask<T>::is_gt(x, y); } |
Unexecuted instantiation: Botan::CT::Mask<unsigned int>::is_lte(unsigned int, unsigned int) |
475 | | |
476 | | /** |
477 | | * Return a Mask<T> which is set if x >= y |
478 | | */ |
479 | 74.5M | static constexpr Mask<T> is_gte(T x, T y) { return ~Mask<T>::is_lt(x, y); } |
480 | | |
481 | 0 | static constexpr Mask<T> is_within_range(T v, T l, T u) { |
482 | | //return Mask<T>::is_gte(v, l) & Mask<T>::is_lte(v, u); |
483 | |
|
484 | 0 | const T v_lt_l = v ^ ((v ^ l) | ((v - l) ^ v)); |
485 | 0 | const T v_gt_u = u ^ ((u ^ v) | ((u - v) ^ u)); |
486 | 0 | const T either = value_barrier(v_lt_l) | value_barrier(v_gt_u); |
487 | 0 | return ~Mask<T>::expand_top_bit(either); |
488 | 0 | } Unexecuted instantiation: Botan::CT::Mask<unsigned char>::is_within_range(unsigned char, unsigned char, unsigned char) Unexecuted instantiation: Botan::CT::Mask<unsigned short>::is_within_range(unsigned short, unsigned short, unsigned short) Unexecuted instantiation: Botan::CT::Mask<unsigned int>::is_within_range(unsigned int, unsigned int, unsigned int) |
489 | | |
490 | 0 | static constexpr Mask<T> is_any_of(T v, std::initializer_list<T> accepted) { |
491 | 0 | T accept = 0; |
492 | |
|
493 | 0 | for(auto a : accepted) { |
494 | 0 | const T diff = a ^ v; |
495 | 0 | const T eq_zero = value_barrier<T>(~diff & (diff - 1)); |
496 | 0 | accept |= eq_zero; |
497 | 0 | } |
498 | |
|
499 | 0 | return Mask<T>::expand_top_bit(accept); |
500 | 0 | } |
501 | | |
502 | | /** |
503 | | * AND-combine two masks |
504 | | */ |
505 | 1.53M | Mask<T>& operator&=(Mask<T> o) { |
506 | 1.53M | m_mask &= o.value(); |
507 | 1.53M | return (*this); |
508 | 1.53M | } Botan::CT::Mask<unsigned long>::operator&=(Botan::CT::Mask<unsigned long>) Line | Count | Source | 505 | 1.39M | Mask<T>& operator&=(Mask<T> o) { | 506 | 1.39M | m_mask &= o.value(); | 507 | 1.39M | return (*this); | 508 | 1.39M | } |
Botan::CT::Mask<unsigned char>::operator&=(Botan::CT::Mask<unsigned char>) Line | Count | Source | 505 | 139k | Mask<T>& operator&=(Mask<T> o) { | 506 | 139k | m_mask &= o.value(); | 507 | 139k | return (*this); | 508 | 139k | } |
Unexecuted instantiation: Botan::CT::Mask<unsigned short>::operator&=(Botan::CT::Mask<unsigned short>) Unexecuted instantiation: Botan::CT::Mask<unsigned int>::operator&=(Botan::CT::Mask<unsigned int>) |
509 | | |
510 | | /** |
511 | | * XOR-combine two masks |
512 | | */ |
513 | 1.04M | Mask<T>& operator^=(Mask<T> o) { |
514 | 1.04M | m_mask ^= o.value(); |
515 | 1.04M | return (*this); |
516 | 1.04M | } |
517 | | |
518 | | /** |
519 | | * OR-combine two masks |
520 | | */ |
521 | 39.6M | Mask<T>& operator|=(Mask<T> o) { |
522 | 39.6M | m_mask |= o.value(); |
523 | 39.6M | return (*this); |
524 | 39.6M | } Botan::CT::Mask<unsigned long>::operator|=(Botan::CT::Mask<unsigned long>) Line | Count | Source | 521 | 38.9M | Mask<T>& operator|=(Mask<T> o) { | 522 | 38.9M | m_mask |= o.value(); | 523 | 38.9M | return (*this); | 524 | 38.9M | } |
Botan::CT::Mask<unsigned char>::operator|=(Botan::CT::Mask<unsigned char>) Line | Count | Source | 521 | 668k | Mask<T>& operator|=(Mask<T> o) { | 522 | 668k | m_mask |= o.value(); | 523 | 668k | return (*this); | 524 | 668k | } |
Unexecuted instantiation: Botan::CT::Mask<unsigned int>::operator|=(Botan::CT::Mask<unsigned int>) Botan::CT::Mask<unsigned short>::operator|=(Botan::CT::Mask<unsigned short>) Line | Count | Source | 521 | 23.7k | Mask<T>& operator|=(Mask<T> o) { | 522 | 23.7k | m_mask |= o.value(); | 523 | 23.7k | return (*this); | 524 | 23.7k | } |
|
525 | | |
526 | | /** |
527 | | * AND-combine two masks |
528 | | */ |
529 | 1.85M | friend Mask<T> operator&(Mask<T> x, Mask<T> y) { return Mask<T>(x.value() & y.value()); } Botan::CT::operator&(Botan::CT::Mask<unsigned long>, Botan::CT::Mask<unsigned long>) Line | Count | Source | 529 | 1.37M | friend Mask<T> operator&(Mask<T> x, Mask<T> y) { return Mask<T>(x.value() & y.value()); } |
Botan::CT::operator&(Botan::CT::Mask<unsigned char>, Botan::CT::Mask<unsigned char>) Line | Count | Source | 529 | 448k | friend Mask<T> operator&(Mask<T> x, Mask<T> y) { return Mask<T>(x.value() & y.value()); } |
Unexecuted instantiation: Botan::CT::operator&(Botan::CT::Mask<unsigned int>, Botan::CT::Mask<unsigned int>) Botan::CT::operator&(Botan::CT::Mask<unsigned short>, Botan::CT::Mask<unsigned short>) Line | Count | Source | 529 | 23.8k | friend Mask<T> operator&(Mask<T> x, Mask<T> y) { return Mask<T>(x.value() & y.value()); } |
|
530 | | |
531 | | /** |
532 | | * XOR-combine two masks |
533 | | */ |
534 | 410k | friend Mask<T> operator^(Mask<T> x, Mask<T> y) { return Mask<T>(x.value() ^ y.value()); } |
535 | | |
536 | | /** |
537 | | * OR-combine two masks |
538 | | */ |
539 | 74.6M | friend Mask<T> operator|(Mask<T> x, Mask<T> y) { return Mask<T>(x.value() | y.value()); } Botan::CT::operator|(Botan::CT::Mask<unsigned long>, Botan::CT::Mask<unsigned long>) Line | Count | Source | 539 | 74.5M | friend Mask<T> operator|(Mask<T> x, Mask<T> y) { return Mask<T>(x.value() | y.value()); } |
Botan::CT::operator|(Botan::CT::Mask<unsigned char>, Botan::CT::Mask<unsigned char>) Line | Count | Source | 539 | 139k | friend Mask<T> operator|(Mask<T> x, Mask<T> y) { return Mask<T>(x.value() | y.value()); } |
|
540 | | |
541 | | /** |
542 | | * Negate this mask |
543 | | */ |
544 | 1.13G | constexpr Mask<T> operator~() const { return Mask<T>(~value()); } Botan::CT::Mask<unsigned long>::operator~() const Line | Count | Source | 544 | 1.11G | constexpr Mask<T> operator~() const { return Mask<T>(~value()); } |
Botan::CT::Mask<unsigned char>::operator~() const Line | Count | Source | 544 | 16.4M | constexpr Mask<T> operator~() const { return Mask<T>(~value()); } |
Botan::CT::Mask<unsigned short>::operator~() const Line | Count | Source | 544 | 47.6k | constexpr Mask<T> operator~() const { return Mask<T>(~value()); } |
Unexecuted instantiation: Botan::CT::Mask<unsigned int>::operator~() const |
545 | | |
546 | | /** |
547 | | * Return x if the mask is set, or otherwise zero |
548 | | */ |
549 | 2.26G | constexpr T if_set_return(T x) const { return value() & x; } Botan::CT::Mask<unsigned long>::if_set_return(unsigned long) const Line | Count | Source | 549 | 2.26G | constexpr T if_set_return(T x) const { return value() & x; } |
Botan::CT::Mask<unsigned char>::if_set_return(unsigned char) const Line | Count | Source | 549 | 139k | constexpr T if_set_return(T x) const { return value() & x; } |
Unexecuted instantiation: Botan::CT::Mask<unsigned int>::if_set_return(unsigned int) const Botan::CT::Mask<unsigned short>::if_set_return(unsigned short) const Line | Count | Source | 549 | 94 | constexpr T if_set_return(T x) const { return value() & x; } |
|
550 | | |
551 | | /** |
552 | | * Return x if the mask is cleared, or otherwise zero |
553 | | */ |
554 | 323M | constexpr T if_not_set_return(T x) const { return ~value() & x; } Botan::CT::Mask<unsigned long>::if_not_set_return(unsigned long) const Line | Count | Source | 554 | 322M | constexpr T if_not_set_return(T x) const { return ~value() & x; } |
Botan::CT::Mask<unsigned char>::if_not_set_return(unsigned char) const Line | Count | Source | 554 | 359k | constexpr T if_not_set_return(T x) const { return ~value() & x; } |
Unexecuted instantiation: Botan::CT::Mask<unsigned int>::if_not_set_return(unsigned int) const Botan::CT::Mask<unsigned short>::if_not_set_return(unsigned short) const Line | Count | Source | 554 | 239 | constexpr T if_not_set_return(T x) const { return ~value() & x; } |
|
555 | | |
556 | | /** |
557 | | * If this mask is set, return x, otherwise return y |
558 | | */ |
559 | 22.9G | constexpr T select(T x, T y) const { return choose(value(), x, y); } Botan::CT::Mask<unsigned long>::select(unsigned long, unsigned long) const Line | Count | Source | 559 | 22.8G | constexpr T select(T x, T y) const { return choose(value(), x, y); } |
Botan::CT::Mask<unsigned char>::select(unsigned char, unsigned char) const Line | Count | Source | 559 | 16.0M | constexpr T select(T x, T y) const { return choose(value(), x, y); } |
Unexecuted instantiation: Botan::CT::Mask<unsigned short>::select(unsigned short, unsigned short) const Unexecuted instantiation: Botan::CT::Mask<unsigned int>::select(unsigned int, unsigned int) const |
560 | | |
561 | 589 | constexpr T select_and_unpoison(T x, T y) const { |
562 | 589 | T r = this->select(x, y); |
563 | 589 | CT::unpoison(r); |
564 | 589 | return r; |
565 | 589 | } Botan::CT::Mask<unsigned long>::select_and_unpoison(unsigned long, unsigned long) const Line | Count | Source | 561 | 451 | constexpr T select_and_unpoison(T x, T y) const { | 562 | 451 | T r = this->select(x, y); | 563 | 451 | CT::unpoison(r); | 564 | 451 | return r; | 565 | 451 | } |
Botan::CT::Mask<unsigned char>::select_and_unpoison(unsigned char, unsigned char) const Line | Count | Source | 561 | 138 | constexpr T select_and_unpoison(T x, T y) const { | 562 | 138 | T r = this->select(x, y); | 563 | 138 | CT::unpoison(r); | 564 | 138 | return r; | 565 | 138 | } |
|
566 | | |
567 | | /** |
568 | | * If this mask is set, return x, otherwise return y |
569 | | */ |
570 | 70.7M | Mask<T> select_mask(Mask<T> x, Mask<T> y) const { return Mask<T>(select(x.value(), y.value())); } |
571 | | |
572 | | /** |
573 | | * Conditionally set output to x or y, depending on if mask is set or |
574 | | * cleared (resp) |
575 | | */ |
576 | 313M | constexpr void select_n(T output[], const T x[], const T y[], size_t len) const { |
577 | 313M | const T mask = value(); |
578 | 2.65G | for(size_t i = 0; i != len; ++i) { |
579 | 2.34G | output[i] = choose(mask, x[i], y[i]); |
580 | 2.34G | } |
581 | 313M | } Botan::CT::Mask<unsigned long>::select_n(unsigned long*, unsigned long const*, unsigned long const*, unsigned long) const Line | Count | Source | 576 | 313M | constexpr void select_n(T output[], const T x[], const T y[], size_t len) const { | 577 | 313M | const T mask = value(); | 578 | 2.65G | for(size_t i = 0; i != len; ++i) { | 579 | 2.34G | output[i] = choose(mask, x[i], y[i]); | 580 | 2.34G | } | 581 | 313M | } |
Unexecuted instantiation: Botan::CT::Mask<unsigned char>::select_n(unsigned char*, unsigned char const*, unsigned char const*, unsigned long) const |
582 | | |
583 | | /** |
584 | | * If this mask is set, zero out buf, otherwise do nothing |
585 | | */ |
586 | 43.0M | constexpr void if_set_zero_out(T buf[], size_t elems) { |
587 | 326M | for(size_t i = 0; i != elems; ++i) { |
588 | 283M | buf[i] = this->if_not_set_return(buf[i]); |
589 | 283M | } |
590 | 43.0M | } |
591 | | |
592 | | /** |
593 | | * If this mask is set, swap x and y |
594 | | */ |
595 | | template <typename U> |
596 | | void conditional_swap(U& x, U& y) const |
597 | | requires(sizeof(U) <= sizeof(T)) |
598 | 38.6M | { |
599 | 38.6M | auto cnd = Mask<U>(*this); |
600 | 38.6M | U t0 = cnd.select(y, x); |
601 | 38.6M | U t1 = cnd.select(x, y); |
602 | 38.6M | x = t0; |
603 | 38.6M | y = t1; |
604 | 38.6M | } _ZNK5Botan2CT4MaskImE16conditional_swapImEEvRT_S5_QlestTL0__stS4_ Line | Count | Source | 598 | 38.6M | { | 599 | 38.6M | auto cnd = Mask<U>(*this); | 600 | 38.6M | U t0 = cnd.select(y, x); | 601 | 38.6M | U t1 = cnd.select(x, y); | 602 | 38.6M | x = t0; | 603 | 38.6M | y = t1; | 604 | 38.6M | } |
Unexecuted instantiation: _ZNK5Botan2CT4MaskImE16conditional_swapIjEEvRT_S5_QlestTL0__stS4_ Unexecuted instantiation: _ZNK5Botan2CT4MaskItE16conditional_swapItEEvRT_S5_QlestTL0__stS4_ Unexecuted instantiation: _ZNK5Botan2CT4MaskImE16conditional_swapItEEvRT_S5_QlestTL0__stS4_ |
605 | | |
606 | | /** |
607 | | * Return the value of the mask, unpoisoned |
608 | | */ |
609 | 187M | constexpr T unpoisoned_value() const { |
610 | 187M | T r = value(); |
611 | 187M | CT::unpoison(r); |
612 | 187M | return r; |
613 | 187M | } Botan::CT::Mask<unsigned long>::unpoisoned_value() const Line | Count | Source | 609 | 186M | constexpr T unpoisoned_value() const { | 610 | 186M | T r = value(); | 611 | 186M | CT::unpoison(r); | 612 | 186M | return r; | 613 | 186M | } |
Botan::CT::Mask<unsigned char>::unpoisoned_value() const Line | Count | Source | 609 | 158k | constexpr T unpoisoned_value() const { | 610 | 158k | T r = value(); | 611 | 158k | CT::unpoison(r); | 612 | 158k | return r; | 613 | 158k | } |
Botan::CT::Mask<unsigned short>::unpoisoned_value() const Line | Count | Source | 609 | 47 | constexpr T unpoisoned_value() const { | 610 | 47 | T r = value(); | 611 | 47 | CT::unpoison(r); | 612 | 47 | return r; | 613 | 47 | } |
Unexecuted instantiation: Botan::CT::Mask<unsigned int>::unpoisoned_value() const |
614 | | |
615 | | /** |
616 | | * Unsafe conversion to bool |
617 | | * |
618 | | * This conversion itself is (probably) constant time, but once the |
619 | | * mask is reduced to a simple bool, it's entirely possible for the |
620 | | * compiler to perform range analysis on the values, since there are just |
621 | | * the two. As a consequence even if the caller is not using this in an |
622 | | * obviously branchy way (`if(mask.as_bool()) ...`) a smart compiler |
623 | | * may introduce branches depending on the value. |
624 | | */ |
625 | 80.2M | constexpr bool as_bool() const { return unpoisoned_value() != 0; } Botan::CT::Mask<unsigned long>::as_bool() const Line | Count | Source | 625 | 80.1M | constexpr bool as_bool() const { return unpoisoned_value() != 0; } |
Botan::CT::Mask<unsigned char>::as_bool() const Line | Count | Source | 625 | 157k | constexpr bool as_bool() const { return unpoisoned_value() != 0; } |
Botan::CT::Mask<unsigned short>::as_bool() const Line | Count | Source | 625 | 47 | constexpr bool as_bool() const { return unpoisoned_value() != 0; } |
Unexecuted instantiation: Botan::CT::Mask<unsigned int>::as_bool() const |
626 | | |
627 | | /** |
628 | | * Return a Choice based on this mask |
629 | | */ |
630 | 106M | constexpr CT::Choice as_choice() const { return CT::Choice::from_int(unpoisoned_value()); } Botan::CT::Mask<unsigned long>::as_choice() const Line | Count | Source | 630 | 106M | constexpr CT::Choice as_choice() const { return CT::Choice::from_int(unpoisoned_value()); } |
Botan::CT::Mask<unsigned char>::as_choice() const Line | Count | Source | 630 | 552 | constexpr CT::Choice as_choice() const { return CT::Choice::from_int(unpoisoned_value()); } |
Unexecuted instantiation: Botan::CT::Mask<unsigned int>::as_choice() const |
631 | | |
632 | | /** |
633 | | * Return the underlying value of the mask |
634 | | */ |
635 | 27.5G | constexpr T value() const { return value_barrier<T>(m_mask); } Botan::CT::Mask<unsigned long>::value() const Line | Count | Source | 635 | 27.5G | constexpr T value() const { return value_barrier<T>(m_mask); } |
Botan::CT::Mask<unsigned char>::value() const Line | Count | Source | 635 | 35.1M | constexpr T value() const { return value_barrier<T>(m_mask); } |
Unexecuted instantiation: Botan::CT::Mask<unsigned int>::value() const Botan::CT::Mask<unsigned short>::value() const Line | Count | Source | 635 | 119k | constexpr T value() const { return value_barrier<T>(m_mask); } |
|
636 | | |
637 | | constexpr void _const_time_poison() const { CT::poison(m_mask); } |
638 | | |
639 | 47 | constexpr void _const_time_unpoison() const { CT::unpoison(m_mask); } Unexecuted instantiation: Botan::CT::Mask<unsigned char>::_const_time_unpoison() const Botan::CT::Mask<unsigned short>::_const_time_unpoison() const Line | Count | Source | 639 | 47 | constexpr void _const_time_unpoison() const { CT::unpoison(m_mask); } |
|
640 | | |
641 | | private: |
642 | 3.70G | constexpr Mask(T m) : m_mask(m) {} Botan::CT::Mask<unsigned long>::Mask(unsigned long) Line | Count | Source | 642 | 3.67G | constexpr Mask(T m) : m_mask(m) {} |
Botan::CT::Mask<unsigned char>::Mask(unsigned char) Line | Count | Source | 642 | 34.0M | constexpr Mask(T m) : m_mask(m) {} |
Unexecuted instantiation: Botan::CT::Mask<unsigned int>::Mask(unsigned int) Botan::CT::Mask<unsigned short>::Mask(unsigned short) Line | Count | Source | 642 | 119k | constexpr Mask(T m) : m_mask(m) {} |
|
643 | | |
644 | | T m_mask; |
645 | | }; |
646 | | |
647 | | /** |
648 | | * A CT::Option<T> is either a valid T, or not |
649 | | * |
650 | | * To maintain constant time behavior a value must always be stored. |
651 | | * A CT::Choice tracks if the value is valid or not. It is not possible |
652 | | * to access the inner value if the Choice is unset. |
653 | | */ |
654 | | template <typename T> |
655 | | class Option final { |
656 | | public: |
657 | | /// Construct an Option which contains the specified value, and is set or not |
658 | 344 | constexpr Option(T v, Choice valid) : m_has_value(valid), m_value(std::move(v)) {} |
659 | | |
660 | | /// Construct a set option with the provided value |
661 | 6 | constexpr Option(T v) : Option(std::move(v), Choice::yes()) {} |
662 | | |
663 | | /// Construct an unset option with a default inner value |
664 | | constexpr Option() |
665 | | requires std::default_initializable<T> |
666 | 135 | : Option(T(), Choice::no()) {} |
667 | | |
668 | | /// Return true if this Option contains a value |
669 | 522 | constexpr Choice has_value() const { return m_has_value; } |
670 | | |
671 | | /** |
672 | | * Apply a function to the inner value and return a new Option |
673 | | * which contains that value. This is constant time only if @p f is. |
674 | | * |
675 | | * @note The function will always be called, even if the Option is None. It |
676 | | * must be prepared to handle any possible state of T. |
677 | | */ |
678 | | template <std::invocable<const T&> F> |
679 | | constexpr auto transform(F f) const -> Option<std::remove_cvref_t<std::invoke_result_t<F, const T&>>> { |
680 | | return {f(m_value), m_has_value}; |
681 | | } |
682 | | |
683 | | /// Either returns the value or throws an exception |
684 | 12 | constexpr const T& value() const { |
685 | 12 | BOTAN_STATE_CHECK(m_has_value.as_bool()); |
686 | 12 | return m_value; |
687 | 12 | } |
688 | | |
689 | | /// Returns either the inner value or the alternative, in constant time |
690 | | /// |
691 | | /// This variant is used for types which explicitly define a function |
692 | | /// conditional_assign which takes a CT::Choice as the conditional. |
693 | | constexpr T value_or(T other) const |
694 | | requires ct_conditional_assignable<T> |
695 | | { |
696 | | other.conditional_assign(m_has_value, m_value); |
697 | | return other; |
698 | | } |
699 | | |
700 | | /// Returns either the inner value or the alternative, in constant time |
701 | | /// |
702 | | /// This variant is used for integer types where CT::Mask can perform |
703 | | /// a constant time selection |
704 | | constexpr T value_or(T other) const |
705 | | requires std::unsigned_integral<T> |
706 | 154 | { |
707 | 154 | auto mask = CT::Mask<T>::from_choice(m_has_value); |
708 | 154 | return mask.select(m_value, other); |
709 | 154 | } |
710 | | |
711 | | /// Convert this Option into a std::optional |
712 | | /// |
713 | | /// This is not constant time, leaking if the Option had a |
714 | | /// value or not |
715 | | constexpr std::optional<T> as_optional_vartime() const { |
716 | | if(m_has_value.as_bool()) { |
717 | | return {m_value}; |
718 | | } else { |
719 | | return {}; |
720 | | } |
721 | | } |
722 | | |
723 | | /// Return a new CT::Option that is set if @p also is set as well |
724 | | constexpr CT::Option<T> operator&&(CT::Choice also) { return CT::Option<T>(m_value, m_has_value && also); } |
725 | | |
726 | | private: |
727 | | Choice m_has_value; |
728 | | T m_value; |
729 | | }; |
730 | | |
731 | | template <typename T> |
732 | 1.76M | constexpr inline Mask<T> conditional_copy_mem(Mask<T> mask, T* to, const T* from0, const T* from1, size_t elems) { |
733 | 1.76M | mask.select_n(to, from0, from1, elems); |
734 | 1.76M | return mask; |
735 | 1.76M | } Botan::CT::Mask<unsigned long> Botan::CT::conditional_copy_mem<unsigned long>(Botan::CT::Mask<unsigned long>, unsigned long*, unsigned long const*, unsigned long const*, unsigned long) Line | Count | Source | 732 | 1.76M | constexpr inline Mask<T> conditional_copy_mem(Mask<T> mask, T* to, const T* from0, const T* from1, size_t elems) { | 733 | 1.76M | mask.select_n(to, from0, from1, elems); | 734 | 1.76M | return mask; | 735 | 1.76M | } |
Unexecuted instantiation: Botan::CT::Mask<unsigned char> Botan::CT::conditional_copy_mem<unsigned char>(Botan::CT::Mask<unsigned char>, unsigned char*, unsigned char const*, unsigned char const*, unsigned long) |
736 | | |
737 | | template <typename T> |
738 | 1.76M | constexpr inline Mask<T> conditional_copy_mem(T cnd, T* to, const T* from0, const T* from1, size_t elems) { |
739 | 1.76M | const auto mask = CT::Mask<T>::expand(cnd); |
740 | 1.76M | return CT::conditional_copy_mem(mask, to, from0, from1, elems); |
741 | 1.76M | } |
742 | | |
743 | | template <typename T> |
744 | 174M | constexpr inline Mask<T> conditional_assign_mem(T cnd, T* sink, const T* src, size_t elems) { |
745 | 174M | const auto mask = CT::Mask<T>::expand(cnd); |
746 | 174M | mask.select_n(sink, src, sink, elems); |
747 | 174M | return mask; |
748 | 174M | } |
749 | | |
750 | | template <typename T> |
751 | | constexpr inline Mask<T> conditional_assign_mem(Choice cnd, T* sink, const T* src, size_t elems) { |
752 | | const auto mask = CT::Mask<T>::from_choice(cnd); |
753 | | mask.select_n(sink, src, sink, elems); |
754 | | return mask; |
755 | | } |
756 | | |
757 | | template <typename T> |
758 | 38.6M | constexpr inline void conditional_swap(bool cnd, T& x, T& y) { |
759 | 38.6M | const auto swap = CT::Mask<T>::expand(cnd); |
760 | 38.6M | swap.conditional_swap(x, y); |
761 | 38.6M | } |
762 | | |
763 | | template <typename T> |
764 | 12.0M | constexpr inline void conditional_swap_ptr(bool cnd, T& x, T& y) { |
765 | 12.0M | uintptr_t xp = reinterpret_cast<uintptr_t>(x); |
766 | 12.0M | uintptr_t yp = reinterpret_cast<uintptr_t>(y); |
767 | | |
768 | 12.0M | conditional_swap<uintptr_t>(cnd, xp, yp); |
769 | | |
770 | 12.0M | x = reinterpret_cast<T>(xp); |
771 | 12.0M | y = reinterpret_cast<T>(yp); |
772 | 12.0M | } |
773 | | |
774 | | template <typename T> |
775 | 63.4M | constexpr inline CT::Mask<T> all_zeros(const T elem[], size_t len) { |
776 | 63.4M | T sum = 0; |
777 | 478M | for(size_t i = 0; i != len; ++i) { |
778 | 414M | sum |= elem[i]; |
779 | 414M | } |
780 | 63.4M | return CT::Mask<T>::is_zero(sum); |
781 | 63.4M | } Botan::CT::Mask<unsigned long> Botan::CT::all_zeros<unsigned long>(unsigned long const*, unsigned long) Line | Count | Source | 775 | 63.4M | constexpr inline CT::Mask<T> all_zeros(const T elem[], size_t len) { | 776 | 63.4M | T sum = 0; | 777 | 478M | for(size_t i = 0; i != len; ++i) { | 778 | 414M | sum |= elem[i]; | 779 | 414M | } | 780 | 63.4M | return CT::Mask<T>::is_zero(sum); | 781 | 63.4M | } |
Botan::CT::Mask<unsigned char> Botan::CT::all_zeros<unsigned char>(unsigned char const*, unsigned long) Line | Count | Source | 775 | 464 | constexpr inline CT::Mask<T> all_zeros(const T elem[], size_t len) { | 776 | 464 | T sum = 0; | 777 | 26.4k | for(size_t i = 0; i != len; ++i) { | 778 | 25.9k | sum |= elem[i]; | 779 | 25.9k | } | 780 | 464 | return CT::Mask<T>::is_zero(sum); | 781 | 464 | } |
|
782 | | |
783 | | /** |
784 | | * Compare two arrays of equal size and return a Mask indicating if |
785 | | * they are equal or not. The mask is set if they are identical. |
786 | | */ |
787 | | template <typename T> |
788 | 23.5k | constexpr inline CT::Mask<T> is_equal(const T x[], const T y[], size_t len) { |
789 | 23.5k | if(std::is_constant_evaluated()) { |
790 | 0 | T difference = 0; |
791 | |
|
792 | 0 | for(size_t i = 0; i != len; ++i) { |
793 | 0 | difference = difference | (x[i] ^ y[i]); |
794 | 0 | } |
795 | |
|
796 | 0 | return CT::Mask<T>::is_zero(difference); |
797 | 23.5k | } else { |
798 | 23.5k | volatile T difference = 0; |
799 | | |
800 | 383k | for(size_t i = 0; i != len; ++i) { |
801 | 359k | difference = difference | (x[i] ^ y[i]); |
802 | 359k | } |
803 | | |
804 | 23.5k | return CT::Mask<T>::is_zero(difference); |
805 | 23.5k | } |
806 | 23.5k | } Botan::CT::Mask<unsigned char> Botan::CT::is_equal<unsigned char>(unsigned char const*, unsigned char const*, unsigned long) Line | Count | Source | 788 | 8.72k | constexpr inline CT::Mask<T> is_equal(const T x[], const T y[], size_t len) { | 789 | 8.72k | if(std::is_constant_evaluated()) { | 790 | 0 | T difference = 0; | 791 | |
| 792 | 0 | for(size_t i = 0; i != len; ++i) { | 793 | 0 | difference = difference | (x[i] ^ y[i]); | 794 | 0 | } | 795 | |
| 796 | 0 | return CT::Mask<T>::is_zero(difference); | 797 | 8.72k | } else { | 798 | 8.72k | volatile T difference = 0; | 799 | | | 800 | 283k | for(size_t i = 0; i != len; ++i) { | 801 | 274k | difference = difference | (x[i] ^ y[i]); | 802 | 274k | } | 803 | | | 804 | 8.72k | return CT::Mask<T>::is_zero(difference); | 805 | 8.72k | } | 806 | 8.72k | } |
Botan::CT::Mask<unsigned long> Botan::CT::is_equal<unsigned long>(unsigned long const*, unsigned long const*, unsigned long) Line | Count | Source | 788 | 14.8k | constexpr inline CT::Mask<T> is_equal(const T x[], const T y[], size_t len) { | 789 | 14.8k | if(std::is_constant_evaluated()) { | 790 | 0 | T difference = 0; | 791 | |
| 792 | 0 | for(size_t i = 0; i != len; ++i) { | 793 | 0 | difference = difference | (x[i] ^ y[i]); | 794 | 0 | } | 795 | |
| 796 | 0 | return CT::Mask<T>::is_zero(difference); | 797 | 14.8k | } else { | 798 | 14.8k | volatile T difference = 0; | 799 | | | 800 | 100k | for(size_t i = 0; i != len; ++i) { | 801 | 85.2k | difference = difference | (x[i] ^ y[i]); | 802 | 85.2k | } | 803 | | | 804 | 14.8k | return CT::Mask<T>::is_zero(difference); | 805 | 14.8k | } | 806 | 14.8k | } |
Unexecuted instantiation: Botan::CT::Mask<unsigned short> Botan::CT::is_equal<unsigned short>(unsigned short const*, unsigned short const*, unsigned long) |
807 | | |
808 | | /** |
809 | | * Compare two arrays of equal size and return a Mask indicating if |
810 | | * they are equal or not. The mask is set if they differ. |
811 | | */ |
812 | | template <typename T> |
813 | 87 | constexpr inline CT::Mask<T> is_not_equal(const T x[], const T y[], size_t len) { |
814 | 87 | return ~CT::is_equal(x, y, len); |
815 | 87 | } |
816 | | |
817 | | /** |
818 | | * Constant time conditional copy out with offset |
819 | | * |
820 | | * If accept is set and offset <= input_length, sets output[0..] to |
821 | | * input[offset:input_length] and returns input_length - offset. The |
822 | | * remaining bytes of output are zeroized. |
823 | | * |
824 | | * Otherwise, output is zeroized, and returns an empty Ct::Option |
825 | | * |
826 | | * The input and output spans may not overlap, and output must be at |
827 | | * least as large as input. |
828 | | * |
829 | | * This function attempts to avoid leaking the following to side channels |
830 | | * - if accept was set or not |
831 | | * - the value of offset |
832 | | * - the value of input |
833 | | * |
834 | | * This function leaks the length of the input |
835 | | */ |
836 | | BOTAN_TEST_API |
837 | | CT::Option<size_t> copy_output(CT::Choice accept, |
838 | | std::span<uint8_t> output, |
839 | | std::span<const uint8_t> input, |
840 | | size_t offset); |
841 | | |
842 | | size_t count_leading_zero_bytes(std::span<const uint8_t> input); |
843 | | |
844 | | secure_vector<uint8_t> strip_leading_zeros(std::span<const uint8_t> input); |
845 | | |
846 | | } // namespace Botan::CT |
847 | | |
848 | | #endif |