pub trait Hinting<K: KeyPair, L: ArraySize>: Sized {
type HintSize: ArraySize;
// Required methods
fn new(
blinded_public_key: &BlindedPublicKey<K>,
message: &Array<u8, L>,
context: &[u8],
csprng: &mut impl CryptoRng,
) -> Result<Self, Error>;
fn from_blinding_factor_secret(
blinding_factor_secret: &K::SecretKey,
blinded_public_key: &BlindedPublicKey<K>,
message: &Array<u8, L>,
context: &[u8],
) -> Result<Self, Error>;
fn from_bytes(bytes: &[u8]) -> Result<Self, Error>;
fn to_bytes(self) -> Array<u8, Self::HintSize>;
}Expand description
Semi generic implementations to create new Hints
Required Associated Types§
Required Methods§
Sourcefn new(
blinded_public_key: &BlindedPublicKey<K>,
message: &Array<u8, L>,
context: &[u8],
csprng: &mut impl CryptoRng,
) -> Result<Self, Error>
fn new( blinded_public_key: &BlindedPublicKey<K>, message: &Array<u8, L>, context: &[u8], csprng: &mut impl CryptoRng, ) -> Result<Self, Error>
Create a new Hint.
Sourcefn from_blinding_factor_secret(
blinding_factor_secret: &K::SecretKey,
blinded_public_key: &BlindedPublicKey<K>,
message: &Array<u8, L>,
context: &[u8],
) -> Result<Self, Error>
fn from_blinding_factor_secret( blinding_factor_secret: &K::SecretKey, blinded_public_key: &BlindedPublicKey<K>, message: &Array<u8, L>, context: &[u8], ) -> Result<Self, Error>
Create a new Hint using a blinding factor secret.
Sourcefn from_bytes(bytes: &[u8]) -> Result<Self, Error>
fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
Deserialize from byte slice
§Security
Implementers must validate the deserialized blinded blinding factor and reject
small-order and identity points with Error::InvalidPoint.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl<A: Aead + KeyInit, C: CurveArithmetic + PointCompression, L: ArraySize> Hinting<EllipticCurve<C>, L> for Hint<EllipticCurve<C>, A, L>where
<C as Curve>::FieldBytesSize: ModulusSize,
<C as CurveArithmetic>::AffinePoint: ToSec1Point<C> + FromSec1Point<C>,
Self: HintSized<EllipticCurve<C>, A, L>,
Available on crate feature rustcrypto-ec only.
impl<A: Aead + KeyInit, C: CurveArithmetic + PointCompression, L: ArraySize> Hinting<EllipticCurve<C>, L> for Hint<EllipticCurve<C>, A, L>where
<C as Curve>::FieldBytesSize: ModulusSize,
<C as CurveArithmetic>::AffinePoint: ToSec1Point<C> + FromSec1Point<C>,
Self: HintSized<EllipticCurve<C>, A, L>,
Available on crate feature
rustcrypto-ec only.