Skip to content

crypto.ecdsa: fix handling sign with custom_hash - #23619

Merged
spytheman merged 1 commit into
vlang:masterfrom
blackshirt:fix-custom-hash
Jan 31, 2025
Merged

spytheman merged 1 commit into
vlang:masterfrom
blackshirt:fix-custom-hash

Conversation

@blackshirt

@blackshirt blackshirt commented Jan 31, 2025 •

Copy link
Copy Markdown
Contributor

This small PR following previously already merged PR in fix-no-hash commit.
The current handling with custom hash was still contains some bogus thing without additional test (sorry, its my bad).
Its resolved in the current PR, by the way with:

  • call .reset() on the custom hash before writing messages
  • previously, its not call .write() before .sum() ..its does not matching to expected result, when compared, for examples digest produced with sha256.sum256(message) directly. The equivalent of sum(message) was
_ := custom_hash.write(message)!
digest := custom_hash.sum([]u8{})
  • Add some test to verify expected behaviour

Thanks ...

@huly-for-github

Copy link
Copy Markdown

Connected to Huly®: V_0.6-22043

@spytheman
spytheman merged commit e4d1011 into vlang:master Jan 31, 2025
@blackshirt
blackshirt deleted the fix-custom-hash branch February 3, 2025 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants