Skip to content

Commit

Permalink
gcc fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
suyash67 committed Apr 20, 2023
1 parent 2472c1d commit 15bc608
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cpp/src/barretenberg/crypto/ecdsa/ecdsa_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ signature construct_signature(const std::string& message, const key_pair<Fr, G1>
bool is_r_finite = (uint256_t(r_fq) == uint256_t(r_fr));
bool y_parity = uint256_t(R.y).get_bit(0);
constexpr uint8_t offset = 27;
sig.v = offset + y_parity + static_cast<uint8_t>(2) * !is_r_finite;

int value = offset + y_parity + static_cast<uint8_t>(2) * !is_r_finite;
ASSERT(value <= UINT8_MAX);
sig.v = static_cast<uint8_t>(value);
return sig;
}

Expand Down

0 comments on commit 15bc608

Please sign in to comment.