Enum AlgorithmInstance

Source
pub enum AlgorithmInstance {
Show 21 variants HS256, HS384, HS512, RS256, RS384, RS512, PS256, PS384, PS512, EdDSA, EdBlake2b, ES256, ES384, ES256K, ES256KR, ESKeccakK, ESKeccakKR, ESBlake2b, ESBlake2bK, Bbs(BbsInstance), None, // some variants omitted
}

Variants§

§

HS256

§

HS384

§

HS512

§

RS256

RSASSA-PKCS1-v1_5 using SHA-256.

See: https://www.rfc-editor.org/rfc/rfc7518.txt

§

RS384

RSASSA-PKCS1-v1_5 using SHA-384.

See: https://www.rfc-editor.org/rfc/rfc7518.txt

§

RS512

RSASSA-PKCS1-v1_5 using SHA-512.

See: https://www.rfc-editor.org/rfc/rfc7518.txt

§

PS256

RSASSA-PSS using SHA-256 and MGF1 with SHA-256.

See: https://www.rfc-editor.org/rfc/rfc7518.txt

§

PS384

RSASSA-PSS using SHA-384 and MGF1 with SHA-384.

See: https://www.rfc-editor.org/rfc/rfc7518.txt

§

PS512

RSASSA-PSS using SHA-512 and MGF1 with SHA-512.

See: https://www.rfc-editor.org/rfc/rfc7518.txt

§

EdDSA

Edwards-curve Digital Signature Algorithm (EdDSA) using SHA-256.

The following curves are defined for use with EdDSA:

  • Ed25519
  • Ed448

See: https://www.rfc-editor.org/rfc/rfc8037

§

EdBlake2b

EdDSA using SHA-256 and Blake2b as pre-hash function.

§

ES256

ECDSA using P-256 and SHA-256.

See: https://www.rfc-editor.org/rfc/rfc7518.txt

§

ES384

ECDSA using P-384 and SHA-384.

See: https://www.rfc-editor.org/rfc/rfc7518.txt

§

ES256K

ECDSA using secp256k1 (K-256) and SHA-256.

See: https://datatracker.ietf.org/doc/html/rfc8812

§

ES256KR

ECDSA using secp256k1 (K-256) and SHA-256 with a recovery bit.

ES256K-R is similar to ES256K with the recovery bit appended, making the signature 65 bytes instead of 64. The recovery bit is used to extract the public key from the signature.

See: https://github.com/decentralized-identity/EcdsaSecp256k1RecoverySignature2020#es256k-r

§

ESKeccakK

ECDSA using secp256k1 (K-256) and Keccak-256.

Like ES256K but using Keccak-256 instead of SHA-256.

§

ESKeccakKR

ECDSA using secp256k1 (K-256) and Keccak-256 with a recovery bit.

Like ES256K-R but using Keccak-256 instead of SHA-256.

§

ESBlake2b

ECDSA using P-256 and Blake2b.

§

ESBlake2bK

ECDSA using secp256k1 (K-256) and Blake2b.

§

Bbs(BbsInstance)

BBS scheme.

§

None

No signature

Implementations§

Source§

impl AlgorithmInstance

Source

pub fn algorithm(&self) -> Algorithm

Source§

impl AlgorithmInstance

Source

pub fn sign( &self, key: &SecretKey, signing_bytes: &[u8], ) -> Result<Vec<u8>, SignatureError>

Source§

impl AlgorithmInstance

Source

pub fn verify( &self, key: &PublicKey, signing_bytes: &[u8], signature_bytes: &[u8], ) -> Result<bool, VerificationError>

Trait Implementations§

Source§

impl Clone for AlgorithmInstance

Source§

fn clone(&self) -> AlgorithmInstance

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AlgorithmInstance

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<AleoTestnet1Signature> for AlgorithmInstance

Source§

fn from(_: AleoTestnet1Signature) -> Self

Converts to this type from the input type.
Source§

impl From<AnyBlake2b> for AlgorithmInstance

Source§

