TrinityCore
|
#include <tomcrypt_cipher.h>
Public Attributes | |
char * | name |
unsigned char | ID |
int | min_key_length |
int | max_key_length |
int | block_length |
int | default_rounds |
int(* | setup )(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey) |
int(* | ecb_encrypt )(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) |
int(* | ecb_decrypt )(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) |
int(* | test )(void) |
void(* | done )(symmetric_key *skey) |
int(* | keysize )(int *keysize) |
int(* | accel_ecb_encrypt )(const unsigned char *pt, unsigned char *ct, unsigned long blocks, symmetric_key *skey) |
int(* | accel_ecb_decrypt )(const unsigned char *ct, unsigned char *pt, unsigned long blocks, symmetric_key *skey) |
int(* | accel_cbc_encrypt )(const unsigned char *pt, unsigned char *ct, unsigned long blocks, unsigned char *IV, symmetric_key *skey) |
int(* | accel_cbc_decrypt )(const unsigned char *ct, unsigned char *pt, unsigned long blocks, unsigned char *IV, symmetric_key *skey) |
int(* | accel_ctr_encrypt )(const unsigned char *pt, unsigned char *ct, unsigned long blocks, unsigned char *IV, int mode, symmetric_key *skey) |
int(* | accel_lrw_encrypt )(const unsigned char *pt, unsigned char *ct, unsigned long blocks, unsigned char *IV, const unsigned char *tweak, symmetric_key *skey) |
int(* | accel_lrw_decrypt )(const unsigned char *ct, unsigned char *pt, unsigned long blocks, unsigned char *IV, const unsigned char *tweak, symmetric_key *skey) |
int(* | accel_ccm_memory )(const unsigned char *key, unsigned long keylen, symmetric_key *uskey, const unsigned char *nonce, unsigned long noncelen, const unsigned char *header, unsigned long headerlen, unsigned char *pt, unsigned long ptlen, unsigned char *ct, unsigned char *tag, unsigned long *taglen, int direction) |
int(* | accel_gcm_memory )(const unsigned char *key, unsigned long keylen, const unsigned char *IV, unsigned long IVlen, const unsigned char *adata, unsigned long adatalen, unsigned char *pt, unsigned long ptlen, unsigned char *ct, unsigned char *tag, unsigned long *taglen, int direction) |
int(* | omac_memory )(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) |
int(* | xcbc_memory )(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) |
int(* | f9_memory )(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) |
cipher descriptor table, last entry has "name == NULL" to mark the end of table
int(* ltc_cipher_descriptor::accel_cbc_decrypt)(const unsigned char *ct, unsigned char *pt, unsigned long blocks, unsigned char *IV, symmetric_key *skey) |
Accelerated CBC decryption
pt | Plaintext |
ct | Ciphertext |
blocks | The number of complete blocks to process |
IV | The initial value (input/output) |
skey | The scheduled key context |
int(* ltc_cipher_descriptor::accel_cbc_encrypt)(const unsigned char *pt, unsigned char *ct, unsigned long blocks, unsigned char *IV, symmetric_key *skey) |
Accelerated CBC encryption
pt | Plaintext |
ct | Ciphertext |
blocks | The number of complete blocks to process |
IV | The initial value (input/output) |
skey | The scheduled key context |
int(* ltc_cipher_descriptor::accel_ccm_memory)(const unsigned char *key, unsigned long keylen, symmetric_key *uskey, const unsigned char *nonce, unsigned long noncelen, const unsigned char *header, unsigned long headerlen, unsigned char *pt, unsigned long ptlen, unsigned char *ct, unsigned char *tag, unsigned long *taglen, int direction) |
Accelerated CCM packet (one-shot)
key | The secret key to use |
keylen | The length of the secret key (octets) |
uskey | A previously scheduled key [optional can be NULL] |
nonce | The session nonce [use once] |
noncelen | The length of the nonce |
header | The header for the session |
headerlen | The length of the header (octets) |
pt | [out] The plaintext |
ptlen | The length of the plaintext (octets) |
ct | [out] The ciphertext |
tag | [out] The destination tag |
taglen | [in/out] The max size and resulting size of the authentication tag |
direction | Encrypt or Decrypt direction (0 or 1) |
int(* ltc_cipher_descriptor::accel_ctr_encrypt)(const unsigned char *pt, unsigned char *ct, unsigned long blocks, unsigned char *IV, int mode, symmetric_key *skey) |
Accelerated CTR encryption
pt | Plaintext |
ct | Ciphertext |
blocks | The number of complete blocks to process |
IV | The initial value (input/output) |
mode | little or big endian counter (mode=0 or mode=1) |
skey | The scheduled key context |
int(* ltc_cipher_descriptor::accel_ecb_decrypt)(const unsigned char *ct, unsigned char *pt, unsigned long blocks, symmetric_key *skey) |
Accelerated ECB decryption
pt | Plaintext |
ct | Ciphertext |
blocks | The number of complete blocks to process |
skey | The scheduled key context |
int(* ltc_cipher_descriptor::accel_ecb_encrypt)(const unsigned char *pt, unsigned char *ct, unsigned long blocks, symmetric_key *skey) |
Accelerators Accelerated ECB encryption
pt | Plaintext |
ct | Ciphertext |
blocks | The number of complete blocks to process |
skey | The scheduled key context |
int(* ltc_cipher_descriptor::accel_gcm_memory)(const unsigned char *key, unsigned long keylen, const unsigned char *IV, unsigned long IVlen, const unsigned char *adata, unsigned long adatalen, unsigned char *pt, unsigned long ptlen, unsigned char *ct, unsigned char *tag, unsigned long *taglen, int direction) |
Accelerated GCM packet (one shot)
key | The secret key |
keylen | The length of the secret key |
IV | The initial vector |
IVlen | The length of the initial vector |
adata | The additional authentication data (header) |
adatalen | The length of the adata |
pt | The plaintext |
ptlen | The length of the plaintext (ciphertext length is the same) |
ct | The ciphertext |
tag | [out] The MAC tag |
taglen | [in/out] The MAC tag length |
direction | Encrypt or Decrypt mode (GCM_ENCRYPT or GCM_DECRYPT) |
int(* ltc_cipher_descriptor::accel_lrw_decrypt)(const unsigned char *ct, unsigned char *pt, unsigned long blocks, unsigned char *IV, const unsigned char *tweak, symmetric_key *skey) |
Accelerated LRW
ct | Ciphertext |
pt | Plaintext |
blocks | The number of complete blocks to process |
IV | The initial value (input/output) |
tweak | The LRW tweak |
skey | The scheduled key context |
int(* ltc_cipher_descriptor::accel_lrw_encrypt)(const unsigned char *pt, unsigned char *ct, unsigned long blocks, unsigned char *IV, const unsigned char *tweak, symmetric_key *skey) |
Accelerated LRW
pt | Plaintext |
ct | Ciphertext |
blocks | The number of complete blocks to process |
IV | The initial value (input/output) |
tweak | The LRW tweak |
skey | The scheduled key context |
int ltc_cipher_descriptor::block_length |
block size (octets)
int ltc_cipher_descriptor::default_rounds |
default number of rounds
void(* ltc_cipher_descriptor::done)(symmetric_key *skey) |
Terminate the context
skey | The scheduled key |
int(* ltc_cipher_descriptor::ecb_decrypt)(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) |
Decrypt a block
ct | The ciphertext |
pt | [out] The plaintext |
skey | The scheduled key |
int(* ltc_cipher_descriptor::ecb_encrypt)(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) |
Encrypt a block
pt | The plaintext |
ct | [out] The ciphertext |
skey | The scheduled key |
int(* ltc_cipher_descriptor::f9_memory)(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) |
Accelerated one shot F9
key | The secret key |
keylen | The key length (octets) |
in | The message |
inlen | Length of message (octets) |
out | [out] Destination for tag |
outlen | [in/out] Initial and final size of out |
unsigned char ltc_cipher_descriptor::ID |
internal ID
int(* ltc_cipher_descriptor::keysize)(int *keysize) |
Determine a key size
keysize | [in/out] The size of the key desired and the suggested size |
int ltc_cipher_descriptor::max_key_length |
max keysize (octets)
int ltc_cipher_descriptor::min_key_length |
min keysize (octets)
char* ltc_cipher_descriptor::name |
name of cipher
int(* ltc_cipher_descriptor::omac_memory)(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) |
Accelerated one shot LTC_OMAC
key | The secret key |
keylen | The key length (octets) |
in | The message |
inlen | Length of message (octets) |
out | [out] Destination for tag |
outlen | [in/out] Initial and final size of out |
int(* ltc_cipher_descriptor::setup)(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey) |
Setup the cipher
key | The input symmetric key |
keylen | The length of the input key (octets) |
num_rounds | The requested number of rounds (0==default) |
skey | [out] The destination of the scheduled key |
int(* ltc_cipher_descriptor::test)(void) |
Test the block cipher
int(* ltc_cipher_descriptor::xcbc_memory)(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) |
Accelerated one shot XCBC
key | The secret key |
keylen | The key length (octets) |
in | The message |
inlen | Length of message (octets) |
out | [out] Destination for tag |
outlen | [in/out] Initial and final size of out |