Skip to content

Commit

Permalink
Tweaks to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
codygunton committed May 3, 2023
1 parent aeb8794 commit c628211
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpp/src/barretenberg/stdlib/encryption/ecdsa/ecdsa_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ bool_t<Composer> verify_signature(const stdlib::byte_array<Composer>& message,
{
Composer* ctx = message.get_context() ? message.get_context() : public_key.x.context;

// Check if revovery id v is either 27 ot 28.
// Check if recovery id v is either 27 ot 28.
// TODO(Suyash): check with Zac/Kesha/Cody.
// TODO(Cody): Where is the meaning of this assert_is_in_set documented?
field_t<Composer>(sig.v).assert_is_in_set({ field_t<Composer>(27), field_t<Composer>(28) },
"signature is non-standard");

Expand Down
2 changes: 2 additions & 0 deletions cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ template <typename Composer, typename T> class bigfield {
field_t<Composer> lo = binary_basis_limbs[0].element + (binary_basis_limbs[1].element * shift_1);
field_t<Composer> hi = binary_basis_limbs[2].element + (binary_basis_limbs[3].element * shift_1);
// n.b. this only works if NUM_LIMB_BITS * 2 is divisible by 8
// TODO(Cody): Double check this! The assert used to be:
// ASSERT((NUM_LIMB_BITS / 8) * 8 == NUM_LIMB_BITS);
ASSERT((NUM_LIMB_BITS * 2 / 8) * 8 == NUM_LIMB_BITS * 2);
result.write(byte_array<Composer>(hi, 32 - (NUM_LIMB_BITS / 4)));
result.write(byte_array<Composer>(lo, (NUM_LIMB_BITS / 4)));
Expand Down

0 comments on commit c628211

Please sign in to comment.