Enum psa_crypto::types::algorithm::Hash[][src]

pub enum Hash {
Show 15 variants Md2, Md4, Md5, Ripemd160, Sha1, Sha224, Sha256, Sha384, Sha512, Sha512_224, Sha512_256, Sha3_224, Sha3_256, Sha3_384, Sha3_512,
}
Expand description

Enumeration of hash algorithms supported.

Variants

Md2

👎 Deprecated:

The MD2 hash is weak and deprecated and is only recommended for use in legacy protocols.

MD2

Md4

👎 Deprecated:

The MD4 hash is weak and deprecated and is only recommended for use in legacy protocols.

MD4

Md5

👎 Deprecated:

The MD5 hash is weak and deprecated and is only recommended for use in legacy protocols.

MD5

Ripemd160

RIPEMD-160

Sha1

👎 Deprecated:

The SHA-1 hash is weak and deprecated and is only recommended for use in legacy protocols.

SHA-1

Sha224

SHA-224

Sha256

SHA-256

Sha384

SHA-384

Sha512

SHA-512

Sha512_224

SHA-512/224

Sha512_256

SHA-512/256

Sha3_224

SHA3-224

Sha3_256

SHA3-256

Sha3_384

SHA3-384

Sha3_512

SHA3-512

Implementations

Get the digest size output by the hash algorithm in bytes

Example
use psa_crypto::types::algorithm::Hash;
assert_eq!(Hash::Sha256.hash_length(), 32);
assert_eq!(Hash::Sha512.hash_length(), 64);

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.