pub trait Blinded: Sized {
type BytesArray;
// Required methods
fn from_bytes(bytes: &Self::BytesArray) -> Result<Self, Error>;
fn to_bytes(&self) -> Self::BytesArray;
}Expand description
(De)serialization for BlindedPublicKey.
§Security
Implementers must validate deserialized public keys in from_bytes.
Small-order and identity points must be rejected with Error::InvalidPoint.
Failure to validate can lead to key recovery or other cryptographic attacks.
Required Associated Types§
Sourcetype BytesArray
type BytesArray
A bytes array type with the size of the serialized BlindedPublicKey.
Required Methods§
Sourcefn from_bytes(bytes: &Self::BytesArray) -> Result<Self, Error>
fn from_bytes(bytes: &Self::BytesArray) -> Result<Self, Error>
Parse a BlindedPublicKey from a BytesArray.
§Security
Implementers must validate deserialized blinded public key as well as its blinding
factor and reject small-order and identity points with Error::InvalidPoint.
Sourcefn to_bytes(&self) -> Self::BytesArray
fn to_bytes(&self) -> Self::BytesArray
Serialize BlindedPublicKey to a BytesArray.
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 Blinded for BlindedPublicKey<DalekRistretto255>
impl Blinded for BlindedPublicKey<DalekRistretto255>
type BytesArray = Array<u8, <<DalekRistretto255 as KeyPair>::PublicKeySize as Add>::Output>
Source§impl Blinded for BlindedPublicKey<DalekX25519>
impl Blinded for BlindedPublicKey<DalekX25519>
type BytesArray = Array<u8, <<DalekX25519 as KeyPair>::PublicKeySize as Add>::Output>
Source§impl<C: CurveArithmetic + PointCompression> Blinded for BlindedPublicKey<EllipticCurve<C>>where
<C as Curve>::FieldBytesSize: ModulusSize,
<C as CurveArithmetic>::AffinePoint: ToSec1Point<C> + FromSec1Point<C>,
CompressedPointSize<C>: Add<CompressedPointSize<C>> + ArraySize,
Sum<CompressedPointSize<C>, CompressedPointSize<C>>: ArraySize,
Available on crate feature rustcrypto-ec only.
impl<C: CurveArithmetic + PointCompression> Blinded for BlindedPublicKey<EllipticCurve<C>>where
<C as Curve>::FieldBytesSize: ModulusSize,
<C as CurveArithmetic>::AffinePoint: ToSec1Point<C> + FromSec1Point<C>,
CompressedPointSize<C>: Add<CompressedPointSize<C>> + ArraySize,
Sum<CompressedPointSize<C>, CompressedPointSize<C>>: ArraySize,
Available on crate feature
rustcrypto-ec only.