Concrete cryptographic implementations for the pakery PAKE workspace.
This crate provides implementations of the traits defined in pakery-core, backed by well-known cryptographic libraries. Select the primitives you need via feature flags.
[dependencies]
pakery-crypto = { version = "0.1", features = ["ristretto255"] }| Type | Implements |
|---|---|
Ristretto255Group |
CpaceGroup |
Ristretto255Dh |
DhGroup |
Ristretto255Oprf |
Oprf |
Sha512Hash |
Hash |
HkdfSha512 |
Kdf |
HmacSha512 |
Mac |
SPAKE2_M_COMPRESSED |
SPAKE2 M constant |
SPAKE2_N_COMPRESSED |
SPAKE2 N constant |
| Type | Implements |
|---|---|
P256Group |
CpaceGroup |
P256Dh |
DhGroup |
P256Oprf |
Oprf |
Sha256Hash |
Hash |
HkdfSha256 |
Kdf |
HmacSha256 |
Mac |
SPAKE2_P256_M_COMPRESSED |
SPAKE2 M constant (P-256) |
SPAKE2_P256_N_COMPRESSED |
SPAKE2 N constant (P-256) |
| Type | Implements |
|---|---|
Argon2idKsf |
Ksf |
use pakery_cpace::CpaceCiphersuite;
use pakery_crypto::{Ristretto255Group, Sha512Hash};
struct MyCpaceSuite;
impl CpaceCiphersuite for MyCpaceSuite {
type Group = Ristretto255Group;
type Hash = Sha512Hash;
const DSI: &'static [u8] = b"CPaceRistretto255";
const HASH_BLOCK_SIZE: usize = 128;
const FIELD_SIZE_BYTES: usize = 32;
}| Feature | Description |
|---|---|
std (default) |
Enable std support |
ristretto255 (default) |
Ristretto255 / SHA-512 primitives |
p256 |
P-256 / SHA-256 primitives |
argon2 |
Argon2id key-stretching function |
getrandom |
Enable OS-backed RNG via rand_core/getrandom |
#![forbid(unsafe_code)]- Constant-time comparisons via
subtle - Secret values zeroized on drop via
zeroize
The minimum supported Rust version is 1.79.
Licensed under either of Apache License, Version 2.0 or MIT License at your option.