pub struct SecretKey<F: PrimeField> {
pub x: F,
pub y: Vec<F>,
}Expand description
SecretKey used in the modified Pointcheval-Sanders signature scheme.
Fields§
§x: F§y: Vec<F>Implementations§
Source§impl<F: PrimeField> SecretKey<F>
impl<F: PrimeField> SecretKey<F>
pub const X_SALT: &'static [u8] = b"PS-SIG-X-KEYGEN-SALT"
pub const Y_SALT: &'static [u8] = b"PS-SIG-Y-KEYGEN-SALT"
Sourcepub fn rand<R: RngCore>(rng: &mut R, message_count: u32) -> Self
pub fn rand<R: RngCore>(rng: &mut R, message_count: u32) -> Self
Generates random secret key compatible with message_count messages.
Sourcepub fn from_seed<D>(seed: &[u8], message_count: u32) -> Selfwhere
D: FullDigest + SyncIfParallel,
pub fn from_seed<D>(seed: &[u8], message_count: u32) -> Selfwhere
D: FullDigest + SyncIfParallel,
Generates secret key compatible with message_count messages from supplied seed.
Sourcepub fn supported_message_count(&self) -> usize
pub fn supported_message_count(&self) -> usize
Returns max amount of messages supported by this secret key.
Trait Implementations§
Source§impl<F: PrimeField> CanonicalDeserialize for SecretKey<F>
impl<F: PrimeField> CanonicalDeserialize for SecretKey<F>
Source§fn deserialize_with_mode<R: Read>(
reader: R,
compress: Compress,
validate: Validate,
) -> Result<Self, SerializationError>
fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>
The general deserialize method that takes in customization flags.
fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_compressed_unchecked<R>(
reader: R,
) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed_unchecked<R>(
reader: R,
) -> Result<Self, SerializationError>where
R: Read,
Source§impl<F: PrimeField> CanonicalSerialize for SecretKey<F>
impl<F: PrimeField> CanonicalSerialize for SecretKey<F>
Source§fn serialize_with_mode<W: Write>(
&self,
writer: W,
compress: Compress,
) -> Result<(), SerializationError>
fn serialize_with_mode<W: Write>( &self, writer: W, compress: Compress, ) -> Result<(), SerializationError>
The general serialize method that takes in customization flags.
fn serialized_size(&self, compress: Compress) -> usize
fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn compressed_size(&self) -> usize
fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn uncompressed_size(&self) -> usize
Source§impl<'de, F: PrimeField> Deserialize<'de> for SecretKey<F>
impl<'de, F: PrimeField> Deserialize<'de> for SecretKey<F>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<F: PrimeField> Drop for SecretKey<F>
impl<F: PrimeField> Drop for SecretKey<F>
Source§impl<F: PrimeField> Serialize for SecretKey<F>
impl<F: PrimeField> Serialize for SecretKey<F>
Source§impl<F: PrimeField> Valid for SecretKey<F>
impl<F: PrimeField> Valid for SecretKey<F>
fn check(&self) -> Result<(), SerializationError>
fn batch_check<'a>(
batch: impl Iterator<Item = &'a Self> + Send,
) -> Result<(), SerializationError>where
Self: 'a,
impl<F: Eq + PrimeField> Eq for SecretKey<F>
impl<F: PrimeField> StructuralPartialEq for SecretKey<F>
Auto Trait Implementations§
impl<F> Freeze for SecretKey<F>where
F: Freeze,
impl<F> RefUnwindSafe for SecretKey<F>where
F: RefUnwindSafe,
impl<F> Send for SecretKey<F>
impl<F> Sync for SecretKey<F>
impl<F> Unpin for SecretKey<F>where
F: Unpin,
impl<F> UnwindSafe for SecretKey<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more