ltc_cipher_descriptor

Struct ltc_cipher_descriptor 

Source
#[repr(C)]
pub struct ltc_cipher_descriptor {
Show 26 fields pub name: *const c_char, pub ID: c_uchar, pub min_key_length: c_int, pub max_key_length: c_int, pub block_length: c_int, pub default_rounds: c_int, pub setup: Option<unsafe extern "C" fn(key: *const c_uchar, keylen: c_int, num_rounds: c_int, skey: *mut symmetric_key) -> c_int>, pub ecb_encrypt: Option<unsafe extern "C" fn(pt: *const c_uchar, ct: *mut c_uchar, skey: *mut symmetric_key) -> c_int>, pub ecb_decrypt: Option<unsafe extern "C" fn(ct: *const c_uchar, pt: *mut c_uchar, skey: *mut symmetric_key) -> c_int>, pub test: Option<unsafe extern "C" fn() -> c_int>, pub done: Option<unsafe extern "C" fn(skey: *mut symmetric_key)>, pub keysize: Option<unsafe extern "C" fn(keysize: *mut c_int) -> c_int>, pub accel_ecb_encrypt: Option<unsafe extern "C" fn(pt: *const c_uchar, ct: *mut c_uchar, blocks: c_ulong, skey: *mut symmetric_key) -> c_int>, pub accel_ecb_decrypt: Option<unsafe extern "C" fn(ct: *const c_uchar, pt: *mut c_uchar, blocks: c_ulong, skey: *mut symmetric_key) -> c_int>, pub accel_cbc_encrypt: Option<unsafe extern "C" fn(pt: *const c_uchar, ct: *mut c_uchar, blocks: c_ulong, IV: *mut c_uchar, skey: *mut symmetric_key) -> c_int>, pub accel_cbc_decrypt: Option<unsafe extern "C" fn(ct: *const c_uchar, pt: *mut c_uchar, blocks: c_ulong, IV: *mut c_uchar, skey: *mut symmetric_key) -> c_int>, pub accel_ctr_encrypt: Option<unsafe extern "C" fn(pt: *const c_uchar, ct: *mut c_uchar, blocks: c_ulong, IV: *mut c_uchar, mode: c_int, skey: *mut symmetric_key) -> c_int>, pub accel_lrw_encrypt: Option<unsafe extern "C" fn(pt: *const c_uchar, ct: *mut c_uchar, blocks: c_ulong, IV: *mut c_uchar, tweak: *const c_uchar, skey: *mut symmetric_key) -> c_int>, pub accel_lrw_decrypt: Option<unsafe extern "C" fn(ct: *const c_uchar, pt: *mut c_uchar, blocks: c_ulong, IV: *mut c_uchar, tweak: *const c_uchar, skey: *mut symmetric_key) -> c_int>, pub accel_ccm_memory: Option<unsafe extern "C" fn(key: *const c_uchar, keylen: c_ulong, uskey: *mut symmetric_key, nonce: *const c_uchar, noncelen: c_ulong, header: *const c_uchar, headerlen: c_ulong, pt: *mut c_uchar, ptlen: c_ulong, ct: *mut c_uchar, tag: *mut c_uchar, taglen: *mut c_ulong, direction: c_int) -> c_int>, pub accel_gcm_memory: Option<unsafe extern "C" fn(key: *const c_uchar, keylen: c_ulong, IV: *const c_uchar, IVlen: c_ulong, adata: *const c_uchar, adatalen: c_ulong, pt: *mut c_uchar, ptlen: c_ulong, ct: *mut c_uchar, tag: *mut c_uchar, taglen: *mut c_ulong, direction: c_int) -> c_int>, pub omac_memory: Option<unsafe extern "C" fn(key: *const c_uchar, keylen: c_ulong, in_: *const c_uchar, inlen: c_ulong, out: *mut c_uchar, outlen: *mut c_ulong) -> c_int>, pub xcbc_memory: Option<unsafe extern "C" fn(key: *const c_uchar, keylen: c_ulong, in_: *const c_uchar, inlen: c_ulong, out: *mut c_uchar, outlen: *mut c_ulong) -> c_int>, pub f9_memory: Option<unsafe extern "C" fn(key: *const c_uchar, keylen: c_ulong, in_: *const c_uchar, inlen: c_ulong, out: *mut c_uchar, outlen: *mut c_ulong) -> c_int>, pub accel_xts_encrypt: Option<unsafe extern "C" fn(pt: *const c_uchar, ct: *mut c_uchar, blocks: c_ulong, tweak: *mut c_uchar, skey1: *mut symmetric_key, skey2: *mut symmetric_key) -> c_int>, pub accel_xts_decrypt: Option<unsafe extern "C" fn(ct: *const c_uchar, pt: *mut c_uchar, blocks: c_ulong, tweak: *mut c_uchar, skey1: *mut symmetric_key, skey2: *mut symmetric_key) -> c_int>,
}
Expand description

