pub struct EncodedSecretScalar<E: Curve>(/* private fields */);Expand description
Bytes representation of a secret elliptic scalar. See SecretScalar for
more information
This representation is automatically zeroed on drop, and doesn’t implement
some vartime methods. You can still access the underlying bytes by calling
.as_ref(). This bypasses all the secrecy guarantees given by this struct.
Implementations§
Source§impl<E: Curve> EncodedSecretScalar<E>
impl<E: Curve> EncodedSecretScalar<E>
Sourcepub fn new(scalar: EncodedScalar<E>) -> Self
pub fn new(scalar: EncodedScalar<E>) -> Self
Wrap a non-secret representation
Sourcepub fn as_nonsecret_bytes(&self) -> &[u8] ⓘ
pub fn as_nonsecret_bytes(&self) -> &[u8] ⓘ
Obtain the reference to the encoded bytes. This bypasses all the secrecy guarantees, so be careful when handling them; ideally this reference should not be held for longer than one expression
Sourcepub fn as_nonsecret(&self) -> &EncodedScalar<E>
pub fn as_nonsecret(&self) -> &EncodedScalar<E>
Obtain the reference to the encoded scalar, which you can use as bytes when necessary. This bypasses all the secrecy guarantees, so be careful when handling the resulting value; ideally this reference should not be held for longer than one expression
Trait Implementations§
Source§impl<E: Clone + Curve> Clone for EncodedSecretScalar<E>
impl<E: Clone + Curve> Clone for EncodedSecretScalar<E>
Source§fn clone(&self) -> EncodedSecretScalar<E>
fn clone(&self) -> EncodedSecretScalar<E>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more