Add to_bytes() convenience method for Scalar.

This commit is contained in:
Isis Lovecruft 2017-11-26 03:23:31 +00:00
parent 9a49263752
commit 87f93a5df2
Failed to extract signature

View file

@ -302,6 +302,11 @@ impl Scalar {
Scalar::reduce(&output)
}
/// Convert this `Scalar` to its underlying sequence of bytes.
pub fn to_bytes(&self) -> [u8; 32] {
self.0
}
/// View this `Scalar` as a sequence of bytes.
pub fn as_bytes(&self) -> &[u8; 32] {
&self.0