cipher descriptor table, last entry has “name == NULL” to mark the end of table

Fields§

§name: *const c_char

name of cipher

§ID: c_uchar

internal ID

§min_key_length: c_int

min keysize (octets)

§max_key_length: c_int

max keysize (octets)

§block_length: c_int

block size (octets)

§default_rounds: c_int

default number of rounds

§setup: Option<unsafe extern "C" fn(key: *const c_uchar, keylen: c_int, num_rounds: c_int, skey: *mut symmetric_key) -> c_int>

Setup the cipher @param key The input symmetric key @param keylen The length of the input key (octets) @param num_rounds The requested number of rounds (0==default) @param skey [out] The destination of the scheduled key @return CRYPT_OK if successful

§ecb_encrypt: Option<unsafe extern "C" fn(pt: *const c_uchar, ct: *mut c_uchar, skey: *mut symmetric_key) -> c_int>

Encrypt a block @param pt The plaintext @param ct [out] The ciphertext @param skey The scheduled key @return CRYPT_OK if successful

§ecb_decrypt: Option<unsafe extern "C" fn(ct: *const c_uchar, pt: *mut c_uchar, skey: *mut symmetric_key) -> c_int>

Decrypt a block @param ct The ciphertext @param pt [out] The plaintext @param skey The scheduled key @return CRYPT_OK if successful

§test: Option<unsafe extern "C" fn() -> c_int>

Test the block cipher @return CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled

§done: Option<unsafe extern "C" fn(skey: *mut symmetric_key)>

Terminate the context @param skey The scheduled key

§keysize: Option<unsafe extern "C" fn(keysize: *mut c_int) -> c_int>

Determine a key size @param keysize [in/out] The size of the key desired and the suggested size @return CRYPT_OK if successful

§accel_ecb_encrypt: Option<unsafe extern "C" fn(pt: *const c_uchar, ct: *mut c_uchar, blocks: c_ulong, skey: *mut symmetric_key) -> c_int>

Accelerators / / Accelerated ECB encryption @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @param skey The scheduled key context @return CRYPT_OK if successful

§accel_ecb_decrypt: Option<unsafe extern "C" fn(ct: *const c_uchar, pt: *mut c_uchar, blocks: c_ulong, skey: *mut symmetric_key) -> c_int>

Accelerated ECB decryption @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @param skey The scheduled key context @return CRYPT_OK if successful

§accel_cbc_encrypt: Option<unsafe extern "C" fn(pt: *const c_uchar, ct: *mut c_uchar, blocks: c_ulong, IV: *mut c_uchar, skey: *mut symmetric_key) -> c_int>

Accelerated CBC encryption @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @param IV The initial value (input/output) @param skey The scheduled key context @return CRYPT_OK if successful

§accel_cbc_decrypt: Option<unsafe extern "C" fn(ct: *const c_uchar, pt: *mut c_uchar, blocks: c_ulong, IV: *mut c_uchar, skey: *mut symmetric_key) -> c_int>

Accelerated CBC decryption @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @param IV The initial value (input/output) @param skey The scheduled key context @return CRYPT_OK if successful

§accel_ctr_encrypt: Option<unsafe extern "C" fn(pt: *const c_uchar, ct: *mut c_uchar, blocks: c_ulong, IV: *mut c_uchar, mode: c_int, skey: *mut symmetric_key) -> c_int>

Accelerated CTR encryption @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @param IV The initial value (input/output) @param mode little or big endian counter (mode=0 or mode=1) @param skey The scheduled key context @return CRYPT_OK if successful

§accel_lrw_encrypt: Option<unsafe extern "C" fn(pt: *const c_uchar, ct: *mut c_uchar, blocks: c_ulong, IV: *mut c_uchar, tweak: *const c_uchar, skey: *mut symmetric_key) -> c_int>

Accelerated LRW @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @param IV The initial value (input/output) @param tweak The LRW tweak @param skey The scheduled key context @return CRYPT_OK if successful

§accel_lrw_decrypt: Option<unsafe extern "C" fn(ct: *const c_uchar, pt: *mut c_uchar, blocks: c_ulong, IV: *mut c_uchar, tweak: *const c_uchar, skey: *mut symmetric_key) -> c_int>

Accelerated LRW @param ct Ciphertext @param pt Plaintext @param blocks The number of complete blocks to process @param IV The initial value (input/output) @param tweak The LRW tweak @param skey The scheduled key context @return CRYPT_OK if successful

