#[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_charname of cipher
ID: c_ucharinternal ID
min_key_length: c_intmin keysize (octets)
max_key_length: c_intmax keysize (octets)
block_length: c_intblock size (octets)
default_rounds: c_intdefault 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