An ECDSA key pair.

Fields

public_key: PublicKey,

Public part.

secret_key: SecretKey,

Secret scalar.

Functions

fn create(seed: ?[seed_length]u8) IdentityElementError!KeyPair

Create a new key pair. The seed must be secret and indistinguishable from random…

Create a new key pair. The seed must be secret and indistinguishable from random. The seed can also be left to null in order to generate a random key pair.

fn fromSecretKey(secret_key: SecretKey) IdentityElementError!KeyPair

Return the public key corresponding to the secret key.

fn sign(key_pair: KeyPair, msg: []const u8, noise: ?[noise_length]u8) IdentityElementError || NonCanonicalError!Signature

Sign a message using the key pair. The noise can be null in order to create det…

Sign a message using the key pair. The noise can be null in order to create deterministic signatures. If deterministic signatures are not required, the noise should be randomly generated instead. This helps defend against fault attacks.

fn signer(key_pair: KeyPair, noise: ?[noise_length]u8) !Signer

Create a Signer, that can be used for incremental signature verification.

Values

seed_length
undefined

Length (in bytes) of a seed required to create a key pair.