mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-04 20:24:10 +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`.
|
||||
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.
|
||||
pub fn as_bytes<'a>(&'a self) -> &'a [u8; 32] {
|
||||
&self.0
|
||||
|
|
|
|||
Loading…
Reference in a new issue