Add custom ServerSetup construction

This commit is contained in:
daxpedda
2021-07-23 15:23:10 -07:00
committed by Kevin Lewi
parent 4ce61acc6e
commit 77461b640d
2 changed files with 19 additions and 6 deletions
+5 -1
View File
@@ -115,7 +115,11 @@ impl<G: Group, S: SecretKey<G>> KeyPair<G, S> {
/// Obtains a KeyPair from a slice representing the private key
pub fn from_private_key_slice(input: &[u8]) -> Result<Self, ProtocolError<S::Error>> {
let sk = S::deserialize(input)?;
Self::from_private_key(S::deserialize(input)?)
}
/// Obtains a KeyPair from a private key
pub fn from_private_key(sk: S) -> Result<Self, ProtocolError<S::Error>> {
let pk = sk.public_key()?;
Ok(Self { pk, sk })
}