Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
randombit committed Apr 8, 2024
1 parent 24f5033 commit 127abd4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/pubkey/pcurves/pcurves.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/lib/pubkey/pcurves/pcurves_id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ std::string PrimeOrderCurveId::to_string() const {
case PrimeOrderCurveId::secp256k1:
return "secp256k1";
}

return "unknown";
}

} // namespace Botan::PCurve
2 changes: 1 addition & 1 deletion src/lib/pubkey/pcurves/pcurves_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down

0 comments on commit 127abd4

Please sign in to comment.