/src/botan/build/include/internal/botan/internal/pcurves_mul.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * (C) 2024,2025 Jack Lloyd |
3 | | * |
4 | | * Botan is released under the Simplified BSD License (see license.txt) |
5 | | */ |
6 | | |
7 | | #ifndef BOTAN_PCURVES_MUL_H_ |
8 | | #define BOTAN_PCURVES_MUL_H_ |
9 | | |
10 | | #include <botan/types.h> |
11 | | #include <botan/internal/ct_utils.h> |
12 | | #include <botan/internal/pcurves_algos.h> |
13 | | #include <vector> |
14 | | |
15 | | namespace Botan { |
16 | | |
17 | | class RandomNumberGenerator; |
18 | | |
19 | | /* |
20 | | * Multiplication algorithm window size parameters |
21 | | */ |
22 | | |
23 | | static constexpr size_t BasePointWindowBits = 5; |
24 | | static constexpr size_t VarPointWindowBits = 4; |
25 | | static constexpr size_t Mul2PrecompWindowBits = 3; |
26 | | static constexpr size_t Mul2WindowBits = 2; |
27 | | |
28 | | /** |
29 | | * A precomputed table of affine points with constant time lookup |
30 | | * |
31 | | * If R is zero then the entire table is scanned for each lookup. |
32 | | * |
33 | | * If R is not zero, then the table must be a multiple of R points long. |
34 | | * Each lookup will be examine a range of length R, as in |
35 | | * pts[0..R], pts[R..2*R], ... |
36 | | */ |
37 | | template <typename C, size_t R = 0> |
38 | | class AffinePointTable final { |
39 | | public: |
40 | | using AffinePoint = typename C::AffinePoint; |
41 | | using ProjectivePoint = typename C::ProjectivePoint; |
42 | | using WordType = typename C::WordType; |
43 | | |
44 | | static constexpr bool WholeRangeSearch = (R == 0); |
45 | | |
46 | 2.23k | AffinePointTable(std::span<const ProjectivePoint> pts) { |
47 | 2.23k | BOTAN_ASSERT_NOMSG(pts.size() > 1); |
48 | | |
49 | | if constexpr(R > 0) { |
50 | | BOTAN_ASSERT_NOMSG(pts.size() % R == 0); |
51 | | } |
52 | | |
53 | | // TODO scatter/gather with SIMD lookup |
54 | 2.23k | m_table = to_affine_batch<C>(pts); |
55 | 2.23k | } pcurves_brainpool256r1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 0ul>::AffinePointTable(std::__1::span<Botan::(anonymous namespace)::ProjectiveCurvePoint<Botan::(anonymous namespace)::IntMod<Botan::(anonymous namespace)::MontgomeryRep<Botan::(anonymous namespace)::EllipticCurve<Botan::PCurve::(anonymous namespace)::brainpool256r1::Params, Botan::(anonymous namespace)::MontgomeryRep>::FieldParams> >, Botan::PCurve::(anonymous namespace)::brainpool256r1::Params> const, 18446744073709551615ul>) Line | Count | Source | 46 | 1.48k | AffinePointTable(std::span<const ProjectivePoint> pts) { | 47 | 1.48k | BOTAN_ASSERT_NOMSG(pts.size() > 1); | 48 | | | 49 | | if constexpr(R > 0) { | 50 | | BOTAN_ASSERT_NOMSG(pts.size() % R == 0); | 51 | | } | 52 | | | 53 | | // TODO scatter/gather with SIMD lookup | 54 | 1.48k | m_table = to_affine_batch<C>(pts); | 55 | 1.48k | } |
pcurves_brainpool384r1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 0ul>::AffinePointTable(std::__1::span<Botan::(anonymous namespace)::ProjectiveCurvePoint<Botan::(anonymous namespace)::IntMod<Botan::(anonymous namespace)::MontgomeryRep<Botan::(anonymous namespace)::EllipticCurve<Botan::PCurve::(anonymous namespace)::brainpool384r1::Params, Botan::(anonymous namespace)::MontgomeryRep>::FieldParams> >, Botan::PCurve::(anonymous namespace)::brainpool384r1::Params> const, 18446744073709551615ul>) Line | Count | Source | 46 | 33 | AffinePointTable(std::span<const ProjectivePoint> pts) { | 47 | 33 | BOTAN_ASSERT_NOMSG(pts.size() > 1); | 48 | | | 49 | | if constexpr(R > 0) { | 50 | | BOTAN_ASSERT_NOMSG(pts.size() % R == 0); | 51 | | } | 52 | | | 53 | | // TODO scatter/gather with SIMD lookup | 54 | 33 | m_table = to_affine_batch<C>(pts); | 55 | 33 | } |
pcurves_brainpool512r1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 0ul>::AffinePointTable(std::__1::span<Botan::(anonymous namespace)::ProjectiveCurvePoint<Botan::(anonymous namespace)::IntMod<Botan::(anonymous namespace)::MontgomeryRep<Botan::(anonymous namespace)::EllipticCurve<Botan::PCurve::(anonymous namespace)::brainpool512r1::Params, Botan::(anonymous namespace)::MontgomeryRep>::FieldParams> >, Botan::PCurve::(anonymous namespace)::brainpool512r1::Params> const, 18446744073709551615ul>) Line | Count | Source | 46 | 36 | AffinePointTable(std::span<const ProjectivePoint> pts) { | 47 | 36 | BOTAN_ASSERT_NOMSG(pts.size() > 1); | 48 | | | 49 | | if constexpr(R > 0) { | 50 | | BOTAN_ASSERT_NOMSG(pts.size() % R == 0); | 51 | | } | 52 | | | 53 | | // TODO scatter/gather with SIMD lookup | 54 | 36 | m_table = to_affine_batch<C>(pts); | 55 | 36 | } |
Unexecuted instantiation: pcurves_frp256v1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 0ul>::AffinePointTable(std::__1::span<Botan::(anonymous namespace)::ProjectiveCurvePoint<Botan::(anonymous namespace)::IntMod<Botan::(anonymous namespace)::MontgomeryRep<Botan::(anonymous namespace)::EllipticCurve<Botan::PCurve::(anonymous namespace)::frp256v1::Params, Botan::(anonymous namespace)::MontgomeryRep>::FieldParams> >, Botan::PCurve::(anonymous namespace)::frp256v1::Params> const, 18446744073709551615ul>) Unexecuted instantiation: Botan::AffinePointTable<Botan::PCurve::GenericCurve, 0ul>::AffinePointTable(std::__1::span<Botan::PCurve::GenericProjectivePoint const, 18446744073709551615ul>) Unexecuted instantiation: pcurves_numsp512d1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 0ul>::AffinePointTable(std::__1::span<Botan::(anonymous namespace)::ProjectiveCurvePoint<Botan::(anonymous namespace)::IntMod<Botan::PCurve::(anonymous namespace)::numsp512d1::Numsp512d1Rep<Botan::(anonymous namespace)::EllipticCurve<Botan::PCurve::(anonymous namespace)::numsp512d1::Params, Botan::PCurve::(anonymous namespace)::numsp512d1::Numsp512d1Rep>::FieldParams> >, Botan::PCurve::(anonymous namespace)::numsp512d1::Params> const, 18446744073709551615ul>) Unexecuted instantiation: pcurves_secp192r1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 0ul>::AffinePointTable(std::__1::span<Botan::(anonymous namespace)::ProjectiveCurvePoint<Botan::(anonymous namespace)::IntMod<Botan::PCurve::(anonymous namespace)::secp192r1::Secp192r1Rep<Botan::(anonymous namespace)::EllipticCurve<Botan::PCurve::(anonymous namespace)::secp192r1::Params, Botan::PCurve::(anonymous namespace)::secp192r1::Secp192r1Rep>::FieldParams> >, Botan::PCurve::(anonymous namespace)::secp192r1::Params> const, 18446744073709551615ul>) Unexecuted instantiation: pcurves_secp224r1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 0ul>::AffinePointTable(std::__1::span<Botan::(anonymous namespace)::ProjectiveCurvePoint<Botan::(anonymous namespace)::IntMod<Botan::PCurve::(anonymous namespace)::secp224r1::Secp224r1Rep<Botan::(anonymous namespace)::EllipticCurve<Botan::PCurve::(anonymous namespace)::secp224r1::Params, Botan::PCurve::(anonymous namespace)::secp224r1::Secp224r1Rep>::FieldParams> >, Botan::PCurve::(anonymous namespace)::secp224r1::Params> const, 18446744073709551615ul>) Unexecuted instantiation: pcurves_secp256k1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 0ul>::AffinePointTable(std::__1::span<Botan::(anonymous namespace)::ProjectiveCurvePoint<Botan::(anonymous namespace)::IntMod<Botan::PCurve::(anonymous namespace)::secp256k1::Secp256k1Rep<Botan::(anonymous namespace)::EllipticCurve<Botan::PCurve::(anonymous namespace)::secp256k1::Params, Botan::PCurve::(anonymous namespace)::secp256k1::Secp256k1Rep>::FieldParams> >, Botan::PCurve::(anonymous namespace)::secp256k1::Params> const, 18446744073709551615ul>) pcurves_secp256r1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 0ul>::AffinePointTable(std::__1::span<Botan::(anonymous namespace)::ProjectiveCurvePoint<Botan::(anonymous namespace)::IntMod<Botan::PCurve::(anonymous namespace)::Secp256r1Rep<Botan::(anonymous namespace)::EllipticCurve<Botan::PCurve::(anonymous namespace)::secp256r1::Params, Botan::PCurve::(anonymous namespace)::Secp256r1Rep>::FieldParams> >, Botan::PCurve::(anonymous namespace)::secp256r1::Params> const, 18446744073709551615ul>) Line | Count | Source | 46 | 369 | AffinePointTable(std::span<const ProjectivePoint> pts) { | 47 | 369 | BOTAN_ASSERT_NOMSG(pts.size() > 1); | 48 | | | 49 | | if constexpr(R > 0) { | 50 | | BOTAN_ASSERT_NOMSG(pts.size() % R == 0); | 51 | | } | 52 | | | 53 | | // TODO scatter/gather with SIMD lookup | 54 | 369 | m_table = to_affine_batch<C>(pts); | 55 | 369 | } |
pcurves_secp384r1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 0ul>::AffinePointTable(std::__1::span<Botan::(anonymous namespace)::ProjectiveCurvePoint<Botan::(anonymous namespace)::IntMod<Botan::PCurve::(anonymous namespace)::Secp384r1Rep<Botan::(anonymous namespace)::EllipticCurve<Botan::PCurve::(anonymous namespace)::secp384r1::Params, Botan::PCurve::(anonymous namespace)::Secp384r1Rep>::FieldParams> >, Botan::PCurve::(anonymous namespace)::secp384r1::Params> const, 18446744073709551615ul>) Line | Count | Source | 46 | 154 | AffinePointTable(std::span<const ProjectivePoint> pts) { | 47 | 154 | BOTAN_ASSERT_NOMSG(pts.size() > 1); | 48 | | | 49 | | if constexpr(R > 0) { | 50 | | BOTAN_ASSERT_NOMSG(pts.size() % R == 0); | 51 | | } | 52 | | | 53 | | // TODO scatter/gather with SIMD lookup | 54 | 154 | m_table = to_affine_batch<C>(pts); | 55 | 154 | } |
pcurves_secp521r1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 0ul>::AffinePointTable(std::__1::span<Botan::(anonymous namespace)::ProjectiveCurvePoint<Botan::(anonymous namespace)::IntMod<Botan::PCurve::(anonymous namespace)::secp521r1::P521Rep<Botan::(anonymous namespace)::EllipticCurve<Botan::PCurve::(anonymous namespace)::secp521r1::Params, Botan::PCurve::(anonymous namespace)::secp521r1::P521Rep>::FieldParams> >, Botan::PCurve::(anonymous namespace)::secp521r1::Params> const, 18446744073709551615ul>) Line | Count | Source | 46 | 155 | AffinePointTable(std::span<const ProjectivePoint> pts) { | 47 | 155 | BOTAN_ASSERT_NOMSG(pts.size() > 1); | 48 | | | 49 | | if constexpr(R > 0) { | 50 | | BOTAN_ASSERT_NOMSG(pts.size() % R == 0); | 51 | | } | 52 | | | 53 | | // TODO scatter/gather with SIMD lookup | 54 | 155 | m_table = to_affine_batch<C>(pts); | 55 | 155 | } |
Unexecuted instantiation: pcurves_sm2p256v1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 0ul>::AffinePointTable(std::__1::span<Botan::(anonymous namespace)::ProjectiveCurvePoint<Botan::(anonymous namespace)::IntMod<Botan::PCurve::(anonymous namespace)::sm2p256v1::Sm2p256v1Rep<Botan::(anonymous namespace)::EllipticCurve<Botan::PCurve::(anonymous namespace)::sm2p256v1::Params, Botan::PCurve::(anonymous namespace)::sm2p256v1::Sm2p256v1Rep>::FieldParams> >, Botan::PCurve::(anonymous namespace)::sm2p256v1::Params> const, 18446744073709551615ul>) |
56 | | |
57 | | /** |
58 | | * If idx is zero then return the identity element. Otherwise return pts[idx - 1] |
59 | | */ |
60 | | inline AffinePoint ct_select(size_t idx) const |
61 | | requires(WholeRangeSearch) |
62 | 164k | { |
63 | 164k | BOTAN_DEBUG_ASSERT(idx < m_table.size() + 1); |
64 | | |
65 | 164k | auto result = AffinePoint::identity(m_table[0]); |
66 | | |
67 | | // Intentionally wrapping; set to maximum size_t if idx == 0 |
68 | 164k | const size_t idx1 = static_cast<size_t>(idx - 1); |
69 | 2.79M | for(size_t i = 0; i != m_table.size(); ++i) { |
70 | 2.63M | const auto found = CT::Mask<size_t>::is_equal(idx1, i).as_choice(); |
71 | 2.63M | result.conditional_assign(found, m_table[i]); |
72 | 2.63M | } |
73 | | |
74 | 164k | return result; |
75 | 164k | } pcurves_brainpool256r1.cpp:_ZNK5Botan16AffinePointTableINS_6PCurve12_GLOBAL__N_114brainpool256r15CurveELm0EE9ct_selectEmQL_ZNS_16AffinePointTable16WholeRangeSearchEE Line | Count | Source | 62 | 96.5k | { | 63 | 96.5k | BOTAN_DEBUG_ASSERT(idx < m_table.size() + 1); | 64 | | | 65 | 96.5k | auto result = AffinePoint::identity(m_table[0]); | 66 | | | 67 | | // Intentionally wrapping; set to maximum size_t if idx == 0 | 68 | 96.5k | const size_t idx1 = static_cast<size_t>(idx - 1); | 69 | 1.64M | for(size_t i = 0; i != m_table.size(); ++i) { | 70 | 1.54M | const auto found = CT::Mask<size_t>::is_equal(idx1, i).as_choice(); | 71 | 1.54M | result.conditional_assign(found, m_table[i]); | 72 | 1.54M | } | 73 | | | 74 | 96.5k | return result; | 75 | 96.5k | } |
pcurves_brainpool384r1.cpp:_ZNK5Botan16AffinePointTableINS_6PCurve12_GLOBAL__N_114brainpool384r15CurveELm0EE9ct_selectEmQL_ZNS_16AffinePointTable16WholeRangeSearchEE Line | Count | Source | 62 | 3.39k | { | 63 | 3.39k | BOTAN_DEBUG_ASSERT(idx < m_table.size() + 1); | 64 | | | 65 | 3.39k | auto result = AffinePoint::identity(m_table[0]); | 66 | | | 67 | | // Intentionally wrapping; set to maximum size_t if idx == 0 | 68 | 3.39k | const size_t idx1 = static_cast<size_t>(idx - 1); | 69 | 57.7k | for(size_t i = 0; i != m_table.size(); ++i) { | 70 | 54.3k | const auto found = CT::Mask<size_t>::is_equal(idx1, i).as_choice(); | 71 | 54.3k | result.conditional_assign(found, m_table[i]); | 72 | 54.3k | } | 73 | | | 74 | 3.39k | return result; | 75 | 3.39k | } |
pcurves_brainpool512r1.cpp:_ZNK5Botan16AffinePointTableINS_6PCurve12_GLOBAL__N_114brainpool512r15CurveELm0EE9ct_selectEmQL_ZNS_16AffinePointTable16WholeRangeSearchEE Line | Count | Source | 62 | 4.64k | { | 63 | 4.64k | BOTAN_DEBUG_ASSERT(idx < m_table.size() + 1); | 64 | | | 65 | 4.64k | auto result = AffinePoint::identity(m_table[0]); | 66 | | | 67 | | // Intentionally wrapping; set to maximum size_t if idx == 0 | 68 | 4.64k | const size_t idx1 = static_cast<size_t>(idx - 1); | 69 | 78.9k | for(size_t i = 0; i != m_table.size(); ++i) { | 70 | 74.3k | const auto found = CT::Mask<size_t>::is_equal(idx1, i).as_choice(); | 71 | 74.3k | result.conditional_assign(found, m_table[i]); | 72 | 74.3k | } | 73 | | | 74 | 4.64k | return result; | 75 | 4.64k | } |
Unexecuted instantiation: pcurves_frp256v1.cpp:_ZNK5Botan16AffinePointTableINS_6PCurve12_GLOBAL__N_18frp256v15CurveELm0EE9ct_selectEmQL_ZNS_16AffinePointTable16WholeRangeSearchEE Unexecuted instantiation: _ZNK5Botan16AffinePointTableINS_6PCurve12GenericCurveELm0EE9ct_selectEmQL_ZNS_16AffinePointTable16WholeRangeSearchEE Unexecuted instantiation: pcurves_numsp512d1.cpp:_ZNK5Botan16AffinePointTableINS_6PCurve12_GLOBAL__N_110numsp512d15CurveELm0EE9ct_selectEmQL_ZNS_16AffinePointTable16WholeRangeSearchEE Unexecuted instantiation: pcurves_secp192r1.cpp:_ZNK5Botan16AffinePointTableINS_6PCurve12_GLOBAL__N_19secp192r15CurveELm0EE9ct_selectEmQL_ZNS_16AffinePointTable16WholeRangeSearchEE Unexecuted instantiation: pcurves_secp224r1.cpp:_ZNK5Botan16AffinePointTableINS_6PCurve12_GLOBAL__N_19secp224r15CurveELm0EE9ct_selectEmQL_ZNS_16AffinePointTable16WholeRangeSearchEE Unexecuted instantiation: pcurves_secp256k1.cpp:_ZNK5Botan16AffinePointTableINS_6PCurve12_GLOBAL__N_19secp256k15CurveELm0EE9ct_selectEmQL_ZNS_16AffinePointTable16WholeRangeSearchEE pcurves_secp256r1.cpp:_ZNK5Botan16AffinePointTableINS_6PCurve12_GLOBAL__N_19secp256r15CurveELm0EE9ct_selectEmQL_ZNS_16AffinePointTable16WholeRangeSearchEE Line | Count | Source | 62 | 23.9k | { | 63 | 23.9k | BOTAN_DEBUG_ASSERT(idx < m_table.size() + 1); | 64 | | | 65 | 23.9k | auto result = AffinePoint::identity(m_table[0]); | 66 | | | 67 | | // Intentionally wrapping; set to maximum size_t if idx == 0 | 68 | 23.9k | const size_t idx1 = static_cast<size_t>(idx - 1); | 69 | 407k | for(size_t i = 0; i != m_table.size(); ++i) { | 70 | 383k | const auto found = CT::Mask<size_t>::is_equal(idx1, i).as_choice(); | 71 | 383k | result.conditional_assign(found, m_table[i]); | 72 | 383k | } | 73 | | | 74 | 23.9k | return result; | 75 | 23.9k | } |
pcurves_secp384r1.cpp:_ZNK5Botan16AffinePointTableINS_6PCurve12_GLOBAL__N_19secp384r15CurveELm0EE9ct_selectEmQL_ZNS_16AffinePointTable16WholeRangeSearchEE Line | Count | Source | 62 | 15.8k | { | 63 | 15.8k | BOTAN_DEBUG_ASSERT(idx < m_table.size() + 1); | 64 | | | 65 | 15.8k | auto result = AffinePoint::identity(m_table[0]); | 66 | | | 67 | | // Intentionally wrapping; set to maximum size_t if idx == 0 | 68 | 15.8k | const size_t idx1 = static_cast<size_t>(idx - 1); | 69 | 269k | for(size_t i = 0; i != m_table.size(); ++i) { | 70 | 253k | const auto found = CT::Mask<size_t>::is_equal(idx1, i).as_choice(); | 71 | 253k | result.conditional_assign(found, m_table[i]); | 72 | 253k | } | 73 | | | 74 | 15.8k | return result; | 75 | 15.8k | } |
pcurves_secp521r1.cpp:_ZNK5Botan16AffinePointTableINS_6PCurve12_GLOBAL__N_19secp521r15CurveELm0EE9ct_selectEmQL_ZNS_16AffinePointTable16WholeRangeSearchEE Line | Count | Source | 62 | 20.1k | { | 63 | 20.1k | BOTAN_DEBUG_ASSERT(idx < m_table.size() + 1); | 64 | | | 65 | 20.1k | auto result = AffinePoint::identity(m_table[0]); | 66 | | | 67 | | // Intentionally wrapping; set to maximum size_t if idx == 0 | 68 | 20.1k | const size_t idx1 = static_cast<size_t>(idx - 1); | 69 | 342k | for(size_t i = 0; i != m_table.size(); ++i) { | 70 | 322k | const auto found = CT::Mask<size_t>::is_equal(idx1, i).as_choice(); | 71 | 322k | result.conditional_assign(found, m_table[i]); | 72 | 322k | } | 73 | | | 74 | 20.1k | return result; | 75 | 20.1k | } |
Unexecuted instantiation: pcurves_sm2p256v1.cpp:_ZNK5Botan16AffinePointTableINS_6PCurve12_GLOBAL__N_19sm2p256v15CurveELm0EE9ct_selectEmQL_ZNS_16AffinePointTable16WholeRangeSearchEE |
76 | | |
77 | | /** |
78 | | * If idx is zero then return the identity element. Otherwise return pts[idx - 1] |
79 | | * out of the table subrange pts[iter*R..(iter+1)*R] |
80 | | */ |
81 | | inline AffinePoint ct_select(size_t idx, size_t iter) const |
82 | | requires(!WholeRangeSearch) |
83 | | { |
84 | | BOTAN_DEBUG_ASSERT(idx < R + 1); |
85 | | BOTAN_DEBUG_ASSERT(R * (iter + 1) <= m_table.size()); |
86 | | |
87 | | auto result = AffinePoint::identity(m_table[R * iter]); |
88 | | |
89 | | // Intentionally wrapping; set to maximum size_t if idx == 0 |
90 | | const size_t idx1 = static_cast<size_t>(idx - 1); |
91 | | for(size_t i = 0; i != R; ++i) { |
92 | | const auto found = CT::Mask<size_t>::is_equal(idx1, i).as_choice(); |
93 | | result.conditional_assign(found, m_table[R * iter + i]); |
94 | | } |
95 | | |
96 | | return result; |
97 | | } |
98 | | |
99 | | private: |
100 | | std::vector<AffinePoint> m_table; |
101 | | }; |
102 | | |
103 | | /* |
104 | | * Base point precomputation table |
105 | | * |
106 | | * This algorithm works by precomputing a set of points such that |
107 | | * the online phase of the point multiplication can be effected by |
108 | | * a sequence of point additions. |
109 | | * |
110 | | * The tables, even for W = 1, are large and costly to precompute, so |
111 | | * this is only used for the base point. |
112 | | * |
113 | | * The online phase of the algorithm uess `ceil(SB/W)` additions, |
114 | | * and no point doublings. The table is of size |
115 | | * `ceil(SB + W - 1)/W * ((1 << W) - 1)` |
116 | | * where SB is the bit length of the (blinded) scalar. |
117 | | * |
118 | | * Each window of the scalar is associated with a window in the table. |
119 | | * The table windows are unique to that offset within the scalar. |
120 | | * |
121 | | * The simplest version to understand is when W = 1. There the table |
122 | | * consists of [P, 2*P, 4*P, ..., 2^N*P] where N is the bit length of |
123 | | * the group order. The online phase consists of conditionally adding |
124 | | * table[i] depending on if bit i of the scalar is set or not. |
125 | | * |
126 | | * When W = 2, the scalar is examined 2 bits at a time, and the table |
127 | | * for a window index `I` is [(2^I)*P, (2^(I+1))*P, (2^I+2^(I+1))*P]. |
128 | | * |
129 | | * This extends similarly for larger W |
130 | | * |
131 | | * At a certain point, the side channel silent table lookup becomes the |
132 | | * dominating cost |
133 | | * |
134 | | * For all W, each window in the table has an implicit element of |
135 | | * the identity element which is used if the scalar bits were all zero. |
136 | | * This is omitted to save space; AffinePoint::ct_select is designed |
137 | | * to assist in this by returning the identity element if its index |
138 | | * argument is zero, or otherwise it returns table[idx - 1] |
139 | | */ |
140 | | template <typename C, size_t WindowBits> |
141 | 443 | std::vector<typename C::AffinePoint> basemul_setup(const typename C::AffinePoint& p, size_t max_scalar_bits) { |
142 | 443 | static_assert(WindowBits >= 1 && WindowBits <= 8); |
143 | | |
144 | | // 2^W elements, less the identity element |
145 | 443 | constexpr size_t WindowElements = (1 << WindowBits) - 1; |
146 | | |
147 | 443 | const size_t Windows = (max_scalar_bits + WindowBits - 1) / WindowBits; |
148 | | |
149 | 443 | const size_t TableSize = Windows * WindowElements; |
150 | | |
151 | 443 | std::vector<typename C::ProjectivePoint> table; |
152 | 443 | table.reserve(TableSize); |
153 | | |
154 | 443 | auto accum = C::ProjectivePoint::from_affine(p); |
155 | | |
156 | 30.2k | for(size_t i = 0; i != TableSize; i += WindowElements) { |
157 | 29.8k | table.push_back(accum); |
158 | | |
159 | 923k | for(size_t j = 1; j != WindowElements; ++j) { |
160 | 894k | if(j % 2 == 1) { |
161 | 447k | table.emplace_back(table[i + j / 2].dbl()); |
162 | 447k | } else { |
163 | 447k | table.emplace_back(table[i + j - 1] + table[i]); |
164 | 447k | } |
165 | 894k | } |
166 | | |
167 | 29.8k | accum = table[i + (WindowElements / 2)].dbl(); |
168 | 29.8k | } |
169 | | |
170 | 443 | return to_affine_batch<C>(table); |
171 | 443 | } pcurves_brainpool256r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::AffinePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::AffinePoint> > Botan::basemul_setup<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 5ul>(Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::AffinePoint const&, unsigned long) Line | Count | Source | 141 | 4 | std::vector<typename C::AffinePoint> basemul_setup(const typename C::AffinePoint& p, size_t max_scalar_bits) { | 142 | 4 | static_assert(WindowBits >= 1 && WindowBits <= 8); | 143 | | | 144 | | // 2^W elements, less the identity element | 145 | 4 | constexpr size_t WindowElements = (1 << WindowBits) - 1; | 146 | | | 147 | 4 | const size_t Windows = (max_scalar_bits + WindowBits - 1) / WindowBits; | 148 | | | 149 | 4 | const size_t TableSize = Windows * WindowElements; | 150 | | | 151 | 4 | std::vector<typename C::ProjectivePoint> table; | 152 | 4 | table.reserve(TableSize); | 153 | | | 154 | 4 | auto accum = C::ProjectivePoint::from_affine(p); | 155 | | | 156 | 260 | for(size_t i = 0; i != TableSize; i += WindowElements) { | 157 | 256 | table.push_back(accum); | 158 | | | 159 | 7.93k | for(size_t j = 1; j != WindowElements; ++j) { | 160 | 7.68k | if(j % 2 == 1) { | 161 | 3.84k | table.emplace_back(table[i + j / 2].dbl()); | 162 | 3.84k | } else { | 163 | 3.84k | table.emplace_back(table[i + j - 1] + table[i]); | 164 | 3.84k | } | 165 | 7.68k | } | 166 | | | 167 | 256 | accum = table[i + (WindowElements / 2)].dbl(); | 168 | 256 | } | 169 | | | 170 | 4 | return to_affine_batch<C>(table); | 171 | 4 | } |
pcurves_brainpool384r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::AffinePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::AffinePoint> > Botan::basemul_setup<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 5ul>(Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::AffinePoint const&, unsigned long) Line | Count | Source | 141 | 3 | std::vector<typename C::AffinePoint> basemul_setup(const typename C::AffinePoint& p, size_t max_scalar_bits) { | 142 | 3 | static_assert(WindowBits >= 1 && WindowBits <= 8); | 143 | | | 144 | | // 2^W elements, less the identity element | 145 | 3 | constexpr size_t WindowElements = (1 << WindowBits) - 1; | 146 | | | 147 | 3 | const size_t Windows = (max_scalar_bits + WindowBits - 1) / WindowBits; | 148 | | | 149 | 3 | const size_t TableSize = Windows * WindowElements; | 150 | | | 151 | 3 | std::vector<typename C::ProjectivePoint> table; | 152 | 3 | table.reserve(TableSize); | 153 | | | 154 | 3 | auto accum = C::ProjectivePoint::from_affine(p); | 155 | | | 156 | 312 | for(size_t i = 0; i != TableSize; i += WindowElements) { | 157 | 309 | table.push_back(accum); | 158 | | | 159 | 9.57k | for(size_t j = 1; j != WindowElements; ++j) { | 160 | 9.27k | if(j % 2 == 1) { | 161 | 4.63k | table.emplace_back(table[i + j / 2].dbl()); | 162 | 4.63k | } else { | 163 | 4.63k | table.emplace_back(table[i + j - 1] + table[i]); | 164 | 4.63k | } | 165 | 9.27k | } | 166 | | | 167 | 309 | accum = table[i + (WindowElements / 2)].dbl(); | 168 | 309 | } | 169 | | | 170 | 3 | return to_affine_batch<C>(table); | 171 | 3 | } |
pcurves_brainpool512r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::AffinePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::AffinePoint> > Botan::basemul_setup<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 5ul>(Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::AffinePoint const&, unsigned long) Line | Count | Source | 141 | 3 | std::vector<typename C::AffinePoint> basemul_setup(const typename C::AffinePoint& p, size_t max_scalar_bits) { | 142 | 3 | static_assert(WindowBits >= 1 && WindowBits <= 8); | 143 | | | 144 | | // 2^W elements, less the identity element | 145 | 3 | constexpr size_t WindowElements = (1 << WindowBits) - 1; | 146 | | | 147 | 3 | const size_t Windows = (max_scalar_bits + WindowBits - 1) / WindowBits; | 148 | | | 149 | 3 | const size_t TableSize = Windows * WindowElements; | 150 | | | 151 | 3 | std::vector<typename C::ProjectivePoint> table; | 152 | 3 | table.reserve(TableSize); | 153 | | | 154 | 3 | auto accum = C::ProjectivePoint::from_affine(p); | 155 | | | 156 | 387 | for(size_t i = 0; i != TableSize; i += WindowElements) { | 157 | 384 | table.push_back(accum); | 158 | | | 159 | 11.9k | for(size_t j = 1; j != WindowElements; ++j) { | 160 | 11.5k | if(j % 2 == 1) { | 161 | 5.76k | table.emplace_back(table[i + j / 2].dbl()); | 162 | 5.76k | } else { | 163 | 5.76k | table.emplace_back(table[i + j - 1] + table[i]); | 164 | 5.76k | } | 165 | 11.5k | } | 166 | | | 167 | 384 | accum = table[i + (WindowElements / 2)].dbl(); | 168 | 384 | } | 169 | | | 170 | 3 | return to_affine_batch<C>(table); | 171 | 3 | } |
Unexecuted instantiation: pcurves_frp256v1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::frp256v1::Curve::AffinePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::frp256v1::Curve::AffinePoint> > Botan::basemul_setup<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 5ul>(Botan::PCurve::(anonymous namespace)::frp256v1::Curve::AffinePoint const&, unsigned long) std::__1::vector<Botan::PCurve::GenericCurve::AffinePoint, std::__1::allocator<Botan::PCurve::GenericCurve::AffinePoint> > Botan::basemul_setup<Botan::PCurve::GenericCurve, 5ul>(Botan::PCurve::GenericCurve::AffinePoint const&, unsigned long) Line | Count | Source | 141 | 404 | std::vector<typename C::AffinePoint> basemul_setup(const typename C::AffinePoint& p, size_t max_scalar_bits) { | 142 | 404 | static_assert(WindowBits >= 1 && WindowBits <= 8); | 143 | | | 144 | | // 2^W elements, less the identity element | 145 | 404 | constexpr size_t WindowElements = (1 << WindowBits) - 1; | 146 | | | 147 | 404 | const size_t Windows = (max_scalar_bits + WindowBits - 1) / WindowBits; | 148 | | | 149 | 404 | const size_t TableSize = Windows * WindowElements; | 150 | | | 151 | 404 | std::vector<typename C::ProjectivePoint> table; | 152 | 404 | table.reserve(TableSize); | 153 | | | 154 | 404 | auto accum = C::ProjectivePoint::from_affine(p); | 155 | | | 156 | 26.8k | for(size_t i = 0; i != TableSize; i += WindowElements) { | 157 | 26.4k | table.push_back(accum); | 158 | | | 159 | 819k | for(size_t j = 1; j != WindowElements; ++j) { | 160 | 793k | if(j % 2 == 1) { | 161 | 396k | table.emplace_back(table[i + j / 2].dbl()); | 162 | 396k | } else { | 163 | 396k | table.emplace_back(table[i + j - 1] + table[i]); | 164 | 396k | } | 165 | 793k | } | 166 | | | 167 | 26.4k | accum = table[i + (WindowElements / 2)].dbl(); | 168 | 26.4k | } | 169 | | | 170 | 404 | return to_affine_batch<C>(table); | 171 | 404 | } |
Unexecuted instantiation: pcurves_numsp512d1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::AffinePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::AffinePoint> > Botan::basemul_setup<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 5ul>(Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::AffinePoint const&, unsigned long) pcurves_secp192r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp192r1::Curve::AffinePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp192r1::Curve::AffinePoint> > Botan::basemul_setup<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 5ul>(Botan::PCurve::(anonymous namespace)::secp192r1::Curve::AffinePoint const&, unsigned long) Line | Count | Source | 141 | 4 | std::vector<typename C::AffinePoint> basemul_setup(const typename C::AffinePoint& p, size_t max_scalar_bits) { | 142 | 4 | static_assert(WindowBits >= 1 && WindowBits <= 8); | 143 | | | 144 | | // 2^W elements, less the identity element | 145 | 4 | constexpr size_t WindowElements = (1 << WindowBits) - 1; | 146 | | | 147 | 4 | const size_t Windows = (max_scalar_bits + WindowBits - 1) / WindowBits; | 148 | | | 149 | 4 | const size_t TableSize = Windows * WindowElements; | 150 | | | 151 | 4 | std::vector<typename C::ProjectivePoint> table; | 152 | 4 | table.reserve(TableSize); | 153 | | | 154 | 4 | auto accum = C::ProjectivePoint::from_affine(p); | 155 | | | 156 | 212 | for(size_t i = 0; i != TableSize; i += WindowElements) { | 157 | 208 | table.push_back(accum); | 158 | | | 159 | 6.44k | for(size_t j = 1; j != WindowElements; ++j) { | 160 | 6.24k | if(j % 2 == 1) { | 161 | 3.12k | table.emplace_back(table[i + j / 2].dbl()); | 162 | 3.12k | } else { | 163 | 3.12k | table.emplace_back(table[i + j - 1] + table[i]); | 164 | 3.12k | } | 165 | 6.24k | } | 166 | | | 167 | 208 | accum = table[i + (WindowElements / 2)].dbl(); | 168 | 208 | } | 169 | | | 170 | 4 | return to_affine_batch<C>(table); | 171 | 4 | } |
pcurves_secp224r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp224r1::Curve::AffinePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp224r1::Curve::AffinePoint> > Botan::basemul_setup<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 5ul>(Botan::PCurve::(anonymous namespace)::secp224r1::Curve::AffinePoint const&, unsigned long) Line | Count | Source | 141 | 4 | std::vector<typename C::AffinePoint> basemul_setup(const typename C::AffinePoint& p, size_t max_scalar_bits) { | 142 | 4 | static_assert(WindowBits >= 1 && WindowBits <= 8); | 143 | | | 144 | | // 2^W elements, less the identity element | 145 | 4 | constexpr size_t WindowElements = (1 << WindowBits) - 1; | 146 | | | 147 | 4 | const size_t Windows = (max_scalar_bits + WindowBits - 1) / WindowBits; | 148 | | | 149 | 4 | const size_t TableSize = Windows * WindowElements; | 150 | | | 151 | 4 | std::vector<typename C::ProjectivePoint> table; | 152 | 4 | table.reserve(TableSize); | 153 | | | 154 | 4 | auto accum = C::ProjectivePoint::from_affine(p); | 155 | | | 156 | 236 | for(size_t i = 0; i != TableSize; i += WindowElements) { | 157 | 232 | table.push_back(accum); | 158 | | | 159 | 7.19k | for(size_t j = 1; j != WindowElements; ++j) { | 160 | 6.96k | if(j % 2 == 1) { | 161 | 3.48k | table.emplace_back(table[i + j / 2].dbl()); | 162 | 3.48k | } else { | 163 | 3.48k | table.emplace_back(table[i + j - 1] + table[i]); | 164 | 3.48k | } | 165 | 6.96k | } | 166 | | | 167 | 232 | accum = table[i + (WindowElements / 2)].dbl(); | 168 | 232 | } | 169 | | | 170 | 4 | return to_affine_batch<C>(table); | 171 | 4 | } |
pcurves_secp256k1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp256k1::Curve::AffinePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp256k1::Curve::AffinePoint> > Botan::basemul_setup<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 5ul>(Botan::PCurve::(anonymous namespace)::secp256k1::Curve::AffinePoint const&, unsigned long) Line | Count | Source | 141 | 3 | std::vector<typename C::AffinePoint> basemul_setup(const typename C::AffinePoint& p, size_t max_scalar_bits) { | 142 | 3 | static_assert(WindowBits >= 1 && WindowBits <= 8); | 143 | | | 144 | | // 2^W elements, less the identity element | 145 | 3 | constexpr size_t WindowElements = (1 << WindowBits) - 1; | 146 | | | 147 | 3 | const size_t Windows = (max_scalar_bits + WindowBits - 1) / WindowBits; | 148 | | | 149 | 3 | const size_t TableSize = Windows * WindowElements; | 150 | | | 151 | 3 | std::vector<typename C::ProjectivePoint> table; | 152 | 3 | table.reserve(TableSize); | 153 | | | 154 | 3 | auto accum = C::ProjectivePoint::from_affine(p); | 155 | | | 156 | 195 | for(size_t i = 0; i != TableSize; i += WindowElements) { | 157 | 192 | table.push_back(accum); | 158 | | | 159 | 5.95k | for(size_t j = 1; j != WindowElements; ++j) { | 160 | 5.76k | if(j % 2 == 1) { | 161 | 2.88k | table.emplace_back(table[i + j / 2].dbl()); | 162 | 2.88k | } else { | 163 | 2.88k | table.emplace_back(table[i + j - 1] + table[i]); | 164 | 2.88k | } | 165 | 5.76k | } | 166 | | | 167 | 192 | accum = table[i + (WindowElements / 2)].dbl(); | 168 | 192 | } | 169 | | | 170 | 3 | return to_affine_batch<C>(table); | 171 | 3 | } |
pcurves_secp256r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp256r1::Curve::AffinePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp256r1::Curve::AffinePoint> > Botan::basemul_setup<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 5ul>(Botan::PCurve::(anonymous namespace)::secp256r1::Curve::AffinePoint const&, unsigned long) Line | Count | Source | 141 | 6 | std::vector<typename C::AffinePoint> basemul_setup(const typename C::AffinePoint& p, size_t max_scalar_bits) { | 142 | 6 | static_assert(WindowBits >= 1 && WindowBits <= 8); | 143 | | | 144 | | // 2^W elements, less the identity element | 145 | 6 | constexpr size_t WindowElements = (1 << WindowBits) - 1; | 146 | | | 147 | 6 | const size_t Windows = (max_scalar_bits + WindowBits - 1) / WindowBits; | 148 | | | 149 | 6 | const size_t TableSize = Windows * WindowElements; | 150 | | | 151 | 6 | std::vector<typename C::ProjectivePoint> table; | 152 | 6 | table.reserve(TableSize); | 153 | | | 154 | 6 | auto accum = C::ProjectivePoint::from_affine(p); | 155 | | | 156 | 390 | for(size_t i = 0; i != TableSize; i += WindowElements) { | 157 | 384 | table.push_back(accum); | 158 | | | 159 | 11.9k | for(size_t j = 1; j != WindowElements; ++j) { | 160 | 11.5k | if(j % 2 == 1) { | 161 | 5.76k | table.emplace_back(table[i + j / 2].dbl()); | 162 | 5.76k | } else { | 163 | 5.76k | table.emplace_back(table[i + j - 1] + table[i]); | 164 | 5.76k | } | 165 | 11.5k | } | 166 | | | 167 | 384 | accum = table[i + (WindowElements / 2)].dbl(); | 168 | 384 | } | 169 | | | 170 | 6 | return to_affine_batch<C>(table); | 171 | 6 | } |
pcurves_secp384r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp384r1::Curve::AffinePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp384r1::Curve::AffinePoint> > Botan::basemul_setup<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 5ul>(Botan::PCurve::(anonymous namespace)::secp384r1::Curve::AffinePoint const&, unsigned long) Line | Count | Source | 141 | 6 | std::vector<typename C::AffinePoint> basemul_setup(const typename C::AffinePoint& p, size_t max_scalar_bits) { | 142 | 6 | static_assert(WindowBits >= 1 && WindowBits <= 8); | 143 | | | 144 | | // 2^W elements, less the identity element | 145 | 6 | constexpr size_t WindowElements = (1 << WindowBits) - 1; | 146 | | | 147 | 6 | const size_t Windows = (max_scalar_bits + WindowBits - 1) / WindowBits; | 148 | | | 149 | 6 | const size_t TableSize = Windows * WindowElements; | 150 | | | 151 | 6 | std::vector<typename C::ProjectivePoint> table; | 152 | 6 | table.reserve(TableSize); | 153 | | | 154 | 6 | auto accum = C::ProjectivePoint::from_affine(p); | 155 | | | 156 | 624 | for(size_t i = 0; i != TableSize; i += WindowElements) { | 157 | 618 | table.push_back(accum); | 158 | | | 159 | 19.1k | for(size_t j = 1; j != WindowElements; ++j) { | 160 | 18.5k | if(j % 2 == 1) { | 161 | 9.27k | table.emplace_back(table[i + j / 2].dbl()); | 162 | 9.27k | } else { | 163 | 9.27k | table.emplace_back(table[i + j - 1] + table[i]); | 164 | 9.27k | } | 165 | 18.5k | } | 166 | | | 167 | 618 | accum = table[i + (WindowElements / 2)].dbl(); | 168 | 618 | } | 169 | | | 170 | 6 | return to_affine_batch<C>(table); | 171 | 6 | } |
pcurves_secp521r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp521r1::Curve::AffinePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp521r1::Curve::AffinePoint> > Botan::basemul_setup<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 5ul>(Botan::PCurve::(anonymous namespace)::secp521r1::Curve::AffinePoint const&, unsigned long) Line | Count | Source | 141 | 6 | std::vector<typename C::AffinePoint> basemul_setup(const typename C::AffinePoint& p, size_t max_scalar_bits) { | 142 | 6 | static_assert(WindowBits >= 1 && WindowBits <= 8); | 143 | | | 144 | | // 2^W elements, less the identity element | 145 | 6 | constexpr size_t WindowElements = (1 << WindowBits) - 1; | 146 | | | 147 | 6 | const size_t Windows = (max_scalar_bits + WindowBits - 1) / WindowBits; | 148 | | | 149 | 6 | const size_t TableSize = Windows * WindowElements; | 150 | | | 151 | 6 | std::vector<typename C::ProjectivePoint> table; | 152 | 6 | table.reserve(TableSize); | 153 | | | 154 | 6 | auto accum = C::ProjectivePoint::from_affine(p); | 155 | | | 156 | 786 | for(size_t i = 0; i != TableSize; i += WindowElements) { | 157 | 780 | table.push_back(accum); | 158 | | | 159 | 24.1k | for(size_t j = 1; j != WindowElements; ++j) { | 160 | 23.4k | if(j % 2 == 1) { | 161 | 11.7k | table.emplace_back(table[i + j / 2].dbl()); | 162 | 11.7k | } else { | 163 | 11.7k | table.emplace_back(table[i + j - 1] + table[i]); | 164 | 11.7k | } | 165 | 23.4k | } | 166 | | | 167 | 780 | accum = table[i + (WindowElements / 2)].dbl(); | 168 | 780 | } | 169 | | | 170 | 6 | return to_affine_batch<C>(table); | 171 | 6 | } |
Unexecuted instantiation: pcurves_sm2p256v1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::AffinePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::AffinePoint> > Botan::basemul_setup<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 5ul>(Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::AffinePoint const&, unsigned long) |
172 | | |
173 | | template <typename C, size_t WindowBits, typename BlindedScalar> |
174 | | typename C::ProjectivePoint basemul_exec(std::span<const typename C::AffinePoint> table, |
175 | | const BlindedScalar& scalar, |
176 | 13.3k | RandomNumberGenerator& rng) { |
177 | | // 2^W elements, less the identity element |
178 | 13.3k | static constexpr size_t WindowElements = (1 << WindowBits) - 1; |
179 | | |
180 | | // TODO: C++23 - use std::mdspan to access table? |
181 | | |
182 | 13.3k | auto accum = [&]() { |
183 | 13.3k | const size_t w_0 = scalar.get_window(0); |
184 | 13.3k | const auto tbl_0 = table.first(WindowElements); |
185 | 13.3k | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); |
186 | 13.3k | CT::poison(pt); |
187 | 13.3k | pt.randomize_rep(rng); |
188 | 13.3k | return pt; |
189 | 13.3k | }(); pcurves_brainpool256r1.cpp:Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 5ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Line | Count | Source | 182 | 2.94k | auto accum = [&]() { | 183 | 2.94k | const size_t w_0 = scalar.get_window(0); | 184 | 2.94k | const auto tbl_0 = table.first(WindowElements); | 185 | 2.94k | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 2.94k | CT::poison(pt); | 187 | 2.94k | pt.randomize_rep(rng); | 188 | 2.94k | return pt; | 189 | 2.94k | }(); |
pcurves_brainpool384r1.cpp:Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 5ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Line | Count | Source | 182 | 2.71k | auto accum = [&]() { | 183 | 2.71k | const size_t w_0 = scalar.get_window(0); | 184 | 2.71k | const auto tbl_0 = table.first(WindowElements); | 185 | 2.71k | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 2.71k | CT::poison(pt); | 187 | 2.71k | pt.randomize_rep(rng); | 188 | 2.71k | return pt; | 189 | 2.71k | }(); |
pcurves_brainpool512r1.cpp:Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 5ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Line | Count | Source | 182 | 2.40k | auto accum = [&]() { | 183 | 2.40k | const size_t w_0 = scalar.get_window(0); | 184 | 2.40k | const auto tbl_0 = table.first(WindowElements); | 185 | 2.40k | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 2.40k | CT::poison(pt); | 187 | 2.40k | pt.randomize_rep(rng); | 188 | 2.40k | return pt; | 189 | 2.40k | }(); |
Unexecuted instantiation: pcurves_frp256v1.cpp:Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::frp256v1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 5ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Botan::basemul_exec<Botan::PCurve::GenericCurve, 5ul, Botan::PCurve::GenericBlindedScalarBits>(std::__1::span<Botan::PCurve::GenericCurve::AffinePoint const, 18446744073709551615ul>, Botan::PCurve::GenericBlindedScalarBits const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Line | Count | Source | 182 | 12 | auto accum = [&]() { | 183 | 12 | const size_t w_0 = scalar.get_window(0); | 184 | 12 | const auto tbl_0 = table.first(WindowElements); | 185 | 12 | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 12 | CT::poison(pt); | 187 | 12 | pt.randomize_rep(rng); | 188 | 12 | return pt; | 189 | 12 | }(); |
Unexecuted instantiation: pcurves_numsp512d1.cpp:Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 5ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const pcurves_secp192r1.cpp:Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::secp192r1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 5ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Line | Count | Source | 182 | 5 | auto accum = [&]() { | 183 | 5 | const size_t w_0 = scalar.get_window(0); | 184 | 5 | const auto tbl_0 = table.first(WindowElements); | 185 | 5 | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 5 | CT::poison(pt); | 187 | 5 | pt.randomize_rep(rng); | 188 | 5 | return pt; | 189 | 5 | }(); |
pcurves_secp224r1.cpp:Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::secp224r1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 5ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Line | Count | Source | 182 | 7 | auto accum = [&]() { | 183 | 7 | const size_t w_0 = scalar.get_window(0); | 184 | 7 | const auto tbl_0 = table.first(WindowElements); | 185 | 7 | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 7 | CT::poison(pt); | 187 | 7 | pt.randomize_rep(rng); | 188 | 7 | return pt; | 189 | 7 | }(); |
pcurves_secp256k1.cpp:Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::secp256k1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 5ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Line | Count | Source | 182 | 9 | auto accum = [&]() { | 183 | 9 | const size_t w_0 = scalar.get_window(0); | 184 | 9 | const auto tbl_0 = table.first(WindowElements); | 185 | 9 | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 9 | CT::poison(pt); | 187 | 9 | pt.randomize_rep(rng); | 188 | 9 | return pt; | 189 | 9 | }(); |
pcurves_secp256r1.cpp:Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::secp256r1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 5ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Line | Count | Source | 182 | 1.47k | auto accum = [&]() { | 183 | 1.47k | const size_t w_0 = scalar.get_window(0); | 184 | 1.47k | const auto tbl_0 = table.first(WindowElements); | 185 | 1.47k | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 1.47k | CT::poison(pt); | 187 | 1.47k | pt.randomize_rep(rng); | 188 | 1.47k | return pt; | 189 | 1.47k | }(); |
pcurves_secp384r1.cpp:Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::secp384r1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 5ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Line | Count | Source | 182 | 1.79k | auto accum = [&]() { | 183 | 1.79k | const size_t w_0 = scalar.get_window(0); | 184 | 1.79k | const auto tbl_0 = table.first(WindowElements); | 185 | 1.79k | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 1.79k | CT::poison(pt); | 187 | 1.79k | pt.randomize_rep(rng); | 188 | 1.79k | return pt; | 189 | 1.79k | }(); |
pcurves_secp521r1.cpp:Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::secp521r1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 5ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Line | Count | Source | 182 | 2.00k | auto accum = [&]() { | 183 | 2.00k | const size_t w_0 = scalar.get_window(0); | 184 | 2.00k | const auto tbl_0 = table.first(WindowElements); | 185 | 2.00k | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 2.00k | CT::poison(pt); | 187 | 2.00k | pt.randomize_rep(rng); | 188 | 2.00k | return pt; | 189 | 2.00k | }(); |
Unexecuted instantiation: pcurves_sm2p256v1.cpp:Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 5ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const |
190 | | |
191 | 13.3k | const size_t windows = (scalar.bits() + WindowBits - 1) / WindowBits; |
192 | | |
193 | 1.31M | for(size_t i = 1; i != windows; ++i) { |
194 | 1.30M | const size_t w_i = scalar.get_window(WindowBits * i); |
195 | 1.30M | const auto tbl_i = table.subspan(WindowElements * i, WindowElements); |
196 | | |
197 | | /* |
198 | | None of these additions can be doublings, because in each iteration, the |
199 | | discrete logarithms of the points we're selecting out of the table are |
200 | | larger than the largest possible dlog of accum. |
201 | | */ |
202 | 1.30M | accum += C::AffinePoint::ct_select(tbl_i, w_i); |
203 | | |
204 | 1.30M | if(i <= 3) { |
205 | 40.1k | accum.randomize_rep(rng); |
206 | 40.1k | } |
207 | 1.30M | } |
208 | | |
209 | 13.3k | CT::unpoison(accum); |
210 | 13.3k | return accum; |
211 | 13.3k | } pcurves_brainpool256r1.cpp:Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::ProjectivePoint Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 5ul> const&, Botan::RandomNumberGenerator&) Line | Count | Source | 176 | 2.94k | RandomNumberGenerator& rng) { | 177 | | // 2^W elements, less the identity element | 178 | 2.94k | static constexpr size_t WindowElements = (1 << WindowBits) - 1; | 179 | | | 180 | | // TODO: C++23 - use std::mdspan to access table? | 181 | | | 182 | 2.94k | auto accum = [&]() { | 183 | 2.94k | const size_t w_0 = scalar.get_window(0); | 184 | 2.94k | const auto tbl_0 = table.first(WindowElements); | 185 | 2.94k | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 2.94k | CT::poison(pt); | 187 | 2.94k | pt.randomize_rep(rng); | 188 | 2.94k | return pt; | 189 | 2.94k | }(); | 190 | | | 191 | 2.94k | const size_t windows = (scalar.bits() + WindowBits - 1) / WindowBits; | 192 | | | 193 | 188k | for(size_t i = 1; i != windows; ++i) { | 194 | 185k | const size_t w_i = scalar.get_window(WindowBits * i); | 195 | 185k | const auto tbl_i = table.subspan(WindowElements * i, WindowElements); | 196 | | | 197 | | /* | 198 | | None of these additions can be doublings, because in each iteration, the | 199 | | discrete logarithms of the points we're selecting out of the table are | 200 | | larger than the largest possible dlog of accum. | 201 | | */ | 202 | 185k | accum += C::AffinePoint::ct_select(tbl_i, w_i); | 203 | | | 204 | 185k | if(i <= 3) { | 205 | 8.83k | accum.randomize_rep(rng); | 206 | 8.83k | } | 207 | 185k | } | 208 | | | 209 | 2.94k | CT::unpoison(accum); | 210 | 2.94k | return accum; | 211 | 2.94k | } |
pcurves_brainpool384r1.cpp:Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::ProjectivePoint Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 5ul> const&, Botan::RandomNumberGenerator&) Line | Count | Source | 176 | 2.71k | RandomNumberGenerator& rng) { | 177 | | // 2^W elements, less the identity element | 178 | 2.71k | static constexpr size_t WindowElements = (1 << WindowBits) - 1; | 179 | | | 180 | | // TODO: C++23 - use std::mdspan to access table? | 181 | | | 182 | 2.71k | auto accum = [&]() { | 183 | 2.71k | const size_t w_0 = scalar.get_window(0); | 184 | 2.71k | const auto tbl_0 = table.first(WindowElements); | 185 | 2.71k | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 2.71k | CT::poison(pt); | 187 | 2.71k | pt.randomize_rep(rng); | 188 | 2.71k | return pt; | 189 | 2.71k | }(); | 190 | | | 191 | 2.71k | const size_t windows = (scalar.bits() + WindowBits - 1) / WindowBits; | 192 | | | 193 | 280k | for(size_t i = 1; i != windows; ++i) { | 194 | 277k | const size_t w_i = scalar.get_window(WindowBits * i); | 195 | 277k | const auto tbl_i = table.subspan(WindowElements * i, WindowElements); | 196 | | | 197 | | /* | 198 | | None of these additions can be doublings, because in each iteration, the | 199 | | discrete logarithms of the points we're selecting out of the table are | 200 | | larger than the largest possible dlog of accum. | 201 | | */ | 202 | 277k | accum += C::AffinePoint::ct_select(tbl_i, w_i); | 203 | | | 204 | 277k | if(i <= 3) { | 205 | 8.15k | accum.randomize_rep(rng); | 206 | 8.15k | } | 207 | 277k | } | 208 | | | 209 | 2.71k | CT::unpoison(accum); | 210 | 2.71k | return accum; | 211 | 2.71k | } |
pcurves_brainpool512r1.cpp:Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::ProjectivePoint Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 5ul> const&, Botan::RandomNumberGenerator&) Line | Count | Source | 176 | 2.40k | RandomNumberGenerator& rng) { | 177 | | // 2^W elements, less the identity element | 178 | 2.40k | static constexpr size_t WindowElements = (1 << WindowBits) - 1; | 179 | | | 180 | | // TODO: C++23 - use std::mdspan to access table? | 181 | | | 182 | 2.40k | auto accum = [&]() { | 183 | 2.40k | const size_t w_0 = scalar.get_window(0); | 184 | 2.40k | const auto tbl_0 = table.first(WindowElements); | 185 | 2.40k | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 2.40k | CT::poison(pt); | 187 | 2.40k | pt.randomize_rep(rng); | 188 | 2.40k | return pt; | 189 | 2.40k | }(); | 190 | | | 191 | 2.40k | const size_t windows = (scalar.bits() + WindowBits - 1) / WindowBits; | 192 | | | 193 | 308k | for(size_t i = 1; i != windows; ++i) { | 194 | 305k | const size_t w_i = scalar.get_window(WindowBits * i); | 195 | 305k | const auto tbl_i = table.subspan(WindowElements * i, WindowElements); | 196 | | | 197 | | /* | 198 | | None of these additions can be doublings, because in each iteration, the | 199 | | discrete logarithms of the points we're selecting out of the table are | 200 | | larger than the largest possible dlog of accum. | 201 | | */ | 202 | 305k | accum += C::AffinePoint::ct_select(tbl_i, w_i); | 203 | | | 204 | 305k | if(i <= 3) { | 205 | 7.22k | accum.randomize_rep(rng); | 206 | 7.22k | } | 207 | 305k | } | 208 | | | 209 | 2.40k | CT::unpoison(accum); | 210 | 2.40k | return accum; | 211 | 2.40k | } |
Unexecuted instantiation: pcurves_frp256v1.cpp:Botan::PCurve::(anonymous namespace)::frp256v1::Curve::ProjectivePoint Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::frp256v1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 5ul> const&, Botan::RandomNumberGenerator&) Botan::PCurve::GenericCurve::ProjectivePoint Botan::basemul_exec<Botan::PCurve::GenericCurve, 5ul, Botan::PCurve::GenericBlindedScalarBits>(std::__1::span<Botan::PCurve::GenericCurve::AffinePoint const, 18446744073709551615ul>, Botan::PCurve::GenericBlindedScalarBits const&, Botan::RandomNumberGenerator&) Line | Count | Source | 176 | 12 | RandomNumberGenerator& rng) { | 177 | | // 2^W elements, less the identity element | 178 | 12 | static constexpr size_t WindowElements = (1 << WindowBits) - 1; | 179 | | | 180 | | // TODO: C++23 - use std::mdspan to access table? | 181 | | | 182 | 12 | auto accum = [&]() { | 183 | 12 | const size_t w_0 = scalar.get_window(0); | 184 | 12 | const auto tbl_0 = table.first(WindowElements); | 185 | 12 | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 12 | CT::poison(pt); | 187 | 12 | pt.randomize_rep(rng); | 188 | 12 | return pt; | 189 | 12 | }(); | 190 | | | 191 | 12 | const size_t windows = (scalar.bits() + WindowBits - 1) / WindowBits; | 192 | | | 193 | 717 | for(size_t i = 1; i != windows; ++i) { | 194 | 705 | const size_t w_i = scalar.get_window(WindowBits * i); | 195 | 705 | const auto tbl_i = table.subspan(WindowElements * i, WindowElements); | 196 | | | 197 | | /* | 198 | | None of these additions can be doublings, because in each iteration, the | 199 | | discrete logarithms of the points we're selecting out of the table are | 200 | | larger than the largest possible dlog of accum. | 201 | | */ | 202 | 705 | accum += C::AffinePoint::ct_select(tbl_i, w_i); | 203 | | | 204 | 705 | if(i <= 3) { | 205 | 36 | accum.randomize_rep(rng); | 206 | 36 | } | 207 | 705 | } | 208 | | | 209 | 12 | CT::unpoison(accum); | 210 | 12 | return accum; | 211 | 12 | } |
Unexecuted instantiation: pcurves_numsp512d1.cpp:Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::ProjectivePoint Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 5ul> const&, Botan::RandomNumberGenerator&) pcurves_secp192r1.cpp:Botan::PCurve::(anonymous namespace)::secp192r1::Curve::ProjectivePoint Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::secp192r1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 5ul> const&, Botan::RandomNumberGenerator&) Line | Count | Source | 176 | 5 | RandomNumberGenerator& rng) { | 177 | | // 2^W elements, less the identity element | 178 | 5 | static constexpr size_t WindowElements = (1 << WindowBits) - 1; | 179 | | | 180 | | // TODO: C++23 - use std::mdspan to access table? | 181 | | | 182 | 5 | auto accum = [&]() { | 183 | 5 | const size_t w_0 = scalar.get_window(0); | 184 | 5 | const auto tbl_0 = table.first(WindowElements); | 185 | 5 | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 5 | CT::poison(pt); | 187 | 5 | pt.randomize_rep(rng); | 188 | 5 | return pt; | 189 | 5 | }(); | 190 | | | 191 | 5 | const size_t windows = (scalar.bits() + WindowBits - 1) / WindowBits; | 192 | | | 193 | 260 | for(size_t i = 1; i != windows; ++i) { | 194 | 255 | const size_t w_i = scalar.get_window(WindowBits * i); | 195 | 255 | const auto tbl_i = table.subspan(WindowElements * i, WindowElements); | 196 | | | 197 | | /* | 198 | | None of these additions can be doublings, because in each iteration, the | 199 | | discrete logarithms of the points we're selecting out of the table are | 200 | | larger than the largest possible dlog of accum. | 201 | | */ | 202 | 255 | accum += C::AffinePoint::ct_select(tbl_i, w_i); | 203 | | | 204 | 255 | if(i <= 3) { | 205 | 15 | accum.randomize_rep(rng); | 206 | 15 | } | 207 | 255 | } | 208 | | | 209 | 5 | CT::unpoison(accum); | 210 | 5 | return accum; | 211 | 5 | } |
pcurves_secp224r1.cpp:Botan::PCurve::(anonymous namespace)::secp224r1::Curve::ProjectivePoint Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::secp224r1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 5ul> const&, Botan::RandomNumberGenerator&) Line | Count | Source | 176 | 7 | RandomNumberGenerator& rng) { | 177 | | // 2^W elements, less the identity element | 178 | 7 | static constexpr size_t WindowElements = (1 << WindowBits) - 1; | 179 | | | 180 | | // TODO: C++23 - use std::mdspan to access table? | 181 | | | 182 | 7 | auto accum = [&]() { | 183 | 7 | const size_t w_0 = scalar.get_window(0); | 184 | 7 | const auto tbl_0 = table.first(WindowElements); | 185 | 7 | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 7 | CT::poison(pt); | 187 | 7 | pt.randomize_rep(rng); | 188 | 7 | return pt; | 189 | 7 | }(); | 190 | | | 191 | 7 | const size_t windows = (scalar.bits() + WindowBits - 1) / WindowBits; | 192 | | | 193 | 406 | for(size_t i = 1; i != windows; ++i) { | 194 | 399 | const size_t w_i = scalar.get_window(WindowBits * i); | 195 | 399 | const auto tbl_i = table.subspan(WindowElements * i, WindowElements); | 196 | | | 197 | | /* | 198 | | None of these additions can be doublings, because in each iteration, the | 199 | | discrete logarithms of the points we're selecting out of the table are | 200 | | larger than the largest possible dlog of accum. | 201 | | */ | 202 | 399 | accum += C::AffinePoint::ct_select(tbl_i, w_i); | 203 | | | 204 | 399 | if(i <= 3) { | 205 | 21 | accum.randomize_rep(rng); | 206 | 21 | } | 207 | 399 | } | 208 | | | 209 | 7 | CT::unpoison(accum); | 210 | 7 | return accum; | 211 | 7 | } |
pcurves_secp256k1.cpp:Botan::PCurve::(anonymous namespace)::secp256k1::Curve::ProjectivePoint Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::secp256k1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 5ul> const&, Botan::RandomNumberGenerator&) Line | Count | Source | 176 | 9 | RandomNumberGenerator& rng) { | 177 | | // 2^W elements, less the identity element | 178 | 9 | static constexpr size_t WindowElements = (1 << WindowBits) - 1; | 179 | | | 180 | | // TODO: C++23 - use std::mdspan to access table? | 181 | | | 182 | 9 | auto accum = [&]() { | 183 | 9 | const size_t w_0 = scalar.get_window(0); | 184 | 9 | const auto tbl_0 = table.first(WindowElements); | 185 | 9 | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 9 | CT::poison(pt); | 187 | 9 | pt.randomize_rep(rng); | 188 | 9 | return pt; | 189 | 9 | }(); | 190 | | | 191 | 9 | const size_t windows = (scalar.bits() + WindowBits - 1) / WindowBits; | 192 | | | 193 | 576 | for(size_t i = 1; i != windows; ++i) { | 194 | 567 | const size_t w_i = scalar.get_window(WindowBits * i); | 195 | 567 | const auto tbl_i = table.subspan(WindowElements * i, WindowElements); | 196 | | | 197 | | /* | 198 | | None of these additions can be doublings, because in each iteration, the | 199 | | discrete logarithms of the points we're selecting out of the table are | 200 | | larger than the largest possible dlog of accum. | 201 | | */ | 202 | 567 | accum += C::AffinePoint::ct_select(tbl_i, w_i); | 203 | | | 204 | 567 | if(i <= 3) { | 205 | 27 | accum.randomize_rep(rng); | 206 | 27 | } | 207 | 567 | } | 208 | | | 209 | 9 | CT::unpoison(accum); | 210 | 9 | return accum; | 211 | 9 | } |
pcurves_secp256r1.cpp:Botan::PCurve::(anonymous namespace)::secp256r1::Curve::ProjectivePoint Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::secp256r1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 5ul> const&, Botan::RandomNumberGenerator&) Line | Count | Source | 176 | 1.47k | RandomNumberGenerator& rng) { | 177 | | // 2^W elements, less the identity element | 178 | 1.47k | static constexpr size_t WindowElements = (1 << WindowBits) - 1; | 179 | | | 180 | | // TODO: C++23 - use std::mdspan to access table? | 181 | | | 182 | 1.47k | auto accum = [&]() { | 183 | 1.47k | const size_t w_0 = scalar.get_window(0); | 184 | 1.47k | const auto tbl_0 = table.first(WindowElements); | 185 | 1.47k | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 1.47k | CT::poison(pt); | 187 | 1.47k | pt.randomize_rep(rng); | 188 | 1.47k | return pt; | 189 | 1.47k | }(); | 190 | | | 191 | 1.47k | const size_t windows = (scalar.bits() + WindowBits - 1) / WindowBits; | 192 | | | 193 | 94.5k | for(size_t i = 1; i != windows; ++i) { | 194 | 93.0k | const size_t w_i = scalar.get_window(WindowBits * i); | 195 | 93.0k | const auto tbl_i = table.subspan(WindowElements * i, WindowElements); | 196 | | | 197 | | /* | 198 | | None of these additions can be doublings, because in each iteration, the | 199 | | discrete logarithms of the points we're selecting out of the table are | 200 | | larger than the largest possible dlog of accum. | 201 | | */ | 202 | 93.0k | accum += C::AffinePoint::ct_select(tbl_i, w_i); | 203 | | | 204 | 93.0k | if(i <= 3) { | 205 | 4.43k | accum.randomize_rep(rng); | 206 | 4.43k | } | 207 | 93.0k | } | 208 | | | 209 | 1.47k | CT::unpoison(accum); | 210 | 1.47k | return accum; | 211 | 1.47k | } |
pcurves_secp384r1.cpp:Botan::PCurve::(anonymous namespace)::secp384r1::Curve::ProjectivePoint Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::secp384r1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 5ul> const&, Botan::RandomNumberGenerator&) Line | Count | Source | 176 | 1.79k | RandomNumberGenerator& rng) { | 177 | | // 2^W elements, less the identity element | 178 | 1.79k | static constexpr size_t WindowElements = (1 << WindowBits) - 1; | 179 | | | 180 | | // TODO: C++23 - use std::mdspan to access table? | 181 | | | 182 | 1.79k | auto accum = [&]() { | 183 | 1.79k | const size_t w_0 = scalar.get_window(0); | 184 | 1.79k | const auto tbl_0 = table.first(WindowElements); | 185 | 1.79k | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 1.79k | CT::poison(pt); | 187 | 1.79k | pt.randomize_rep(rng); | 188 | 1.79k | return pt; | 189 | 1.79k | }(); | 190 | | | 191 | 1.79k | const size_t windows = (scalar.bits() + WindowBits - 1) / WindowBits; | 192 | | | 193 | 185k | for(size_t i = 1; i != windows; ++i) { | 194 | 183k | const size_t w_i = scalar.get_window(WindowBits * i); | 195 | 183k | const auto tbl_i = table.subspan(WindowElements * i, WindowElements); | 196 | | | 197 | | /* | 198 | | None of these additions can be doublings, because in each iteration, the | 199 | | discrete logarithms of the points we're selecting out of the table are | 200 | | larger than the largest possible dlog of accum. | 201 | | */ | 202 | 183k | accum += C::AffinePoint::ct_select(tbl_i, w_i); | 203 | | | 204 | 183k | if(i <= 3) { | 205 | 5.39k | accum.randomize_rep(rng); | 206 | 5.39k | } | 207 | 183k | } | 208 | | | 209 | 1.79k | CT::unpoison(accum); | 210 | 1.79k | return accum; | 211 | 1.79k | } |
pcurves_secp521r1.cpp:Botan::PCurve::(anonymous namespace)::secp521r1::Curve::ProjectivePoint Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::secp521r1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 5ul> const&, Botan::RandomNumberGenerator&) Line | Count | Source | 176 | 2.00k | RandomNumberGenerator& rng) { | 177 | | // 2^W elements, less the identity element | 178 | 2.00k | static constexpr size_t WindowElements = (1 << WindowBits) - 1; | 179 | | | 180 | | // TODO: C++23 - use std::mdspan to access table? | 181 | | | 182 | 2.00k | auto accum = [&]() { | 183 | 2.00k | const size_t w_0 = scalar.get_window(0); | 184 | 2.00k | const auto tbl_0 = table.first(WindowElements); | 185 | 2.00k | auto pt = C::ProjectivePoint::from_affine(C::AffinePoint::ct_select(tbl_0, w_0)); | 186 | 2.00k | CT::poison(pt); | 187 | 2.00k | pt.randomize_rep(rng); | 188 | 2.00k | return pt; | 189 | 2.00k | }(); | 190 | | | 191 | 2.00k | const size_t windows = (scalar.bits() + WindowBits - 1) / WindowBits; | 192 | | | 193 | 260k | for(size_t i = 1; i != windows; ++i) { | 194 | 258k | const size_t w_i = scalar.get_window(WindowBits * i); | 195 | 258k | const auto tbl_i = table.subspan(WindowElements * i, WindowElements); | 196 | | | 197 | | /* | 198 | | None of these additions can be doublings, because in each iteration, the | 199 | | discrete logarithms of the points we're selecting out of the table are | 200 | | larger than the largest possible dlog of accum. | 201 | | */ | 202 | 258k | accum += C::AffinePoint::ct_select(tbl_i, w_i); | 203 | | | 204 | 258k | if(i <= 3) { | 205 | 6.00k | accum.randomize_rep(rng); | 206 | 6.00k | } | 207 | 258k | } | 208 | | | 209 | 2.00k | CT::unpoison(accum); | 210 | 2.00k | return accum; | 211 | 2.00k | } |
Unexecuted instantiation: pcurves_sm2p256v1.cpp:Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::ProjectivePoint Botan::basemul_exec<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 5ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 5ul> >(std::__1::span<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::AffinePoint const, 18446744073709551615ul>, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 5ul> const&, Botan::RandomNumberGenerator&) |
212 | | |
213 | | /* |
214 | | * Variable point table mul setup and online phase |
215 | | */ |
216 | | template <typename C, size_t TableSize> |
217 | 2.23k | AffinePointTable<C> varpoint_setup(const typename C::AffinePoint& p) { |
218 | 2.23k | static_assert(TableSize > 2); |
219 | | |
220 | 2.23k | std::vector<typename C::ProjectivePoint> table; |
221 | 2.23k | table.reserve(TableSize); |
222 | 2.23k | table.push_back(C::ProjectivePoint::from_affine(p)); |
223 | | |
224 | 35.7k | for(size_t i = 1; i != TableSize; ++i) { |
225 | 33.4k | if(i % 2 == 1) { |
226 | 17.8k | table.push_back(table[i / 2].dbl()); |
227 | 17.8k | } else { |
228 | 15.6k | table.push_back(table[i - 1] + p); |
229 | 15.6k | } |
230 | 33.4k | } |
231 | | |
232 | 2.23k | return AffinePointTable<C>(table); |
233 | 2.23k | } pcurves_brainpool256r1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 0ul> Botan::varpoint_setup<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 16ul>(Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::AffinePoint const&) Line | Count | Source | 217 | 1.48k | AffinePointTable<C> varpoint_setup(const typename C::AffinePoint& p) { | 218 | 1.48k | static_assert(TableSize > 2); | 219 | | | 220 | 1.48k | std::vector<typename C::ProjectivePoint> table; | 221 | 1.48k | table.reserve(TableSize); | 222 | 1.48k | table.push_back(C::ProjectivePoint::from_affine(p)); | 223 | | | 224 | 23.7k | for(size_t i = 1; i != TableSize; ++i) { | 225 | 22.2k | if(i % 2 == 1) { | 226 | 11.8k | table.push_back(table[i / 2].dbl()); | 227 | 11.8k | } else { | 228 | 10.3k | table.push_back(table[i - 1] + p); | 229 | 10.3k | } | 230 | 22.2k | } | 231 | | | 232 | 1.48k | return AffinePointTable<C>(table); | 233 | 1.48k | } |
pcurves_brainpool384r1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 0ul> Botan::varpoint_setup<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 16ul>(Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::AffinePoint const&) Line | Count | Source | 217 | 33 | AffinePointTable<C> varpoint_setup(const typename C::AffinePoint& p) { | 218 | 33 | static_assert(TableSize > 2); | 219 | | | 220 | 33 | std::vector<typename C::ProjectivePoint> table; | 221 | 33 | table.reserve(TableSize); | 222 | 33 | table.push_back(C::ProjectivePoint::from_affine(p)); | 223 | | | 224 | 528 | for(size_t i = 1; i != TableSize; ++i) { | 225 | 495 | if(i % 2 == 1) { | 226 | 264 | table.push_back(table[i / 2].dbl()); | 227 | 264 | } else { | 228 | 231 | table.push_back(table[i - 1] + p); | 229 | 231 | } | 230 | 495 | } | 231 | | | 232 | 33 | return AffinePointTable<C>(table); | 233 | 33 | } |
pcurves_brainpool512r1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 0ul> Botan::varpoint_setup<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 16ul>(Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::AffinePoint const&) Line | Count | Source | 217 | 36 | AffinePointTable<C> varpoint_setup(const typename C::AffinePoint& p) { | 218 | 36 | static_assert(TableSize > 2); | 219 | | | 220 | 36 | std::vector<typename C::ProjectivePoint> table; | 221 | 36 | table.reserve(TableSize); | 222 | 36 | table.push_back(C::ProjectivePoint::from_affine(p)); | 223 | | | 224 | 576 | for(size_t i = 1; i != TableSize; ++i) { | 225 | 540 | if(i % 2 == 1) { | 226 | 288 | table.push_back(table[i / 2].dbl()); | 227 | 288 | } else { | 228 | 252 | table.push_back(table[i - 1] + p); | 229 | 252 | } | 230 | 540 | } | 231 | | | 232 | 36 | return AffinePointTable<C>(table); | 233 | 36 | } |
Unexecuted instantiation: pcurves_frp256v1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 0ul> Botan::varpoint_setup<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 16ul>(Botan::PCurve::(anonymous namespace)::frp256v1::Curve::AffinePoint const&) Unexecuted instantiation: Botan::AffinePointTable<Botan::PCurve::GenericCurve, 0ul> Botan::varpoint_setup<Botan::PCurve::GenericCurve, 15ul>(Botan::PCurve::GenericCurve::AffinePoint const&) Unexecuted instantiation: pcurves_numsp512d1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 0ul> Botan::varpoint_setup<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 16ul>(Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_secp192r1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 0ul> Botan::varpoint_setup<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 16ul>(Botan::PCurve::(anonymous namespace)::secp192r1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_secp224r1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 0ul> Botan::varpoint_setup<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 16ul>(Botan::PCurve::(anonymous namespace)::secp224r1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_secp256k1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 0ul> Botan::varpoint_setup<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 16ul>(Botan::PCurve::(anonymous namespace)::secp256k1::Curve::AffinePoint const&) pcurves_secp256r1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 0ul> Botan::varpoint_setup<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 16ul>(Botan::PCurve::(anonymous namespace)::secp256r1::Curve::AffinePoint const&) Line | Count | Source | 217 | 369 | AffinePointTable<C> varpoint_setup(const typename C::AffinePoint& p) { | 218 | 369 | static_assert(TableSize > 2); | 219 | | | 220 | 369 | std::vector<typename C::ProjectivePoint> table; | 221 | 369 | table.reserve(TableSize); | 222 | 369 | table.push_back(C::ProjectivePoint::from_affine(p)); | 223 | | | 224 | 5.90k | for(size_t i = 1; i != TableSize; ++i) { | 225 | 5.53k | if(i % 2 == 1) { | 226 | 2.95k | table.push_back(table[i / 2].dbl()); | 227 | 2.95k | } else { | 228 | 2.58k | table.push_back(table[i - 1] + p); | 229 | 2.58k | } | 230 | 5.53k | } | 231 | | | 232 | 369 | return AffinePointTable<C>(table); | 233 | 369 | } |
pcurves_secp384r1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 0ul> Botan::varpoint_setup<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 16ul>(Botan::PCurve::(anonymous namespace)::secp384r1::Curve::AffinePoint const&) Line | Count | Source | 217 | 154 | AffinePointTable<C> varpoint_setup(const typename C::AffinePoint& p) { | 218 | 154 | static_assert(TableSize > 2); | 219 | | | 220 | 154 | std::vector<typename C::ProjectivePoint> table; | 221 | 154 | table.reserve(TableSize); | 222 | 154 | table.push_back(C::ProjectivePoint::from_affine(p)); | 223 | | | 224 | 2.46k | for(size_t i = 1; i != TableSize; ++i) { | 225 | 2.31k | if(i % 2 == 1) { | 226 | 1.23k | table.push_back(table[i / 2].dbl()); | 227 | 1.23k | } else { | 228 | 1.07k | table.push_back(table[i - 1] + p); | 229 | 1.07k | } | 230 | 2.31k | } | 231 | | | 232 | 154 | return AffinePointTable<C>(table); | 233 | 154 | } |
pcurves_secp521r1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 0ul> Botan::varpoint_setup<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 16ul>(Botan::PCurve::(anonymous namespace)::secp521r1::Curve::AffinePoint const&) Line | Count | Source | 217 | 155 | AffinePointTable<C> varpoint_setup(const typename C::AffinePoint& p) { | 218 | 155 | static_assert(TableSize > 2); | 219 | | | 220 | 155 | std::vector<typename C::ProjectivePoint> table; | 221 | 155 | table.reserve(TableSize); | 222 | 155 | table.push_back(C::ProjectivePoint::from_affine(p)); | 223 | | | 224 | 2.48k | for(size_t i = 1; i != TableSize; ++i) { | 225 | 2.32k | if(i % 2 == 1) { | 226 | 1.24k | table.push_back(table[i / 2].dbl()); | 227 | 1.24k | } else { | 228 | 1.08k | table.push_back(table[i - 1] + p); | 229 | 1.08k | } | 230 | 2.32k | } | 231 | | | 232 | 155 | return AffinePointTable<C>(table); | 233 | 155 | } |
Unexecuted instantiation: pcurves_sm2p256v1.cpp:Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 0ul> Botan::varpoint_setup<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 16ul>(Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::AffinePoint const&) |
234 | | |
235 | | template <typename C, size_t WindowBits, typename BlindedScalar> |
236 | | typename C::ProjectivePoint varpoint_exec(const AffinePointTable<C>& table, |
237 | | const BlindedScalar& scalar, |
238 | 0 | RandomNumberGenerator& rng) { |
239 | 0 | const size_t windows = (scalar.bits() + WindowBits - 1) / WindowBits; |
240 | |
|
241 | 0 | auto accum = [&]() { |
242 | 0 | const size_t w_0 = scalar.get_window((windows - 1) * WindowBits); |
243 | 0 | auto pt = C::ProjectivePoint::from_affine(table.ct_select(w_0)); |
244 | 0 | CT::poison(pt); |
245 | 0 | pt.randomize_rep(rng); |
246 | 0 | return pt; |
247 | 0 | }(); |
248 | |
|
249 | 0 | for(size_t i = 1; i != windows; ++i) { |
250 | 0 | accum = accum.dbl_n(WindowBits); |
251 | 0 | auto w_i = scalar.get_window((windows - i - 1) * WindowBits); |
252 | | |
253 | | /* |
254 | | This point addition cannot be a doubling (except once) |
255 | | |
256 | | Consider the sequence of points that are operated on, and specifically |
257 | | their discrete logarithms. We start out at the point at infinity |
258 | | (dlog 0) and then add the initial window which is precisely P*w_0 |
259 | | |
260 | | We then perform WindowBits doublings, so accum's dlog at the point |
261 | | of the addition in the first iteration of the loop (when i == 1) is |
262 | | at least 2^W * w_0. |
263 | | |
264 | | Since we know w_0 > 0, then in every iteration of the loop, accums |
265 | | dlog will always be greater than the dlog of the table element we |
266 | | just looked up (something between 0 and 2^W-1), and thus the |
267 | | addition into accum cannot be a doubling. |
268 | | |
269 | | However due to blinding this argument fails, since we perform |
270 | | multiplications using a scalar that is larger than the group |
271 | | order. In this case it's possible that the dlog of accum becomes |
272 | | `order + x` (or, effectively, `x`) and `x` is smaller than 2^W. |
273 | | In this case, a doubling may occur. Future iterations of the loop |
274 | | cannot be doublings by the same argument above. Since the blinding |
275 | | factor is always less than the group order (substantially so), |
276 | | it is not possible for the dlog of accum to overflow a second time. |
277 | | */ |
278 | |
|
279 | 0 | accum += table.ct_select(w_i); |
280 | |
|
281 | 0 | if(i <= 3) { |
282 | 0 | accum.randomize_rep(rng); |
283 | 0 | } |
284 | 0 | } |
285 | |
|
286 | 0 | CT::unpoison(accum); |
287 | 0 | return accum; |
288 | 0 | } |
289 | | |
290 | | /* |
291 | | * Effect 2-ary multiplication ie x*G + y*H |
292 | | * |
293 | | * This is done using a windowed variant of what is usually called |
294 | | * Shamir's trick. |
295 | | * |
296 | | * The W = 1 case is simple; we precompute an extra point GH = G + H, |
297 | | * and then examine 1 bit in each of x and y. If one or the other bits |
298 | | * are set then add G or H resp. If both bits are set, add GH. |
299 | | * |
300 | | * The example below is a precomputed table for W=2. The flattened table |
301 | | * begins at (x_i,y_i) = (1,0), i.e. the identity element is omitted. |
302 | | * The indices in each cell refer to the cell's location in m_table. |
303 | | * |
304 | | * x-> 0 1 2 3 |
305 | | * 0 |/ (ident) |0 x |1 2x |2 3x | |
306 | | * 1 |3 y |4 x+y |5 2x+y |6 3x+y | |
307 | | * y = 2 |7 2y |8 x+2y |9 2(x+y) |10 3x+2y | |
308 | | * 3 |11 3y |12 x+3y |13 2x+3y |14 3x+3y | |
309 | | */ |
310 | | |
311 | | template <typename C, size_t WindowBits> |
312 | | std::vector<typename C::ProjectivePoint> mul2_setup(const typename C::AffinePoint& p, |
313 | 730 | const typename C::AffinePoint& q) { |
314 | 730 | static_assert(WindowBits >= 1 && WindowBits <= 4); |
315 | | |
316 | | // 2^(2*W) elements, less the identity element |
317 | 730 | constexpr size_t TableSize = (1 << (2 * WindowBits)) - 1; |
318 | 730 | constexpr size_t WindowSize = (1 << WindowBits); |
319 | | |
320 | 730 | std::vector<typename C::ProjectivePoint> table; |
321 | 730 | table.reserve(TableSize); |
322 | | |
323 | 46.7k | for(size_t i = 0; i != TableSize; ++i) { |
324 | 45.9k | const size_t t_i = (i + 1); |
325 | 45.9k | const size_t p_i = t_i % WindowSize; |
326 | 45.9k | const size_t q_i = (t_i >> WindowBits) % WindowSize; |
327 | | |
328 | | // Returns x_i * x + y_i * y |
329 | 45.9k | auto next_tbl_e = [&]() { |
330 | 45.9k | if(p_i % 2 == 0 && q_i % 2 == 0) { |
331 | | // Where possible using doubling (eg indices 1, 7, 9 in |
332 | | // the table above) |
333 | 10.9k | return table[(t_i / 2) - 1].dbl(); |
334 | 35.0k | } else if(p_i > 0 && q_i > 0) { |
335 | | // A combination of p and q |
336 | 29.2k | if(p_i == 1) { |
337 | 5.11k | return p + table[(q_i << WindowBits) - 1]; |
338 | 24.0k | } else if(q_i == 1) { |
339 | 4.38k | return table[p_i - 1] + q; |
340 | 19.7k | } else { |
341 | 19.7k | return table[p_i - 1] + table[(q_i << WindowBits) - 1]; |
342 | 19.7k | } |
343 | 29.2k | } else if(p_i > 0 && q_i == 0) { |
344 | | // A multiple of p without a q component |
345 | 2.92k | if(p_i == 1) { |
346 | | // Just p |
347 | 730 | return C::ProjectivePoint::from_affine(p); |
348 | 2.19k | } else { |
349 | | // p * p_{i-1} |
350 | 2.19k | return p + table[p_i - 1 - 1]; |
351 | 2.19k | } |
352 | 2.92k | } else if(p_i == 0 && q_i > 0) { |
353 | 2.92k | if(q_i == 1) { |
354 | | // Just q |
355 | 730 | return C::ProjectivePoint::from_affine(q); |
356 | 2.19k | } else { |
357 | | // q * q_{i-1} |
358 | 2.19k | return q + table[((q_i - 1) << WindowBits) - 1]; |
359 | 2.19k | } |
360 | 2.92k | } else { |
361 | 0 | BOTAN_ASSERT_UNREACHABLE(); |
362 | 0 | } |
363 | 45.9k | }; Unexecuted instantiation: pcurves_brainpool256r1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_brainpool256r1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const pcurves_brainpool384r1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Line | Count | Source | 329 | 5.22k | auto next_tbl_e = [&]() { | 330 | 5.22k | if(p_i % 2 == 0 && q_i % 2 == 0) { | 331 | | // Where possible using doubling (eg indices 1, 7, 9 in | 332 | | // the table above) | 333 | 1.24k | return table[(t_i / 2) - 1].dbl(); | 334 | 3.98k | } else if(p_i > 0 && q_i > 0) { | 335 | | // A combination of p and q | 336 | 3.32k | if(p_i == 1) { | 337 | 581 | return p + table[(q_i << WindowBits) - 1]; | 338 | 2.73k | } else if(q_i == 1) { | 339 | 498 | return table[p_i - 1] + q; | 340 | 2.24k | } else { | 341 | 2.24k | return table[p_i - 1] + table[(q_i << WindowBits) - 1]; | 342 | 2.24k | } | 343 | 3.32k | } else if(p_i > 0 && q_i == 0) { | 344 | | // A multiple of p without a q component | 345 | 332 | if(p_i == 1) { | 346 | | // Just p | 347 | 83 | return C::ProjectivePoint::from_affine(p); | 348 | 249 | } else { | 349 | | // p * p_{i-1} | 350 | 249 | return p + table[p_i - 1 - 1]; | 351 | 249 | } | 352 | 332 | } else if(p_i == 0 && q_i > 0) { | 353 | 332 | if(q_i == 1) { | 354 | | // Just q | 355 | 83 | return C::ProjectivePoint::from_affine(q); | 356 | 249 | } else { | 357 | | // q * q_{i-1} | 358 | 249 | return q + table[((q_i - 1) << WindowBits) - 1]; | 359 | 249 | } | 360 | 332 | } else { | 361 | 0 | BOTAN_ASSERT_UNREACHABLE(); | 362 | 0 | } | 363 | 5.22k | }; |
Unexecuted instantiation: pcurves_brainpool384r1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_brainpool512r1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_brainpool512r1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_frp256v1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::frp256v1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::frp256v1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_frp256v1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::frp256v1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::frp256v1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Botan::mul2_setup<Botan::PCurve::GenericCurve, 3ul>(Botan::PCurve::GenericCurve::AffinePoint const&, Botan::PCurve::GenericCurve::AffinePoint const&)::{lambda()#1}::operator()() const Line | Count | Source | 329 | 13.1k | auto next_tbl_e = [&]() { | 330 | 13.1k | if(p_i % 2 == 0 && q_i % 2 == 0) { | 331 | | // Where possible using doubling (eg indices 1, 7, 9 in | 332 | | // the table above) | 333 | 3.13k | return table[(t_i / 2) - 1].dbl(); | 334 | 10.0k | } else if(p_i > 0 && q_i > 0) { | 335 | | // A combination of p and q | 336 | 8.36k | if(p_i == 1) { | 337 | 1.46k | return p + table[(q_i << WindowBits) - 1]; | 338 | 6.89k | } else if(q_i == 1) { | 339 | 1.25k | return table[p_i - 1] + q; | 340 | 5.64k | } else { | 341 | 5.64k | return table[p_i - 1] + table[(q_i << WindowBits) - 1]; | 342 | 5.64k | } | 343 | 8.36k | } else if(p_i > 0 && q_i == 0) { | 344 | | // A multiple of p without a q component | 345 | 836 | if(p_i == 1) { | 346 | | // Just p | 347 | 209 | return C::ProjectivePoint::from_affine(p); | 348 | 627 | } else { | 349 | | // p * p_{i-1} | 350 | 627 | return p + table[p_i - 1 - 1]; | 351 | 627 | } | 352 | 836 | } else if(p_i == 0 && q_i > 0) { | 353 | 836 | if(q_i == 1) { | 354 | | // Just q | 355 | 209 | return C::ProjectivePoint::from_affine(q); | 356 | 627 | } else { | 357 | | // q * q_{i-1} | 358 | 627 | return q + table[((q_i - 1) << WindowBits) - 1]; | 359 | 627 | } | 360 | 836 | } else { | 361 | 0 | BOTAN_ASSERT_UNREACHABLE(); | 362 | 0 | } | 363 | 13.1k | }; |
Unexecuted instantiation: pcurves_numsp512d1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_numsp512d1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_secp192r1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::secp192r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp192r1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_secp192r1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::secp192r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp192r1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_secp224r1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::secp224r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp224r1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_secp224r1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::secp224r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp224r1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_secp256k1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::secp256k1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp256k1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_secp256k1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::secp256k1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp256k1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_secp256r1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::secp256r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp256r1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_secp256r1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::secp256r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp256r1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const pcurves_secp384r1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::secp384r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp384r1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Line | Count | Source | 329 | 10.2k | auto next_tbl_e = [&]() { | 330 | 10.2k | if(p_i % 2 == 0 && q_i % 2 == 0) { | 331 | | // Where possible using doubling (eg indices 1, 7, 9 in | 332 | | // the table above) | 333 | 2.43k | return table[(t_i / 2) - 1].dbl(); | 334 | 7.77k | } else if(p_i > 0 && q_i > 0) { | 335 | | // A combination of p and q | 336 | 6.48k | if(p_i == 1) { | 337 | 1.13k | return p + table[(q_i << WindowBits) - 1]; | 338 | 5.34k | } else if(q_i == 1) { | 339 | 972 | return table[p_i - 1] + q; | 340 | 4.37k | } else { | 341 | 4.37k | return table[p_i - 1] + table[(q_i << WindowBits) - 1]; | 342 | 4.37k | } | 343 | 6.48k | } else if(p_i > 0 && q_i == 0) { | 344 | | // A multiple of p without a q component | 345 | 648 | if(p_i == 1) { | 346 | | // Just p | 347 | 162 | return C::ProjectivePoint::from_affine(p); | 348 | 486 | } else { | 349 | | // p * p_{i-1} | 350 | 486 | return p + table[p_i - 1 - 1]; | 351 | 486 | } | 352 | 648 | } else if(p_i == 0 && q_i > 0) { | 353 | 648 | if(q_i == 1) { | 354 | | // Just q | 355 | 162 | return C::ProjectivePoint::from_affine(q); | 356 | 486 | } else { | 357 | | // q * q_{i-1} | 358 | 486 | return q + table[((q_i - 1) << WindowBits) - 1]; | 359 | 486 | } | 360 | 648 | } else { | 361 | 0 | BOTAN_ASSERT_UNREACHABLE(); | 362 | 0 | } | 363 | 10.2k | }; |
Unexecuted instantiation: pcurves_secp384r1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::secp384r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp384r1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const pcurves_secp521r1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::secp521r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp521r1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Line | Count | Source | 329 | 17.3k | auto next_tbl_e = [&]() { | 330 | 17.3k | if(p_i % 2 == 0 && q_i % 2 == 0) { | 331 | | // Where possible using doubling (eg indices 1, 7, 9 in | 332 | | // the table above) | 333 | 4.14k | return table[(t_i / 2) - 1].dbl(); | 334 | 13.2k | } else if(p_i > 0 && q_i > 0) { | 335 | | // A combination of p and q | 336 | 11.0k | if(p_i == 1) { | 337 | 1.93k | return p + table[(q_i << WindowBits) - 1]; | 338 | 9.10k | } else if(q_i == 1) { | 339 | 1.65k | return table[p_i - 1] + q; | 340 | 7.45k | } else { | 341 | 7.45k | return table[p_i - 1] + table[(q_i << WindowBits) - 1]; | 342 | 7.45k | } | 343 | 11.0k | } else if(p_i > 0 && q_i == 0) { | 344 | | // A multiple of p without a q component | 345 | 1.10k | if(p_i == 1) { | 346 | | // Just p | 347 | 276 | return C::ProjectivePoint::from_affine(p); | 348 | 828 | } else { | 349 | | // p * p_{i-1} | 350 | 828 | return p + table[p_i - 1 - 1]; | 351 | 828 | } | 352 | 1.10k | } else if(p_i == 0 && q_i > 0) { | 353 | 1.10k | if(q_i == 1) { | 354 | | // Just q | 355 | 276 | return C::ProjectivePoint::from_affine(q); | 356 | 828 | } else { | 357 | | // q * q_{i-1} | 358 | 828 | return q + table[((q_i - 1) << WindowBits) - 1]; | 359 | 828 | } | 360 | 1.10k | } else { | 361 | 0 | BOTAN_ASSERT_UNREACHABLE(); | 362 | 0 | } | 363 | 17.3k | }; |
Unexecuted instantiation: pcurves_secp521r1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::secp521r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp521r1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_sm2p256v1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_sm2p256v1.cpp:Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::AffinePoint const&)::{lambda()#1}::operator()() const |
364 | | |
365 | 45.9k | table.emplace_back(next_tbl_e()); |
366 | 45.9k | } |
367 | | |
368 | 730 | return table; |
369 | 730 | } Unexecuted instantiation: pcurves_brainpool256r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_brainpool256r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::AffinePoint const&) pcurves_brainpool384r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::AffinePoint const&) Line | Count | Source | 313 | 83 | const typename C::AffinePoint& q) { | 314 | 83 | static_assert(WindowBits >= 1 && WindowBits <= 4); | 315 | | | 316 | | // 2^(2*W) elements, less the identity element | 317 | 83 | constexpr size_t TableSize = (1 << (2 * WindowBits)) - 1; | 318 | 83 | constexpr size_t WindowSize = (1 << WindowBits); | 319 | | | 320 | 83 | std::vector<typename C::ProjectivePoint> table; | 321 | 83 | table.reserve(TableSize); | 322 | | | 323 | 5.31k | for(size_t i = 0; i != TableSize; ++i) { | 324 | 5.22k | const size_t t_i = (i + 1); | 325 | 5.22k | const size_t p_i = t_i % WindowSize; | 326 | 5.22k | const size_t q_i = (t_i >> WindowBits) % WindowSize; | 327 | | | 328 | | // Returns x_i * x + y_i * y | 329 | 5.22k | auto next_tbl_e = [&]() { | 330 | 5.22k | if(p_i % 2 == 0 && q_i % 2 == 0) { | 331 | | // Where possible using doubling (eg indices 1, 7, 9 in | 332 | | // the table above) | 333 | 5.22k | return table[(t_i / 2) - 1].dbl(); | 334 | 5.22k | } else if(p_i > 0 && q_i > 0) { | 335 | | // A combination of p and q | 336 | 5.22k | if(p_i == 1) { | 337 | 5.22k | return p + table[(q_i << WindowBits) - 1]; | 338 | 5.22k | } else if(q_i == 1) { | 339 | 5.22k | return table[p_i - 1] + q; | 340 | 5.22k | } else { | 341 | 5.22k | return table[p_i - 1] + table[(q_i << WindowBits) - 1]; | 342 | 5.22k | } | 343 | 5.22k | } else if(p_i > 0 && q_i == 0) { | 344 | | // A multiple of p without a q component | 345 | 5.22k | if(p_i == 1) { | 346 | | // Just p | 347 | 5.22k | return C::ProjectivePoint::from_affine(p); | 348 | 5.22k | } else { | 349 | | // p * p_{i-1} | 350 | 5.22k | return p + table[p_i - 1 - 1]; | 351 | 5.22k | } | 352 | 5.22k | } else if(p_i == 0 && q_i > 0) { | 353 | 5.22k | if(q_i == 1) { | 354 | | // Just q | 355 | 5.22k | return C::ProjectivePoint::from_affine(q); | 356 | 5.22k | } else { | 357 | | // q * q_{i-1} | 358 | 5.22k | return q + table[((q_i - 1) << WindowBits) - 1]; | 359 | 5.22k | } | 360 | 5.22k | } else { | 361 | 5.22k | BOTAN_ASSERT_UNREACHABLE(); | 362 | 5.22k | } | 363 | 5.22k | }; | 364 | | | 365 | 5.22k | table.emplace_back(next_tbl_e()); | 366 | 5.22k | } | 367 | | | 368 | 83 | return table; | 369 | 83 | } |
Unexecuted instantiation: pcurves_brainpool384r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_brainpool512r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_brainpool512r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_frp256v1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::frp256v1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::frp256v1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::frp256v1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::frp256v1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_frp256v1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::frp256v1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::frp256v1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::frp256v1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::frp256v1::Curve::AffinePoint const&) std::__1::vector<Botan::PCurve::GenericCurve::ProjectivePoint, std::__1::allocator<Botan::PCurve::GenericCurve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::GenericCurve, 3ul>(Botan::PCurve::GenericCurve::AffinePoint const&, Botan::PCurve::GenericCurve::AffinePoint const&) Line | Count | Source | 313 | 209 | const typename C::AffinePoint& q) { | 314 | 209 | static_assert(WindowBits >= 1 && WindowBits <= 4); | 315 | | | 316 | | // 2^(2*W) elements, less the identity element | 317 | 209 | constexpr size_t TableSize = (1 << (2 * WindowBits)) - 1; | 318 | 209 | constexpr size_t WindowSize = (1 << WindowBits); | 319 | | | 320 | 209 | std::vector<typename C::ProjectivePoint> table; | 321 | 209 | table.reserve(TableSize); | 322 | | | 323 | 13.3k | for(size_t i = 0; i != TableSize; ++i) { | 324 | 13.1k | const size_t t_i = (i + 1); | 325 | 13.1k | const size_t p_i = t_i % WindowSize; | 326 | 13.1k | const size_t q_i = (t_i >> WindowBits) % WindowSize; | 327 | | | 328 | | // Returns x_i * x + y_i * y | 329 | 13.1k | auto next_tbl_e = [&]() { | 330 | 13.1k | if(p_i % 2 == 0 && q_i % 2 == 0) { | 331 | | // Where possible using doubling (eg indices 1, 7, 9 in | 332 | | // the table above) | 333 | 13.1k | return table[(t_i / 2) - 1].dbl(); | 334 | 13.1k | } else if(p_i > 0 && q_i > 0) { | 335 | | // A combination of p and q | 336 | 13.1k | if(p_i == 1) { | 337 | 13.1k | return p + table[(q_i << WindowBits) - 1]; | 338 | 13.1k | } else if(q_i == 1) { | 339 | 13.1k | return table[p_i - 1] + q; | 340 | 13.1k | } else { | 341 | 13.1k | return table[p_i - 1] + table[(q_i << WindowBits) - 1]; | 342 | 13.1k | } | 343 | 13.1k | } else if(p_i > 0 && q_i == 0) { | 344 | | // A multiple of p without a q component | 345 | 13.1k | if(p_i == 1) { | 346 | | // Just p | 347 | 13.1k | return C::ProjectivePoint::from_affine(p); | 348 | 13.1k | } else { | 349 | | // p * p_{i-1} | 350 | 13.1k | return p + table[p_i - 1 - 1]; | 351 | 13.1k | } | 352 | 13.1k | } else if(p_i == 0 && q_i > 0) { | 353 | 13.1k | if(q_i == 1) { | 354 | | // Just q | 355 | 13.1k | return C::ProjectivePoint::from_affine(q); | 356 | 13.1k | } else { | 357 | | // q * q_{i-1} | 358 | 13.1k | return q + table[((q_i - 1) << WindowBits) - 1]; | 359 | 13.1k | } | 360 | 13.1k | } else { | 361 | 13.1k | BOTAN_ASSERT_UNREACHABLE(); | 362 | 13.1k | } | 363 | 13.1k | }; | 364 | | | 365 | 13.1k | table.emplace_back(next_tbl_e()); | 366 | 13.1k | } | 367 | | | 368 | 209 | return table; | 369 | 209 | } |
Unexecuted instantiation: pcurves_numsp512d1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_numsp512d1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_secp192r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp192r1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp192r1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::secp192r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp192r1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_secp192r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp192r1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp192r1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::secp192r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp192r1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_secp224r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp224r1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp224r1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::secp224r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp224r1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_secp224r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp224r1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp224r1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::secp224r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp224r1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_secp256k1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp256k1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp256k1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::secp256k1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp256k1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_secp256k1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp256k1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp256k1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::secp256k1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp256k1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_secp256r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp256r1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp256r1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::secp256r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp256r1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_secp256r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp256r1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp256r1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::secp256r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp256r1::Curve::AffinePoint const&) pcurves_secp384r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp384r1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp384r1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::secp384r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp384r1::Curve::AffinePoint const&) Line | Count | Source | 313 | 162 | const typename C::AffinePoint& q) { | 314 | 162 | static_assert(WindowBits >= 1 && WindowBits <= 4); | 315 | | | 316 | | // 2^(2*W) elements, less the identity element | 317 | 162 | constexpr size_t TableSize = (1 << (2 * WindowBits)) - 1; | 318 | 162 | constexpr size_t WindowSize = (1 << WindowBits); | 319 | | | 320 | 162 | std::vector<typename C::ProjectivePoint> table; | 321 | 162 | table.reserve(TableSize); | 322 | | | 323 | 10.3k | for(size_t i = 0; i != TableSize; ++i) { | 324 | 10.2k | const size_t t_i = (i + 1); | 325 | 10.2k | const size_t p_i = t_i % WindowSize; | 326 | 10.2k | const size_t q_i = (t_i >> WindowBits) % WindowSize; | 327 | | | 328 | | // Returns x_i * x + y_i * y | 329 | 10.2k | auto next_tbl_e = [&]() { | 330 | 10.2k | if(p_i % 2 == 0 && q_i % 2 == 0) { | 331 | | // Where possible using doubling (eg indices 1, 7, 9 in | 332 | | // the table above) | 333 | 10.2k | return table[(t_i / 2) - 1].dbl(); | 334 | 10.2k | } else if(p_i > 0 && q_i > 0) { | 335 | | // A combination of p and q | 336 | 10.2k | if(p_i == 1) { | 337 | 10.2k | return p + table[(q_i << WindowBits) - 1]; | 338 | 10.2k | } else if(q_i == 1) { | 339 | 10.2k | return table[p_i - 1] + q; | 340 | 10.2k | } else { | 341 | 10.2k | return table[p_i - 1] + table[(q_i << WindowBits) - 1]; | 342 | 10.2k | } | 343 | 10.2k | } else if(p_i > 0 && q_i == 0) { | 344 | | // A multiple of p without a q component | 345 | 10.2k | if(p_i == 1) { | 346 | | // Just p | 347 | 10.2k | return C::ProjectivePoint::from_affine(p); | 348 | 10.2k | } else { | 349 | | // p * p_{i-1} | 350 | 10.2k | return p + table[p_i - 1 - 1]; | 351 | 10.2k | } | 352 | 10.2k | } else if(p_i == 0 && q_i > 0) { | 353 | 10.2k | if(q_i == 1) { | 354 | | // Just q | 355 | 10.2k | return C::ProjectivePoint::from_affine(q); | 356 | 10.2k | } else { | 357 | | // q * q_{i-1} | 358 | 10.2k | return q + table[((q_i - 1) << WindowBits) - 1]; | 359 | 10.2k | } | 360 | 10.2k | } else { | 361 | 10.2k | BOTAN_ASSERT_UNREACHABLE(); | 362 | 10.2k | } | 363 | 10.2k | }; | 364 | | | 365 | 10.2k | table.emplace_back(next_tbl_e()); | 366 | 10.2k | } | 367 | | | 368 | 162 | return table; | 369 | 162 | } |
Unexecuted instantiation: pcurves_secp384r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp384r1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp384r1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::secp384r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp384r1::Curve::AffinePoint const&) pcurves_secp521r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp521r1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp521r1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::secp521r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp521r1::Curve::AffinePoint const&) Line | Count | Source | 313 | 276 | const typename C::AffinePoint& q) { | 314 | 276 | static_assert(WindowBits >= 1 && WindowBits <= 4); | 315 | | | 316 | | // 2^(2*W) elements, less the identity element | 317 | 276 | constexpr size_t TableSize = (1 << (2 * WindowBits)) - 1; | 318 | 276 | constexpr size_t WindowSize = (1 << WindowBits); | 319 | | | 320 | 276 | std::vector<typename C::ProjectivePoint> table; | 321 | 276 | table.reserve(TableSize); | 322 | | | 323 | 17.6k | for(size_t i = 0; i != TableSize; ++i) { | 324 | 17.3k | const size_t t_i = (i + 1); | 325 | 17.3k | const size_t p_i = t_i % WindowSize; | 326 | 17.3k | const size_t q_i = (t_i >> WindowBits) % WindowSize; | 327 | | | 328 | | // Returns x_i * x + y_i * y | 329 | 17.3k | auto next_tbl_e = [&]() { | 330 | 17.3k | if(p_i % 2 == 0 && q_i % 2 == 0) { | 331 | | // Where possible using doubling (eg indices 1, 7, 9 in | 332 | | // the table above) | 333 | 17.3k | return table[(t_i / 2) - 1].dbl(); | 334 | 17.3k | } else if(p_i > 0 && q_i > 0) { | 335 | | // A combination of p and q | 336 | 17.3k | if(p_i == 1) { | 337 | 17.3k | return p + table[(q_i << WindowBits) - 1]; | 338 | 17.3k | } else if(q_i == 1) { | 339 | 17.3k | return table[p_i - 1] + q; | 340 | 17.3k | } else { | 341 | 17.3k | return table[p_i - 1] + table[(q_i << WindowBits) - 1]; | 342 | 17.3k | } | 343 | 17.3k | } else if(p_i > 0 && q_i == 0) { | 344 | | // A multiple of p without a q component | 345 | 17.3k | if(p_i == 1) { | 346 | | // Just p | 347 | 17.3k | return C::ProjectivePoint::from_affine(p); | 348 | 17.3k | } else { | 349 | | // p * p_{i-1} | 350 | 17.3k | return p + table[p_i - 1 - 1]; | 351 | 17.3k | } | 352 | 17.3k | } else if(p_i == 0 && q_i > 0) { | 353 | 17.3k | if(q_i == 1) { | 354 | | // Just q | 355 | 17.3k | return C::ProjectivePoint::from_affine(q); | 356 | 17.3k | } else { | 357 | | // q * q_{i-1} | 358 | 17.3k | return q + table[((q_i - 1) << WindowBits) - 1]; | 359 | 17.3k | } | 360 | 17.3k | } else { | 361 | 17.3k | BOTAN_ASSERT_UNREACHABLE(); | 362 | 17.3k | } | 363 | 17.3k | }; | 364 | | | 365 | 17.3k | table.emplace_back(next_tbl_e()); | 366 | 17.3k | } | 367 | | | 368 | 276 | return table; | 369 | 276 | } |
Unexecuted instantiation: pcurves_secp521r1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::secp521r1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::secp521r1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::secp521r1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::secp521r1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_sm2p256v1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 3ul>(Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::AffinePoint const&) Unexecuted instantiation: pcurves_sm2p256v1.cpp:std::__1::vector<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::ProjectivePoint, std::__1::allocator<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::ProjectivePoint> > Botan::mul2_setup<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 2ul>(Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::AffinePoint const&, Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::AffinePoint const&) |
370 | | |
371 | | template <typename C, size_t WindowBits, typename BlindedScalar> |
372 | | typename C::ProjectivePoint mul2_exec(const AffinePointTable<C>& table, |
373 | | const BlindedScalar& x, |
374 | | const BlindedScalar& y, |
375 | 0 | RandomNumberGenerator& rng) { |
376 | 0 | const size_t Windows = (x.bits() + WindowBits - 1) / WindowBits; |
377 | |
|
378 | 0 | auto accum = [&]() { |
379 | 0 | const size_t w_1 = x.get_window((Windows - 1) * WindowBits); |
380 | 0 | const size_t w_2 = y.get_window((Windows - 1) * WindowBits); |
381 | 0 | const size_t window = w_1 + (w_2 << WindowBits); |
382 | 0 | auto pt = C::ProjectivePoint::from_affine(table.ct_select(window)); |
383 | 0 | CT::poison(pt); |
384 | 0 | pt.randomize_rep(rng); |
385 | 0 | return pt; |
386 | 0 | }(); Unexecuted instantiation: pcurves_brainpool256r1.cpp:Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 2ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_brainpool384r1.cpp:Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 2ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_brainpool512r1.cpp:Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 2ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_frp256v1.cpp:Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 2ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Unexecuted instantiation: Botan::mul2_exec<Botan::PCurve::GenericCurve, 3ul, Botan::PCurve::GenericBlindedScalarBits>(Botan::AffinePointTable<Botan::PCurve::GenericCurve, 0ul> const&, Botan::PCurve::GenericBlindedScalarBits const&, Botan::PCurve::GenericBlindedScalarBits const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_numsp512d1.cpp:Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 2ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_secp192r1.cpp:Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 2ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_secp224r1.cpp:Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 2ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_secp256k1.cpp:Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 2ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_secp256r1.cpp:Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 2ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_secp384r1.cpp:Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 2ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_secp521r1.cpp:Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 2ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const Unexecuted instantiation: pcurves_sm2p256v1.cpp:Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 2ul> const&, Botan::RandomNumberGenerator&)::{lambda()#1}::operator()() const |
387 | |
|
388 | 0 | for(size_t i = 1; i != Windows; ++i) { |
389 | 0 | accum = accum.dbl_n(WindowBits); |
390 | |
|
391 | 0 | const size_t w_1 = x.get_window((Windows - i - 1) * WindowBits); |
392 | 0 | const size_t w_2 = y.get_window((Windows - i - 1) * WindowBits); |
393 | 0 | const size_t window = w_1 + (w_2 << WindowBits); |
394 | 0 | accum += table.ct_select(window); |
395 | |
|
396 | 0 | if(i <= 3) { |
397 | 0 | accum.randomize_rep(rng); |
398 | 0 | } |
399 | 0 | } |
400 | |
|
401 | 0 | CT::unpoison(accum); |
402 | 0 | return accum; |
403 | 0 | } Unexecuted instantiation: pcurves_brainpool256r1.cpp:Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve::ProjectivePoint Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool256r1::Curve, 2ul> const&, Botan::RandomNumberGenerator&) Unexecuted instantiation: pcurves_brainpool384r1.cpp:Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve::ProjectivePoint Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool384r1::Curve, 2ul> const&, Botan::RandomNumberGenerator&) Unexecuted instantiation: pcurves_brainpool512r1.cpp:Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve::ProjectivePoint Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::brainpool512r1::Curve, 2ul> const&, Botan::RandomNumberGenerator&) Unexecuted instantiation: pcurves_frp256v1.cpp:Botan::PCurve::(anonymous namespace)::frp256v1::Curve::ProjectivePoint Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::frp256v1::Curve, 2ul> const&, Botan::RandomNumberGenerator&) Unexecuted instantiation: Botan::PCurve::GenericCurve::ProjectivePoint Botan::mul2_exec<Botan::PCurve::GenericCurve, 3ul, Botan::PCurve::GenericBlindedScalarBits>(Botan::AffinePointTable<Botan::PCurve::GenericCurve, 0ul> const&, Botan::PCurve::GenericBlindedScalarBits const&, Botan::PCurve::GenericBlindedScalarBits const&, Botan::RandomNumberGenerator&) Unexecuted instantiation: pcurves_numsp512d1.cpp:Botan::PCurve::(anonymous namespace)::numsp512d1::Curve::ProjectivePoint Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::numsp512d1::Curve, 2ul> const&, Botan::RandomNumberGenerator&) Unexecuted instantiation: pcurves_secp192r1.cpp:Botan::PCurve::(anonymous namespace)::secp192r1::Curve::ProjectivePoint Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp192r1::Curve, 2ul> const&, Botan::RandomNumberGenerator&) Unexecuted instantiation: pcurves_secp224r1.cpp:Botan::PCurve::(anonymous namespace)::secp224r1::Curve::ProjectivePoint Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp224r1::Curve, 2ul> const&, Botan::RandomNumberGenerator&) Unexecuted instantiation: pcurves_secp256k1.cpp:Botan::PCurve::(anonymous namespace)::secp256k1::Curve::ProjectivePoint Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256k1::Curve, 2ul> const&, Botan::RandomNumberGenerator&) Unexecuted instantiation: pcurves_secp256r1.cpp:Botan::PCurve::(anonymous namespace)::secp256r1::Curve::ProjectivePoint Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp256r1::Curve, 2ul> const&, Botan::RandomNumberGenerator&) Unexecuted instantiation: pcurves_secp384r1.cpp:Botan::PCurve::(anonymous namespace)::secp384r1::Curve::ProjectivePoint Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp384r1::Curve, 2ul> const&, Botan::RandomNumberGenerator&) Unexecuted instantiation: pcurves_secp521r1.cpp:Botan::PCurve::(anonymous namespace)::secp521r1::Curve::ProjectivePoint Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::secp521r1::Curve, 2ul> const&, Botan::RandomNumberGenerator&) Unexecuted instantiation: pcurves_sm2p256v1.cpp:Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve::ProjectivePoint Botan::mul2_exec<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 2ul, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 2ul> >(Botan::AffinePointTable<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 0ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 2ul> const&, Botan::(anonymous namespace)::BlindedScalarBits<Botan::PCurve::(anonymous namespace)::sm2p256v1::Curve, 2ul> const&, Botan::RandomNumberGenerator&) |
404 | | |
405 | | } // namespace Botan |
406 | | |
407 | | #endif |