§accel_ccm_memory: Option<unsafe extern "C" fn(key: *const c_uchar, keylen: c_ulong, uskey: *mut symmetric_key, nonce: *const c_uchar, noncelen: c_ulong, header: *const c_uchar, headerlen: c_ulong, pt: *mut c_uchar, ptlen: c_ulong, ct: *mut c_uchar, tag: *mut c_uchar, taglen: *mut c_ulong, direction: c_int) -> c_int>

Accelerated CCM packet (one-shot) @param key The secret key to use @param keylen The length of the secret key (octets) @param uskey A previously scheduled key [optional can be NULL] @param nonce The session nonce [use once] @param noncelen The length of the nonce @param header The header for the session @param headerlen The length of the header (octets) @param pt [out] The plaintext @param ptlen The length of the plaintext (octets) @param ct [out] The ciphertext @param tag [out] The destination tag @param taglen [in/out] The max size and resulting size of the authentication tag @param direction Encrypt or Decrypt direction (0 or 1) @return CRYPT_OK if successful

§accel_gcm_memory: Option<unsafe extern "C" fn(key: *const c_uchar, keylen: c_ulong, IV: *const c_uchar, IVlen: c_ulong, adata: *const c_uchar, adatalen: c_ulong, pt: *mut c_uchar, ptlen: c_ulong, ct: *mut c_uchar, tag: *mut c_uchar, taglen: *mut c_ulong, direction: c_int) -> c_int>

Accelerated GCM packet (one shot) @param key The secret key @param keylen The length of the secret key @param IV The initialization vector @param IVlen The length of the initialization vector @param adata The additional authentication data (header) @param adatalen The length of the adata @param pt The plaintext @param ptlen The length of the plaintext (ciphertext length is the same) @param ct The ciphertext @param tag [out] The MAC tag @param taglen [in/out] The MAC tag length @param direction Encrypt or Decrypt mode (GCM_ENCRYPT or GCM_DECRYPT) @return CRYPT_OK on success

§omac_memory: Option<unsafe extern "C" fn(key: *const c_uchar, keylen: c_ulong, in_: *const c_uchar, inlen: c_ulong, out: *mut c_uchar, outlen: *mut c_ulong) -> c_int>

Accelerated one shot LTC_OMAC @param key The secret key @param keylen The key length (octets) @param in The message @param inlen Length of message (octets) @param out [out] Destination for tag @param outlen [in/out] Initial and final size of out @return CRYPT_OK on success

§xcbc_memory: Option<unsafe extern "C" fn(key: *const c_uchar, keylen: c_ulong, in_: *const c_uchar, inlen: c_ulong, out: *mut c_uchar, outlen: *mut c_ulong) -> c_int>

Accelerated one shot XCBC @param key The secret key @param keylen The key length (octets) @param in The message @param inlen Length of message (octets) @param out [out] Destination for tag @param outlen [in/out] Initial and final size of out @return CRYPT_OK on success

§f9_memory: Option<unsafe extern "C" fn(key: *const c_uchar, keylen: c_ulong, in_: *const c_uchar, inlen: c_ulong, out: *mut c_uchar, outlen: *mut c_ulong) -> c_int>

Accelerated one shot F9 @param key The secret key @param keylen The key length (octets) @param in The message @param inlen Length of message (octets) @param out [out] Destination for tag @param outlen [in/out] Initial and final size of out @return CRYPT_OK on success @remark Requires manual padding

§accel_xts_encrypt: Option<unsafe extern "C" fn(pt: *const c_uchar, ct: *mut c_uchar, blocks: c_ulong, tweak: *mut c_uchar, skey1: *mut symmetric_key, skey2: *mut symmetric_key) -> c_int>

Accelerated XTS encryption @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @param tweak The 128-bit encryption tweak (input/output). The tweak should not be encrypted on input, but next tweak will be copied encrypted on output. @param skey1 The first scheduled key context @param skey2 The second scheduled key context @return CRYPT_OK if successful

§accel_xts_decrypt: Option<unsafe extern "C" fn(ct: *const c_uchar, pt: *mut c_uchar, blocks: c_ulong, tweak: *mut c_uchar, skey1: *mut symmetric_key, skey2: *mut symmetric_key) -> c_int>

Accelerated XTS decryption @param ct Ciphertext @param pt Plaintext @param blocks The number of complete blocks to process @param tweak The 128-bit encryption tweak (input/output). The tweak should not be encrypted on input, but next tweak will be copied encrypted on output. @param skey1 The first scheduled key context @param skey2 The second scheduled key context @return CRYPT_OK if successful

Trait Implementations§

Source§

impl Clone for ltc_cipher_descriptor

Source§

fn clone(&self) -> Self

Returns a duplicate 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 Copy for ltc_cipher_descriptor

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> 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.