diff --git a/polyfuzzy/src/fmd2.rs b/polyfuzzy/src/fmd2.rs index b78b7bd..9cd0acc 100644 --- a/polyfuzzy/src/fmd2.rs +++ b/polyfuzzy/src/fmd2.rs @@ -40,6 +40,14 @@ pub struct FlagCiphertexts { c: Vec, } +impl FlagCiphertexts { + /// Return the bits of the flag ciphertext. + #[inline] + pub fn bits(&self) -> &[u8] { + &self.c + } +} + impl From for FlagCiphertexts { fn from(value: GenericFlagCiphertexts) -> Self { FlagCiphertexts { diff --git a/polyfuzzy/src/fmd2_compact/mod.rs b/polyfuzzy/src/fmd2_compact/mod.rs index a97802d..9338a71 100644 --- a/polyfuzzy/src/fmd2_compact/mod.rs +++ b/polyfuzzy/src/fmd2_compact/mod.rs @@ -99,6 +99,14 @@ pub struct FmdPublicKey(PointEvaluations); #[derive(Debug, Clone)] pub struct FlagCiphertexts(GenericFlagCiphertexts); +impl FlagCiphertexts { + /// Return the bits of the flag ciphertext. + #[inline] + pub fn bits(&self) -> &[u8] { + &self.0.c.0 + } +} + /// Cache of expanded FMD public keys. #[derive(Debug, Clone)] struct ExpandedKeyCache {