mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-06 20:41:14 +00:00
Add to_bytes() convenience method for Scalar.
This commit is contained in:
parent
9a49263752
commit
87f93a5df2
1 changed files with 5 additions and 0 deletions
|
|
@ -302,6 +302,11 @@ impl Scalar {
|
||||||
Scalar::reduce(&output)
|
Scalar::reduce(&output)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Convert this `Scalar` to its underlying sequence of bytes.
|
||||||
|
pub fn to_bytes(&self) -> [u8; 32] {
|
||||||
|
self.0
|
||||||
|
}
|
||||||
|
|
||||||
/// View this `Scalar` as a sequence of bytes.
|
/// View this `Scalar` as a sequence of bytes.
|
||||||
pub fn as_bytes(&self) -> &[u8; 32] {
|
pub fn as_bytes(&self) -> &[u8; 32] {
|
||||||
&self.0
|
&self.0
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue