mirror of
https://github.com/rosenpass/rosenpass.git
synced 2026-03-01 15:03:21 -08:00
Fix comments in PublicBox impl to refer to PublicBox
This commit is contained in:
committed by
kat watson
parent
a18658847c
commit
921b2bfc39
@@ -285,31 +285,31 @@ pub struct PublicBox<const N: usize> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<const N: usize> PublicBox<N> {
|
impl<const N: usize> PublicBox<N> {
|
||||||
/// Create a new [Public] from a byte slice
|
/// Create a new [PublicBox] from a byte slice
|
||||||
pub fn from_slice(value: &[u8]) -> Self {
|
pub fn from_slice(value: &[u8]) -> Self {
|
||||||
copy_slice(value).to_this(Self::zero) // TODO: fix
|
copy_slice(value).to_this(Self::zero) // TODO: fix
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a new [Public] from a byte array
|
/// Create a new [PublicBox] from a byte array
|
||||||
pub fn new(value: [u8; N]) -> Self {
|
pub fn new(value: [u8; N]) -> Self {
|
||||||
Self {
|
Self {
|
||||||
inner: Box::new(Public::new(value)),
|
inner: Box::new(Public::new(value)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a zero initialized [Public]
|
/// Create a zero initialized [PublicBox]
|
||||||
pub fn zero() -> Self {
|
pub fn zero() -> Self {
|
||||||
Self {
|
Self {
|
||||||
inner: Box::new(Public::zero()),
|
inner: Box::new(Public::zero()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a random initialized [Public]
|
/// Create a random initialized [PublicBox]
|
||||||
pub fn random() -> Self {
|
pub fn random() -> Self {
|
||||||
mutating(Self::zero(), |r| r.randomize())
|
mutating(Self::zero(), |r| r.randomize())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Randomize all bytes in an existing [Public]
|
/// Randomize all bytes in an existing [PublicBox]
|
||||||
pub fn randomize(&mut self) {
|
pub fn randomize(&mut self) {
|
||||||
(**self).try_fill(&mut crate::rand::rng()).unwrap()
|
(**self).try_fill(&mut crate::rand::rng()).unwrap()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user