Tests for ed25519 verify.

This commit is contained in:
Gav
2018-01-18 12:31:34 +01:00
parent 3b850c7ed1
commit 07c14104f7
6 changed files with 54 additions and 9 deletions
+24
View File
@@ -48,6 +48,18 @@ impl Signature {
}
}
impl AsRef<[u8; 64]> for Signature {
fn as_ref(&self) -> &[u8; 64] {
&self.0
}
}
impl AsRef<[u8]> for Signature {
fn as_ref(&self) -> &[u8] {
&self.0[..]
}
}
impl Public {
pub fn from(data: [u8; 32]) -> Self {
Public(data)
@@ -59,6 +71,18 @@ impl Public {
}
}
impl AsRef<[u8; 32]> for Public {
fn as_ref(&self) -> &[u8; 32] {
&self.0
}
}
impl AsRef<[u8]> for Public {
fn as_ref(&self) -> &[u8] {
&self.0[..]
}
}
impl Pair {
/// Generate new secure (random) key pair.
pub fn new() -> Pair {