std.crypto.sign.ecdsa
The entries of std.crypto.sign.ecdsa in the Zig reference. This page has 47 cards.
pub fn Ecdsa(comptime C: type, comptime H: type) type
Elliptic Curve Digital Signature Algorithm (ECDSA).
- Kind
- type function
- Module
std.crypto.sign.ecdsa
- Kind
- type
- Module
std.crypto.sign.ecdsa
- Kind
- type
- Module
std.crypto.sign.ecdsa
An ECDSA key pair.
- Kind
- struct
- Module
std.crypto.sign.ecdsa
pub fn fromSecretKey(secret_key: SecretKey) IdentityElementError!KeyPair
Return the public key corresponding to the secret key.
- Kind
- function
- Module
std.crypto.sign.ecdsa
pub fn generate(io: std.Io) KeyPair
Generate a new, random key pair.
- Kind
- function
- Module
std.crypto.sign.ecdsa
pub fn generateDeterministic(seed: [seed_length]u8) IdentityElementError!KeyPair
Deterministically derive a key pair from a cryptograpically secure secret seed.
- Kind
- function
- Module
std.crypto.sign.ecdsa
Length (in bytes) of a seed required to create a key pair.
- Kind
- constant
- Module
std.crypto.sign.ecdsa
pub fn sign(key_pair: KeyPair, msg: []const u8, noise: ?[noise_length]u8) (IdentityElementError || NonCanonicalError)!Signature
Sign a message using the key pair.
- Kind
- function
- Module
std.crypto.sign.ecdsa
pub fn signer(key_pair: KeyPair, noise: ?[noise_length]u8) !Signer
Create a Signer, that can be used for incremental signature verification.
- Kind
- function
- Module
std.crypto.sign.ecdsa
pub fn signPrehashed(key_pair: KeyPair, msg_hash: [Hash.digest_length]u8, noise: ?[noise_length]u8) (IdentityElementError || NonCanonicalError)!Signature
Sign a pre-hashed message using the key pair.
- Kind
- function
- Module
std.crypto.sign.ecdsa
Length (in bytes) of optional random bytes, for non-deterministic signatures.
- Kind
- constant
- Module
std.crypto.sign.ecdsa
An ECDSA public key.
- Kind
- struct
- Module
std.crypto.sign.ecdsa
Length (in bytes) of a compressed sec1-encoded key.
- Kind
- constant
- Module
std.crypto.sign.ecdsa
pub fn fromSec1(sec1: []const u8) !PublicKey
Create a public key from a SEC-1 representation.
- Kind
- function
- Module
std.crypto.sign.ecdsa
pub fn toCompressedSec1(pk: PublicKey) [compressed_sec1_encoded_length]u8
Encode the public key using the compressed SEC-1 format.
- Kind
- function
- Module
std.crypto.sign.ecdsa
pub fn toUncompressedSec1(pk: PublicKey) [uncompressed_sec1_encoded_length]u8
Encoding the public key using the uncompressed SEC-1 format.
- Kind
- function
- Module
std.crypto.sign.ecdsa
Length (in bytes) of an uncompressed sec1-encoded key.
- Kind
- constant
- Module
std.crypto.sign.ecdsa
An ECDSA secret key.
- Kind
- struct
- Module
std.crypto.sign.ecdsa
Length (in bytes) of a raw secret key.
- Kind
- constant
- Module
std.crypto.sign.ecdsa
pub fn fromBytes(bytes: [encoded_length]u8) !SecretKey
- Kind
- function
- Module
std.crypto.sign.ecdsa
pub fn toBytes(sk: SecretKey) [encoded_length]u8
- Kind
- function
- Module
std.crypto.sign.ecdsa
An ECDSA signature.
- Kind
- struct
- Module
std.crypto.sign.ecdsa
Maximum length (in bytes) of a DER-encoded signature.
- Kind
- constant
- Module
std.crypto.sign.ecdsa
Length (in bytes) of a raw signature.
- Kind
- constant
- Module
std.crypto.sign.ecdsa
pub fn fromBytes(bytes: [encoded_length]u8) Signature
Create a signature from a raw encoding of (r, s).
- Kind
- function
- Module
std.crypto.sign.ecdsa
pub fn fromDer(der: []const u8) EncodingError!Signature
Create a signature from a DER representation.
- Kind
- function
- Module
std.crypto.sign.ecdsa
pub fn toBytes(sig: Signature) [encoded_length]u8
Return the raw signature (r, s) in big-endian format.
- Kind
- function
- Module
std.crypto.sign.ecdsa
pub fn toDer(sig: Signature, buf: *[der_encoded_length_max]u8) []u8
Encode the signature using the DER format.
- Kind
- function
- Module
std.crypto.sign.ecdsa
pub fn verifier(sig: Signature, public_key: PublicKey) Verifier.InitError!Verifier
Create a Verifier for incremental verification of a signature.
- Kind
- function
- Module
std.crypto.sign.ecdsa
pub fn verify(sig: Signature, msg: []const u8, public_key: PublicKey) VerifyError!void
Verify the signature against a message and public key.
- Kind
- function
- Module
std.crypto.sign.ecdsa
- Kind
- type
- Module
std.crypto.sign.ecdsa
pub fn verifyPrehashed(sig: Signature, msg_hash: [Hash.digest_length]u8, public_key: PublicKey) VerifyError!void
Verify the signature against a pre-hashed message and public key.
- Kind
- function
- Module
std.crypto.sign.ecdsa
A Signer is used to incrementally compute a signature.
- Kind
- struct
- Module
std.crypto.sign.ecdsa
pub fn finalize(self: *Signer) (IdentityElementError || NonCanonicalError)!Signature
Compute a signature over the entire message.
- Kind
- function
- Module
std.crypto.sign.ecdsa
pub fn update(self: *Signer, data: []const u8) void
Add new data to the message being signed.
- Kind
- function
- Module
std.crypto.sign.ecdsa
A Verifier is used to incrementally verify a signature.
- Kind
- struct
- Module
std.crypto.sign.ecdsa
- Kind
- type
- Module
std.crypto.sign.ecdsa
pub fn update(self: *Verifier, data: []const u8) void
Add new content to the message to be verified.
- Kind
- function
- Module
std.crypto.sign.ecdsa
pub fn verify(self: *Verifier) VerifyError!void
Verify that the signature is valid for the entire message.
- Kind
- function
- Module
std.crypto.sign.ecdsa
- Kind
- type
- Module
std.crypto.sign.ecdsa
ECDSA over P-256 with SHA3-256.
- Kind
- type
- Module
std.crypto.sign.ecdsa
ECDSA over P-256 with SHA-256.
- Kind
- type
- Module
std.crypto.sign.ecdsa
ECDSA over P-384 with SHA3-384.
- Kind
- type
- Module
std.crypto.sign.ecdsa
ECDSA over P-384 with SHA-384.
- Kind
- type
- Module
std.crypto.sign.ecdsa
ECDSA over Secp256k1 with SHA-256.
- Kind
- type
- Module
std.crypto.sign.ecdsa
ECDSA over Secp256k1 with SHA-256(SHA-256()) -- The Bitcoin signature system.
- Kind
- type
- Module
std.crypto.sign.ecdsa