Add DecafPoint.to_bytes().

This commit is contained in:
Isis Lovecruft 2017-08-01 19:30:51 +00:00
parent fa481903d3
commit 2d15619c6c
Failed to extract signature

View file

@ -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