mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-06 20:41:14 +00:00
Add a Scalar::as_bytes() method.
This commit is contained in:
parent
950519b97b
commit
e5c0d789fd
1 changed files with 5 additions and 0 deletions
|
|
@ -165,6 +165,11 @@ impl Scalar {
|
||||||
Scalar::reduce(&scalar_bytes)
|
Scalar::reduce(&scalar_bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// View this `Scalar` as a sequence of bytes.
|
||||||
|
pub fn as_bytes<'a>(&'a self) -> &'a [u8;32] {
|
||||||
|
&self.0
|
||||||
|
}
|
||||||
|
|
||||||
/// Construct the additive identity
|
/// Construct the additive identity
|
||||||
pub fn zero() -> Self {
|
pub fn zero() -> Self {
|
||||||
Scalar([0u8; 32])
|
Scalar([0u8; 32])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue