Skip to main content

pakery_spake2plus/
ciphersuite.rs

1//! SPAKE2+ ciphersuite trait.
2
3use pakery_core::crypto::{CpaceGroup, Hash, Kdf, Mac};
4
5/// Defines a SPAKE2+ ciphersuite: group, hash, KDF, MAC, and protocol constants.
6pub trait Spake2PlusCiphersuite: Sized + 'static {
7    /// The prime-order group used for the protocol.
8    type Group: CpaceGroup;
9    /// The hash function used for transcript hashing.
10    type Hash: Hash;
11    /// The key derivation function.
12    type Kdf: Kdf;
13    /// The message authentication code.
14    type Mac: Mac;
15
16    /// Hash output length in bytes (e.g. 64 for SHA-512).
17    const NH: usize;
18    /// Pre-computed M point (compressed).
19    const M_BYTES: &'static [u8];
20    /// Pre-computed N point (compressed).
21    const N_BYTES: &'static [u8];
22}