Ed25519¶
How to use the crypto_condor.primitives.ed25519
module to test
implementations of Ed25519.
Test signing¶
- crypto_condor.primitives.ed25519.test_sign(sign, compliance=True, resilience=True)¶
Tests a function that generates signatures with Ed25519.
Calls the sign function on valid keys and messages to generate signatures. The signatures are compared to the test vector values. The test passes if all signatures are correct.
- Parameters:
- Returns:
An instance of
ResultsDict
, with oneResults
per test vectors file used.- Return type:
Test verifying¶
- crypto_condor.primitives.ed25519.test_verify(verify, compliance=True, resilience=True)¶
Tests a function that verifies Ed25519 signatures.
Calls the verify function to verify Ed25519 signatures. Keys and messages are valid values. There are valid and invalid signatures: the test passes if the implementation correctly verifies all valid signatures and rejects all invalid signatures.
- Parameters:
- Returns:
An instance of
ResultsDict
, with oneResults
per test vectors file used.- Return type:
Protocols¶
- protocol crypto_condor.primitives.ed25519.Sign¶
Represents a function that signs with Ed25519.
Classes that implement this protocol must have the following methods / attributes:
- __call__(sk, msg)¶
Signs a message with Ed25519.
- Parameters:
sk (bytes) – The raw private key.
msg (bytes) – The message to sign.
- Returns:
The Ed25519 signature.
- Return type:
bytes
- protocol crypto_condor.primitives.ed25519.Verify¶
Represents a function that verifies Ed25519 signatures.
Classes that implement this protocol must have the following methods / attributes:
- __call__(pk, msg, sig)¶
Verifies an Ed25519 signature.
- Parameters:
pk (bytes) – The raw 32-byte public key.
msg (bytes) – The data that was signed.
sig (bytes) – The signature to verify.
- Returns:
True if the signature is valid, False otherwise.
- Return type:
bool