Enum pgp::crypto::sym::SymmetricKeyAlgorithm[][src]

#[repr(u8)]
pub enum SymmetricKeyAlgorithm {
Show 13 variants Plaintext, IDEA, TripleDES, CAST5, Blowfish, AES128, AES192, AES256, Twofish, Camellia128, Camellia192, Camellia256, Private10,
}
Expand description

Variants

Plaintext

Plaintext or unencrypted data

IDEA

IDEA

TripleDES

Triple-DES

CAST5

CAST5

Blowfish

Blowfish

AES128

AES with 128-bit key

AES192

AES with 192-bit key

AES256

AES with 256-bit key

Twofish

Twofish with 256-bit key

Camellia128

Camellia with 128-bit key

Camellia192

Camellia with 192-bit key

Camellia256

Camellia with 256-bit key

Private10

Implementations

The size of a single block in bytes. Based on https://github.com/gpg/libgcrypt/blob/master/cipher

The size of a single block in bytes. Based on https://github.com/gpg/libgcrypt/blob/master/cipher

Decrypt the data using CFB mode, without padding. Overwrites the input. Uses an IV of all zeroes, as specified in the openpgp cfb mode. Does resynchronization.

Decrypt the data using CFB mode, without padding. Overwrites the input. Uses an IV of all zeroes, as specified in the openpgp cfb mode. Does not do resynchronization.

Decrypt the data using CFB mode, without padding. Overwrites the input.

OpenPGP CFB mode uses an initialization vector (IV) of all zeros, and prefixes the plaintext with BS+2 octets of random data, such that octets BS+1 and BS+2 match octets BS-1 and BS. It does a CFB resynchronization after encrypting those BS+2 octets.

Thus, for an algorithm that has a block size of 8 octets (64 bits), the IV is 10 octets long and octets 7 and 8 of the IV are the same as octets 9 and 10. For an algorithm with a block size of 16 octets (128 bits), the IV is 18 octets long, and octets 17 and 18 replicate octets 15 and 16. Those extra two octets are an easy check for a correct key.

Decrypt the data using CFB mode, without padding. Overwrites the input. This is regular CFB, not OpenPgP CFB.

Encrypt the data using CFB mode, without padding. Overwrites the input. Uses an IV of all zeroes, as specified in the openpgp cfb mode.

Same as encrypt_with_rng, but uses rand::thread_rng for RNG.

Encrypt the data using CFB mode, without padding. Overwrites the input.

OpenPGP CFB mode uses an initialization vector (IV) of all zeros, and prefixes the plaintext with BS+2 octets of random data, such that octets BS+1 and BS+2 match octets BS-1 and BS. It does a CFB resynchronization after encrypting those BS+2 octets.

Encrypt the data using CFB mode, without padding. Overwrites the input.

Generate a new session key.

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

Returns the “default value” for a type. Read more

Converts an i64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an u64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an isize to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an i8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an i16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an i32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an i128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts a usize to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an u8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an u16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an u32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an u128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts a f32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts a f64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

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

This method tests for !=.

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

Completely overwrites this value.

Performs the conversion.

Called to initialize a place to a valid value, after it is set to all-bits-zero. Read more

Performs the conversion.

Should always be Self

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)

recently added

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.

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