[][src]Crate ecdsa

Elliptic Curve Digital Signature Algorithm (ECDSA) as specified in FIPS 186-4 (Digital Signature Standard)

This crate doesn't contain an implementation of ECDSA itself, but instead contains Asn1Signature and FixedSignature types which are generic over elliptic Curve types (e.g. NistP256, NistP384, Secp256k1) which can be used in conjunction with the signature::Signer and signature::Verifier traits to provide signature types which are reusable across multiple signing and verification provider crates.

Transcoding between Asn1Signature and FixedSignature of the same Curve type is supported in the form of simple From impls.

Additionally, the PublicKey and SecretKey types, also generic over elliptic curve types, provide reusable key types, sourced from the elliptic-curve crate. The PublicKey type supports both compressed and uncompressed points, and for the P-256 curve in particular supports converting between the compressed and uncompressed forms.

These traits allow crates which produce and consume ECDSA signatures to be written abstractly in such a way that different signer/verifier providers can be plugged in, enabling support for using different ECDSA implementations, including HSMs or Cloud KMS services.

TODO

  • NIST P-521
  • Brainpool
  • Const generics(!)

Re-exports

pub use generic_array;
pub use signature;
pub use self::asn1_signature::Asn1Signature;
pub use self::fixed_signature::FixedSignature;

Modules

asn1_signature

ASN.1 DER-encoded ECDSA signatures

curve

Elliptic curves (short Weierstrass form) used by ECDSA

fixed_signature

Fixed-sized (a.k.a. "raw") ECDSA signatures

test_vectors

ECDSA test vectors

Structs

SecretKey

Secret keys for Weierstrass curves: wrapper around scalar values used as secret keys.

Enums

PublicKey

Public keys for Weierstrass curves

Traits

Curve

Elliptic curve in short Weierstrass form