Re: code question for dh to kernel v6.5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 13, 2024 at 09:42:12PM +0000, HelenH Zhang wrote:
>
> at line 373:
>                 n = roundup_pow_of_two(2 * safe_prime->max_strength);
>                 WARN_ON_ONCE(n & ((1u << 6) - 1));
>                 n >>= 6; /* Convert N into units of u64. */

n is the number of 8-byte words at this point and is used as such
to allocate memory.

> at line 444:
>                 /* n is in units of u64, convert to bytes. */
>                 *key_size = n << 3;

This converts n to a number of bytes again.

> Should line 375 be: 
>                 n >>= 3;

That would break the memroy allocation.

Cheers,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux