|
@@ -1623,7 +1623,7 @@ static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen,
|
|
|
|
|
|
crypto_cipher_setkey(tfm, pkey, 16);
|
|
crypto_cipher_setkey(tfm, pkey, 16);
|
|
counter = 0;
|
|
counter = 0;
|
|
- for (i = 0; i < (sizeof(context->coeff)/sizeof(context->coeff[0])); ) {
|
|
|
|
|
|
+ for (i = 0; i < ARRAY_SIZE(context->coeff); ) {
|
|
aes_counter[15] = (u8)(counter >> 0);
|
|
aes_counter[15] = (u8)(counter >> 0);
|
|
aes_counter[14] = (u8)(counter >> 8);
|
|
aes_counter[14] = (u8)(counter >> 8);
|
|
aes_counter[13] = (u8)(counter >> 16);
|
|
aes_counter[13] = (u8)(counter >> 16);
|
|
@@ -1632,7 +1632,7 @@ static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen,
|
|
memcpy (plain, aes_counter, 16);
|
|
memcpy (plain, aes_counter, 16);
|
|
crypto_cipher_encrypt_one(tfm, plain, plain);
|
|
crypto_cipher_encrypt_one(tfm, plain, plain);
|
|
cipher = plain;
|
|
cipher = plain;
|
|
- for (j=0; (j<16) && (i< (sizeof(context->coeff)/sizeof(context->coeff[0]))); ) {
|
|
|
|
|
|
+ for (j = 0; (j < 16) && (i < ARRAY_SIZE(context->coeff)); ) {
|
|
context->coeff[i++] = ntohl(*(u32 *)&cipher[j]);
|
|
context->coeff[i++] = ntohl(*(u32 *)&cipher[j]);
|
|
j += 4;
|
|
j += 4;
|
|
}
|
|
}
|