embassy-crypto

Crates

git

Versions

default

Flavors

Skip to main content

Module p256

Module p256 

Source
Expand description

NIST P-256 (secp256r1, prime256v1).

Three groups of types, each served by its own driver:

§Example

use embassy_crypto::p256::{SecretKey, PublicKey};

let mine = SecretKey::generate()?;
let peer = PublicKey::from_sec1(&peer_bytes)?;
let shared = mine.diffie_hellman(&peer)?;
// feed shared.as_bytes() to a KDF

Structs§

Point
A point on the curve, the point at infinity included.
PublicKey
An ECDH public key: a point on the curve.
Scalar
A scalar: an integer modulo the curve order n.
SecretKey
An ECDH private key: a nonzero scalar.
SharedSecret
An ECDH shared secret: the X coordinate of the shared point.
Signature
An ECDSA signature (r, s).
SigningKey
An ECDSA signing key: a nonzero scalar.
VerifyingKey
An ECDSA verifying key: a point on the curve.

Constants§

FIELD_SIZE
Size of a field element, scalar and coordinate, in bytes.
ORDER
The curve order n, big-endian.