Merge pull request #215 from libtom/pr/lint-20170509
Another fixes related to #199
This commit is contained in:
commit
55a7eead7f
@ -54,7 +54,7 @@ int ccm_memory(int cipher,
|
|||||||
int err;
|
int err;
|
||||||
unsigned long len, L, x, y, z, CTRlen;
|
unsigned long len, L, x, y, z, CTRlen;
|
||||||
#ifdef LTC_FAST
|
#ifdef LTC_FAST
|
||||||
LTC_FAST_TYPE fastMask = -1; /* initialize fastMask at all zeroes */
|
LTC_FAST_TYPE fastMask = ~0; /* initialize fastMask at all zeroes */
|
||||||
#endif
|
#endif
|
||||||
unsigned char mask = 0xff; /* initialize mask at all zeroes */
|
unsigned char mask = 0xff; /* initialize mask at all zeroes */
|
||||||
|
|
||||||
|
@ -19,17 +19,13 @@
|
|||||||
|
|
||||||
static const struct {
|
static const struct {
|
||||||
int len;
|
int len;
|
||||||
unsigned char poly_div[MAXBLOCKSIZE],
|
unsigned char poly_mul[MAXBLOCKSIZE];
|
||||||
poly_mul[MAXBLOCKSIZE];
|
|
||||||
} polys[] = {
|
} polys[] = {
|
||||||
{
|
{
|
||||||
8,
|
8,
|
||||||
{ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D },
|
|
||||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B }
|
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B }
|
||||||
}, {
|
}, {
|
||||||
16,
|
16,
|
||||||
{ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 },
|
|
||||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87 }
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87 }
|
||||||
}
|
}
|
||||||
|
@ -265,7 +265,7 @@ int hkdf_test(void)
|
|||||||
cases[i].info, cases[i].info_l,
|
cases[i].info, cases[i].info_l,
|
||||||
cases[i].IKM, cases[i].IKM_l,
|
cases[i].IKM, cases[i].IKM_l,
|
||||||
OKM, cases[i].OKM_l)) != CRYPT_OK) {
|
OKM, cases[i].OKM_l)) != CRYPT_OK) {
|
||||||
#if 0
|
#ifdef LTC_TEST_DBG
|
||||||
printf("LTC_HKDF-%s test #%d, %s\n", cases[i].Hash, i, error_to_string(err));
|
printf("LTC_HKDF-%s test #%d, %s\n", cases[i].Hash, i, error_to_string(err));
|
||||||
#endif
|
#endif
|
||||||
return err;
|
return err;
|
||||||
@ -273,7 +273,7 @@ int hkdf_test(void)
|
|||||||
|
|
||||||
if(XMEMCMP(OKM, cases[i].OKM, (size_t)cases[i].OKM_l) != 0) {
|
if(XMEMCMP(OKM, cases[i].OKM, (size_t)cases[i].OKM_l) != 0) {
|
||||||
failed++;
|
failed++;
|
||||||
#if 0
|
#ifdef LTC_TEST_DBG
|
||||||
{
|
{
|
||||||
unsigned int j;
|
unsigned int j;
|
||||||
printf("\nLTC_HKDF-%s test #%d:\n", cases[i].Hash, cases[i].num);
|
printf("\nLTC_HKDF-%s test #%d:\n", cases[i].Hash, cases[i].num);
|
||||||
@ -288,10 +288,10 @@ int hkdf_test(void)
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
return CRYPT_ERROR;
|
return CRYPT_ERROR;
|
||||||
}
|
}
|
||||||
#endif
|
#if LTC_TEST_DBG > 1
|
||||||
#if 0
|
|
||||||
} else {
|
} else {
|
||||||
printf("LTC_HKDF-%s test #%d: Passed\n", cases[i].Hash, cases[i].num);
|
printf("LTC_HKDF-%s test #%d: Passed\n", cases[i].Hash, cases[i].num);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user