fn from(value: AnyBlake2b) -> Self

Converts to this type from the input type.
Source§

impl From<AnyESKeccakK> for AlgorithmInstance

Source§

fn from(value: AnyESKeccakK) -> Self

Converts to this type from the input type.
Source§

impl From<BbsInstance> for AlgorithmInstance

Source§

fn from(value: BbsInstance) -> Self

Converts to this type from the input type.
Source§

impl From<ES256> for AlgorithmInstance

Source§

fn from(_: ES256) -> Self

Converts to this type from the input type.
Source§

impl From<ES256K> for AlgorithmInstance

Source§

fn from(_: ES256K) -> Self

Converts to this type from the input type.
Source§

impl From<ES256KR> for AlgorithmInstance

Source§

fn from(_: ES256KR) -> Self

Converts to this type from the input type.
Source§

impl From<ES256OrES384> for AlgorithmInstance

Source§

fn from(value: ES256OrES384) -> Self

Converts to this type from the input type.
Source§

impl From<ES384> for AlgorithmInstance

Source§

fn from(_: ES384) -> Self

Converts to this type from the input type.
Source§

impl From<ESBlake2b> for AlgorithmInstance

Source§

fn from(_: ESBlake2b) -> Self

Converts to this type from the input type.
Source§

impl From<ESBlake2bK> for AlgorithmInstance

Source§

fn from(_: ESBlake2bK) -> Self

Converts to this type from the input type.
Source§

impl From<ESKeccakK> for AlgorithmInstance

Source§

fn from(_: ESKeccakK) -> Self

Converts to this type from the input type.
Source§

impl From<ESKeccakKR> for AlgorithmInstance

Source§

fn from(_: ESKeccakKR) -> Self

Converts to this type from the input type.
Source§

impl From<EdBlake2b> for AlgorithmInstance

Source§

fn from(_: EdBlake2b) -> Self

Converts to this type from the input type.
Source§

impl From<EdDSA> for AlgorithmInstance

Source§

fn from(_: EdDSA) -> Self

Converts to this type from the input type.
Source§

impl From<HS256> for AlgorithmInstance

Source§

fn from(_: HS256) -> Self

Converts to this type from the input type.
Source§

impl From<HS384> for AlgorithmInstance

Source§

fn from(_: HS384) -> Self

Converts to this type from the input type.
Source§

impl From<HS512> for AlgorithmInstance

Source§

fn from(_: HS512) -> Self

Converts to this type from the input type.
Source§

impl From<PS256> for AlgorithmInstance

Source§

fn from(_: PS256) -> Self

Converts to this type from the input type.
Source§

impl From<PS384> for AlgorithmInstance

Source§

fn from(_: PS384) -> Self

Converts to this type from the input type.
Source§

impl From<PS512> for AlgorithmInstance

Source§

fn from(_: PS512) -> Self

Converts to this type from the input type.
Source§

impl From<RS256> for AlgorithmInstance

Source§

fn from(_: RS256) -> Self

Converts to this type from the input type.
Source§

impl From<RS384> for AlgorithmInstance

Source§

fn from(_: RS384) -> Self

Converts to this type from the input type.
Source§

impl From<RS512> for AlgorithmInstance

Source§

fn from(_: RS512) -> Self

Converts to this type from the input type.
Source§

impl SignatureAlgorithmInstance for AlgorithmInstance

Source§

impl TryFrom<AlgorithmInstance> for AleoTestnet1Signature

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for AnyBlake2b

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(value: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for BbsInstance

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for ES256

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for ES256K

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for ES256KR

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for ES384

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for ESBlake2b

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for ESBlake2bK

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for ESKeccakK

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for ESKeccakKR

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for EdBlake2b

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for EdDSA

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for HS256

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for HS384

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for HS512

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for PS256

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for PS384

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for PS512

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for RS256

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for RS384

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AlgorithmInstance> for RS512

Source§

type Error = UnsupportedAlgorithm

The type returned in the event of a conversion error.
Source§

fn try_from(a: AlgorithmInstance) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V