Skip to content

Commit

Permalink
Fix bug in ECDSA signing.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkskeller committed Apr 9, 2024
1 parent 74baee3 commit 1771535
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ECDSA/sign.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ inline P256Element::Scalar hash_to_scalar(const unsigned char* message, size_t l
assert(res.size() == crypto_hash_sha256_BYTES);
crypto_hash_sha256((unsigned char*) res.get_ptr(), message, length);
size_t size = crypto_hash_sha256_BYTES;
char* ptr = (char*) res.get_ptr();
for(size_t i = 0; i < size / 2; i++) {
swap(ptr[i], ptr[size - 1 - i]);
}
Expand Down

0 comments on commit 1771535

Please sign in to comment.