1use ecdh_omr::{Hint, Hints, curves::X25519};
5use rand::rngs::adapter::ReseedingRng;
6use rand_chacha::ChaCha12Core;
7use rand_core::OsRng;
8use zeroize::{ZeroizeOnDrop, Zeroizing};
9
10pub use prost::Message as ProstMessage;
11
12pub type ReachRng = ReseedingRng<ChaCha12Core, OsRng>;
13
14pub type BlindedPublicKey = ecdh_omr::BlindedPublicKey<X25519>;
15pub type EnvelopeIdHint = Hint<X25519, chacha20poly1305::XChaCha20Poly1305, 54>;
16pub type EnvelopeIdHints = Hints<EnvelopeIdHint, 5000>;
17
18pub const FN_DSA_DEGREES: u32 = fn_dsa_comm::FN_DSA_LOGN_512;
19pub const FN_DSA_HASH_ID: fn_dsa_comm::HashIdentifier<'static> = fn_dsa_comm::HASH_ID_SHA3_512;
20pub const FN_DSA_VERIFYING_EMPTY: FnDsaVerifying =
21 [0u8; fn_dsa_comm::vrfy_key_size(FN_DSA_DEGREES)];
22
23pub type FnDsaSignature = [u8; fn_dsa_comm::signature_size(FN_DSA_DEGREES)];
24pub type FnDsaSigningDecoded = fn_dsa_sign::SigningKey512;
25pub type FnDsaSigningInner = [u8; fn_dsa_comm::sign_key_size(FN_DSA_DEGREES)];
26pub type FnDsaVerifying = [u8; fn_dsa_comm::vrfy_key_size(FN_DSA_DEGREES)];
27pub type FnDsaVerifyingDecoded = fn_dsa_vrfy::VerifyingKey512;
28pub type FnDsaDomainContext<'a> = fn_dsa_comm::DomainContext<'a>;
29
30#[derive(ZeroizeOnDrop, Clone)]
31pub struct FnDsaSigning {
32 pub inner: FnDsaSigningInner,
33}
34
35impl TryFrom<&[u8]> for FnDsaSigning {
36 type Error = std::array::TryFromSliceError;
37
38 fn try_from(from: &[u8]) -> Result<Self, Self::Error> {
39 Ok(FnDsaSigning {
40 inner: FnDsaSigningInner::try_from(from)?,
41 })
42 }
43}
44
45use ml_kem::{KemCore, MlKem768Params, kem::*};
46
47pub type MlKem = Kem<MlKem768Params>;
48
49pub use chacha20poly1305::Key as XChaChaKey;
50
51pub type MlKemCiphertext = ml_kem::Ciphertext<MlKem>;
52pub type MlKemPublic = <MlKem as KemCore>::EncapsulationKey;
53pub type MlKemSecret = <MlKem as KemCore>::DecapsulationKey;
54
55pub type Ed25519Signature = ed25519_dalek::Signature;
56pub type Ed25519Signing = ed25519_dalek::SigningKey;
57pub type Ed25519Verifying = ed25519_dalek::VerifyingKey;
58
59pub type X25519Public = x25519_dalek::PublicKey;
60pub type X25519Secret = x25519_dalek::StaticSecret;
61
62pub type MacSharedSecret = Zeroizing<ThreeTwo>;
63
64pub type OneSix = [u8; 16];
65pub type TwoFour = [u8; 24];
66pub type ThreeTwo = [u8; 32];
67pub type SixFour = [u8; 64];