EdDSA
EdDSA
Library for verifying EdDSA signatures on the Ed25519 curve
Implements signature verification and point decompression for EdDSA
Methods
verify
function verify(bytes memory message, bytes memory signature, bytes32 pubkey) public returns (bool)
Verifies an EdDSA signature against a message and public key
Decompresses the public key, converts to Weierstrass form, and verifies using EIP-6565
Parameters
Name | Type | Description |
---|---|---|
message | bytes memory | The message that was signed |
signature | bytes memory | The signature to verify, encoded as (r,s) coordinates |
pubkey | bytes32 | The compressed public key to verify against |
Returns
Name | Type | Description |
---|---|---|
bool | bool True if the signature is valid, false otherwise |
edDecompress
function edDecompress(
uint256 KPubC
) public returns (uint256 x, uint256 y)
Decompresses an Ed25519 public key from its compressed form
If computed x doesn't match the sign bit, negates x mod p
Parameters
Name | Type | Description |
---|---|---|
KPubC | uint256 | The compressed public key point in Edwards form, with sign bit in MSB |
Returns
Name | Type | Description |
---|---|---|
x | uint256 | x The x-coordinate of the decompressed point on Edwards curve |
y | uint256 | y The y-coordinate of the decompressed point on Edwards curve |