diff --git a/crypto/frost/src/algorithm.rs b/crypto/frost/src/algorithm.rs index 16f0bfa6..f676879b 100644 --- a/crypto/frost/src/algorithm.rs +++ b/crypto/frost/src/algorithm.rs @@ -87,32 +87,37 @@ pub trait Algorithm: Clone { ) -> Result, ()>; } -/// IETF-compliant transcript. This is incredibly naive and should not be used within larger -/// protocols. -#[derive(Clone, Debug)] -pub struct IetfTranscript(Vec); -impl Transcript for IetfTranscript { - type Challenge = Vec; +mod sealed { + pub use super::*; - fn new(_: &'static [u8]) -> IetfTranscript { - IetfTranscript(vec![]) - } + /// IETF-compliant transcript. This is incredibly naive and should not be used within larger + /// protocols. + #[derive(Clone, Debug)] + pub struct IetfTranscript(pub(crate) Vec); + impl Transcript for IetfTranscript { + type Challenge = Vec; - fn domain_separate(&mut self, _: &[u8]) {} + fn new(_: &'static [u8]) -> IetfTranscript { + IetfTranscript(vec![]) + } - fn append_message>(&mut self, _: &'static [u8], message: M) { - self.0.extend(message.as_ref()); - } + fn domain_separate(&mut self, _: &[u8]) {} - fn challenge(&mut self, _: &'static [u8]) -> Vec { - self.0.clone() - } + fn append_message>(&mut self, _: &'static [u8], message: M) { + self.0.extend(message.as_ref()); + } - // FROST won't use this and this shouldn't be used outside of FROST - fn rng_seed(&mut self, _: &'static [u8]) -> [u8; 32] { - unimplemented!() + fn challenge(&mut self, _: &'static [u8]) -> Vec { + self.0.clone() + } + + // FROST won't use this and this shouldn't be used outside of FROST + fn rng_seed(&mut self, _: &'static [u8]) -> [u8; 32] { + unimplemented!() + } } } +pub(crate) use sealed::IetfTranscript; /// HRAm usable by the included Schnorr signature algorithm to generate challenges. pub trait Hram: Clone {