mirror of
https://github.com/saymrwulf/betrusted-curve25519-dalek-source.git
synced 2026-09-09 21:10:43 +00:00
Add to_bytes() convenience method for CompressedRistretto points.
This commit is contained in:
parent
6e96e49eea
commit
9a49263752
1 changed files with 5 additions and 0 deletions
|
|
@ -427,6 +427,11 @@ pub struct CompressedRistretto(pub [u8; 32]);
|
||||||
|
|
||||||
/// The result of compressing a `RistrettoPoint`.
|
/// The result of compressing a `RistrettoPoint`.
|
||||||
impl CompressedRistretto {
|
impl CompressedRistretto {
|
||||||
|
/// Convert this `CompressedRistretto` to its underlying array of bytes.
|
||||||
|
pub fn to_bytes(&self) -> [u8; 32] {
|
||||||
|
self.0
|
||||||
|
}
|
||||||
|
|
||||||
/// View this `CompressedRistretto` as an array of bytes.
|
/// View this `CompressedRistretto` as an array of bytes.
|
||||||
pub fn as_bytes<'a>(&'a self) -> &'a [u8; 32] {
|
pub fn as_bytes<'a>(&'a self) -> &'a [u8; 32] {
|
||||||
&self.0
|
&self.0
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue