use XMEM{CMP, CPY, SET} macros instead of standard versions
This commit is contained in:
@@ -33,7 +33,7 @@ int ccm_init(ccm_state *ccm, int cipher,
|
||||
LTC_ARGCHK(key != NULL);
|
||||
LTC_ARGCHK(taglen != 0);
|
||||
|
||||
memset(ccm, 0, sizeof(ccm_state));
|
||||
XMEMSET(ccm, 0, sizeof(ccm_state));
|
||||
|
||||
/* check cipher input */
|
||||
if ((err = cipher_is_valid(cipher)) != CRYPT_OK) {
|
||||
|
||||
@@ -329,17 +329,17 @@ if (CTR == NULL) {
|
||||
}
|
||||
}
|
||||
|
||||
// grab the CTR
|
||||
memcpy(ctrcopy, ctr, 16);
|
||||
// grab the CTR
|
||||
XMEMCPY(ctrcopy, ctr, 16);
|
||||
|
||||
/* setup CTR for the TAG (zero the count) */
|
||||
if (CTR == NULL) {
|
||||
for (y = 15; y > 15 - L; y--) {
|
||||
ctr[y] = 0x00;
|
||||
if (CTR == NULL) {
|
||||
for (y = 15; y > 15 - L; y--) {
|
||||
ctr[y] = 0x00;
|
||||
}
|
||||
} else {
|
||||
XMEMCPY(ctr, CTR, 16);
|
||||
}
|
||||
} else {
|
||||
XMEMCPY(ctr, CTR, 16);
|
||||
}
|
||||
|
||||
if ((err = cipher_descriptor[cipher].ecb_encrypt(ctr, CTRPAD, skey)) != CRYPT_OK) {
|
||||
goto error;
|
||||
|
||||
Reference in New Issue
Block a user