Enum schnorrkel::keys::ExpansionMode [−][src]
Methods for expanding a MiniSecretKey
into a SecretKey
.
Our SecretKey
s consist of a scalar and nonce seed, both 32 bytes,
what EdDSA/Ed25519 calls an extended secret key. We normally create
SecretKey
s by expanding a MiniSecretKey
, what Esd25519 calls
a SecretKey
. We provide two such methods, our suggested approach
produces uniformly distribted secret key scalars, but another
approach retains the bit clamping form Ed25519.
Variants
Expand the MiniSecretKey
into a uniformly distributed
SecretKey
.
We preoduce the SecretKey
using merlin and far more uniform
sampling, which might benefits some future protocols, and
might reduce binary size if used throughout.
We slightly prefer this method, but some existing code uses
Ed25519
mode, so users cannot necessarily use this mode
if they require compatability with existing systems.
Expand this MiniSecretKey
into a SecretKey
using
ed25519-style bit clamping.
Ristretto points are represented by Ed25519 points internally so concievably some future standard might expose a mapping from Ristretto to Ed25519, which makes this mode useful. At present, there is no such exposed mapping however because two such mappings actually exist, depending upon the branch of the inverse square root chosen by a Ristretto implementation. There is however a concern that such a mapping would remain a second class citizen, meaning implementations differ and create incompatability.
We weakly recommend against emoloying this method. We include it primarily because early Ristretto documentation touted the relationship with Ed25519, which led to some deployments adopting this expansion method.
Auto Trait Implementations
impl RefUnwindSafe for ExpansionMode
impl Send for ExpansionMode
impl Sync for ExpansionMode
impl Unpin for ExpansionMode
impl UnwindSafe for ExpansionMode
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,