Feat/ed25519-verify - #7196
Conversation
Coverage Report for CI Build 26640098042Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage increased (+0.03%) to 85.993%Details
Uncovered Changes
Coverage Regressions6369 previously-covered lines in 96 files lost coverage.
Coverage Stats
💛 - Coveralls |
|
I was updating the Clarity 6 SIP draft (stacksgov/sips#267) with this function, and noticed that example you use in the PR description and docs is invalid:
You can see for yourself here: https://cyphr.me/ed25519_tool/ed.html We should make sure this example fails in the unit tests, and we should use the official test vectors from RFC 8032 (link) in our docs instead, and make sure we have them as part of our unit tests |
|
@jbencin-stacks examples updated and added a test for all of the rfc-provided vectors (i added more tests for non-conforming cases too) |
|
@brice-stacks refactored to use NativeFunction205. Note that i moved the buff_to_array32 to mod.rs and make it generic ( |
9debe2f
into
stacks-network:pox-wf-integration
|
Closed PR has been locked after 14 days of inactivity. |
Description
This patch adds the ed25519-verify clarity function as well as an infrastructure for ed25519 curves.
It expects "(buff 1024), (buff 64), (buff 32)" and returns bool (if the signature is verified)
The message buffer can be between 0 and 1024 bytes.
The signature is 64 bytes.
The public key is 32 bytes.
Cost has been profiled to 7880 units and veries very little based on the size of the message (can be between 0 and 1024) so probably it could be kept as fixed and not linear as soon as the clarity6 costs table is pushed.
Applicable issues
Additional info (benefits, drawbacks, caveats)
Checklist
docs/property-testing.md)changelog.d/README.md)rpc/openapi.yamlfor RPC endpoints,event-dispatcher.mdfor new events)clarity-benchmarkingrepo