From 2d15619c6c5a8150c2f98e70bfa4af5c275a4942 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 1 Aug 2017 19:30:51 +0000 Subject: [PATCH] Add DecafPoint.to_bytes(). --- src/decaf.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/decaf.rs b/src/decaf.rs index c2dad53..fb9cf84 100644 --- a/src/decaf.rs +++ b/src/decaf.rs @@ -59,6 +59,11 @@ pub struct CompressedDecaf(pub [u8; 32]); /// The result of compressing a `DecafPoint`. impl CompressedDecaf { + /// Convert this `CompressedDecaf` to an array of bytes. + pub fn to_bytes(&self) -> [u8; 32] { + self.0 + } + /// View this `CompressedDecaf` as an array of bytes. pub fn as_bytes<'a>(&'a self) -> &'a [u8; 32] { &self.0