dpp_crypto/jws/algorithm.rs
1//! JOSE algorithm constants and allowlist for DPP signatures.
2
3/// JOSE algorithm identifier for Ed25519/EdDSA (RFC 8037 §2).
4pub const EDDSA_ALG: &str = "EdDSA";
5
6/// JWK curve name for Ed25519 (RFC 8037 §2).
7pub const ED25519_CRV: &str = "Ed25519";
8
9/// The single allowed signing algorithm for all DPP credentials and passport proofs.
10///
11/// Pinned at compile time so a future algorithm addition requires a deliberate
12/// change here plus a corresponding bump of the `algorithm` field in `KeyRecord`.
13/// Rejects `alg:none` and all substitution attacks by exhaustive allowlist.
14#[inline]
15pub fn is_allowed_alg(alg: &str) -> bool {
16 alg == EDDSA_ALG
17}