Add from_scalar. (#331)
This commit is contained in:
parent
9985c9660e
commit
dad04f46ee
|
@ -245,6 +245,14 @@ impl<C> Challenge<C>
|
|||
where
|
||||
C: Ciphersuite,
|
||||
{
|
||||
/// Creates a challenge from a scalar.
|
||||
#[cfg(feature = "internals")]
|
||||
pub fn from_scalar(
|
||||
scalar: <<<C as Ciphersuite>::Group as Group>::Field as Field>::Scalar,
|
||||
) -> Self {
|
||||
Self(scalar)
|
||||
}
|
||||
|
||||
/// Return the underlying scalar.
|
||||
#[cfg(feature = "internals")]
|
||||
pub fn to_scalar(self) -> <<<C as Ciphersuite>::Group as Group>::Field as Field>::Scalar {
|
||||
|
|
Loading…
Reference in New Issue