diff --git a/Cargo.lock b/Cargo.lock index b2ddf688..d2ec03bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -790,6 +790,7 @@ version = "0.13.0" dependencies = [ "elliptic-curve", "primeorder", + "sha2", ] [[package]] diff --git a/p521/Cargo.toml b/p521/Cargo.toml index f80160e8..5b2a2dea 100644 --- a/p521/Cargo.toml +++ b/p521/Cargo.toml @@ -17,6 +17,7 @@ rust-version = "1.65" [dependencies] elliptic-curve = { version = "0.13", default-features = false, features = ["hazmat", "sec1"] } +sha2 = { version = "0.10", optional = true, default-features = false } # optional dependencies primeorder = { version = "0.13.1", optional = true, path = "../primeorder" } @@ -30,6 +31,7 @@ jwk = ["elliptic-curve/jwk"] pem = ["elliptic-curve/pem", "pkcs8"] pkcs8 = ["elliptic-curve/pkcs8"] wip-arithmetic-do-not-use = ["dep:primeorder"] +voprf = ["elliptic-curve/voprf", "dep:sha2"] [package.metadata.docs.rs] all-features = true diff --git a/p521/src/lib.rs b/p521/src/lib.rs index dc9859b2..fb127ca7 100644 --- a/p521/src/lib.rs +++ b/p521/src/lib.rs @@ -78,3 +78,12 @@ impl FieldBytesEncoding for U576 {} /// NIST P-521 secret key. pub type SecretKey = elliptic_curve::SecretKey; + +#[cfg(feature = "voprf")] +impl elliptic_curve::VoprfParameters for NistP521 { + /// See . + const ID: &'static str = "P521-SHA512"; + + /// See . + type Hash = sha2::Sha512; +}