Upgrade libtomcrypt
This commit is contained in:
@@ -29,13 +29,12 @@ int hmac_file(int hash, const char *fname, const unsigned char *key,
|
||||
#ifdef LTC_OMAC
|
||||
|
||||
typedef struct {
|
||||
int cipher_idx,
|
||||
buflen,
|
||||
int buflen,
|
||||
blklen;
|
||||
unsigned char block[MAXBLOCKSIZE],
|
||||
prev[MAXBLOCKSIZE],
|
||||
Lu[2][MAXBLOCKSIZE];
|
||||
symmetric_key key;
|
||||
symmetric_ECB key;
|
||||
} omac_state;
|
||||
|
||||
int omac_init(omac_state *omac, int cipher, const unsigned char *key, unsigned long keylen);
|
||||
@@ -66,10 +65,9 @@ typedef struct {
|
||||
block[MAXBLOCKSIZE], /* currently accumulated block */
|
||||
checksum[MAXBLOCKSIZE]; /* current checksum */
|
||||
|
||||
symmetric_key key; /* scheduled key for cipher */
|
||||
symmetric_ECB key; /* scheduled key for cipher */
|
||||
unsigned long block_index; /* index # for current block */
|
||||
int cipher_idx, /* cipher idx */
|
||||
block_len, /* length of block */
|
||||
int block_len, /* length of block */
|
||||
buflen; /* number of bytes in the buffer */
|
||||
} pmac_state;
|
||||
|
||||
@@ -181,10 +179,9 @@ typedef struct {
|
||||
unsigned char K[3][MAXBLOCKSIZE],
|
||||
IV[MAXBLOCKSIZE];
|
||||
|
||||
symmetric_key key;
|
||||
symmetric_ECB key;
|
||||
|
||||
int cipher,
|
||||
buflen,
|
||||
int buflen,
|
||||
blocksize;
|
||||
} xcbc_state;
|
||||
|
||||
@@ -215,7 +212,7 @@ typedef struct {
|
||||
ACC[MAXBLOCKSIZE],
|
||||
IV[MAXBLOCKSIZE];
|
||||
|
||||
symmetric_key key;
|
||||
symmetric_ECB key;
|
||||
|
||||
int cipher,
|
||||
buflen,
|
||||
@@ -297,10 +294,9 @@ typedef struct {
|
||||
R[MAXBLOCKSIZE], /* R value */
|
||||
checksum[MAXBLOCKSIZE]; /* current checksum */
|
||||
|
||||
symmetric_key key; /* scheduled key for cipher */
|
||||
symmetric_ECB key; /* scheduled key for cipher */
|
||||
unsigned long block_index; /* index # for current block */
|
||||
int cipher, /* cipher idx */
|
||||
block_len; /* length of block */
|
||||
int block_len; /* length of block */
|
||||
} ocb_state;
|
||||
|
||||
int ocb_init(ocb_state *ocb, int cipher,
|
||||
@@ -359,12 +355,11 @@ typedef struct {
|
||||
aOffset_current[MAXBLOCKSIZE], /* AAD related helper variable */
|
||||
adata_buffer[MAXBLOCKSIZE]; /* AAD buffer */
|
||||
|
||||
symmetric_key key; /* scheduled key for cipher */
|
||||
symmetric_ECB key; /* scheduled key for cipher */
|
||||
int adata_buffer_bytes; /* bytes in AAD buffer */
|
||||
unsigned long ablock_index; /* index # for current adata (AAD) block */
|
||||
unsigned long block_index; /* index # for current data block */
|
||||
int cipher, /* cipher idx */
|
||||
tag_len, /* length of tag */
|
||||
int tag_len, /* length of tag */
|
||||
block_len; /* length of block */
|
||||
} ocb3_state;
|
||||
|
||||
@@ -407,14 +402,13 @@ int ocb3_test(void);
|
||||
#define CCM_DECRYPT LTC_DECRYPT
|
||||
|
||||
typedef struct {
|
||||
symmetric_ECB K;
|
||||
unsigned char PAD[16], /* flags | Nonce N | l(m) */
|
||||
ctr[16],
|
||||
CTRPAD[16];
|
||||
|
||||
symmetric_key K;
|
||||
|
||||
int cipher, /* which cipher */
|
||||
taglen, /* length of the tag (encoded in M value) */
|
||||
int taglen, /* length of the tag (encoded in M value) */
|
||||
x; /* index in PAD */
|
||||
|
||||
unsigned long L, /* L value */
|
||||
@@ -448,7 +442,7 @@ int ccm_done(ccm_state *ccm,
|
||||
|
||||
int ccm_memory(int cipher,
|
||||
const unsigned char *key, unsigned long keylen,
|
||||
symmetric_key *uskey,
|
||||
symmetric_ECB *uskey,
|
||||
const unsigned char *nonce, unsigned long noncelen,
|
||||
const unsigned char *header, unsigned long headerlen,
|
||||
unsigned char *pt, unsigned long ptlen,
|
||||
@@ -480,6 +474,7 @@ extern const unsigned char gcm_shift_table[];
|
||||
#define LTC_GCM_MODE_TEXT 2
|
||||
|
||||
typedef struct {
|
||||
symmetric_ECB K;
|
||||
unsigned char H[16], /* multiplier */
|
||||
X[16], /* accumulator */
|
||||
Y[16], /* counter */
|
||||
@@ -489,11 +484,7 @@ typedef struct {
|
||||
#ifdef LTC_GCM_TABLES
|
||||
unsigned char PC[16][256][16]; /* 16 tables of 8x128 */
|
||||
#endif
|
||||
|
||||
symmetric_key K;
|
||||
|
||||
int cipher, /* which cipher */
|
||||
ivmode, /* Which mode is the IV in? */
|
||||
int ivmode, /* Which mode is the IV in? */
|
||||
mode, /* mode the GCM code is in */
|
||||
buflen; /* length of data in buf */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user