From 9a49263752520e38cb95f2f297577c2e55c2a798 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Sun, 26 Nov 2017 03:21:49 +0000 Subject: [PATCH] Add to_bytes() convenience method for CompressedRistretto points. --- src/ristretto.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ristretto.rs b/src/ristretto.rs index 27208e4..61b451c 100644 --- a/src/ristretto.rs +++ b/src/ristretto.rs @@ -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