From 127abd437d2426d3aeeb0dd7a31b291cf0a19fcb Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Mon, 8 Apr 2024 07:57:35 -0400 Subject: [PATCH] Small fixes --- src/lib/pubkey/pcurves/pcurves.h | 2 +- src/lib/pubkey/pcurves/pcurves_id.cpp | 2 ++ src/lib/pubkey/pcurves/pcurves_impl.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/pubkey/pcurves/pcurves.h b/src/lib/pubkey/pcurves/pcurves.h index bdada9ebd64..539a6617a43 100644 --- a/src/lib/pubkey/pcurves/pcurves.h +++ b/src/lib/pubkey/pcurves/pcurves.h @@ -24,7 +24,7 @@ namespace Botan::PCurve { /// Identifier for a named prime order curve class PrimeOrderCurveId { public: - enum class Id { + enum class Id : uint8_t { /// secp256r1 aka P-256 secp256r1, /// secp384r1 aka P-384 diff --git a/src/lib/pubkey/pcurves/pcurves_id.cpp b/src/lib/pubkey/pcurves/pcurves_id.cpp index 415ddc5d6dc..2060b81329b 100644 --- a/src/lib/pubkey/pcurves/pcurves_id.cpp +++ b/src/lib/pubkey/pcurves/pcurves_id.cpp @@ -46,6 +46,8 @@ std::string PrimeOrderCurveId::to_string() const { case PrimeOrderCurveId::secp256k1: return "secp256k1"; } + + return "unknown"; } } // namespace Botan::PCurve diff --git a/src/lib/pubkey/pcurves/pcurves_impl.h b/src/lib/pubkey/pcurves/pcurves_impl.h index bdcd9c566c6..6e1b110811c 100644 --- a/src/lib/pubkey/pcurves/pcurves_impl.h +++ b/src/lib/pubkey/pcurves/pcurves_impl.h @@ -689,7 +689,7 @@ class PrecomputedMulTable { auto accum = ProjectivePoint::identity(); for(size_t i = 0; i != Scalar::BITS; ++i) { - const size_t b = 8*Scalar::BYTES - i - 1; + const size_t b = 8 * Scalar::BYTES - i - 1; const bool b_set = (bits[b / 8] >> (7 - b % 8)) & 1; accum.conditional_add(b_set, m_table[i]); }