Another bug in CTRSP800DRBG, generate method

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Another bug in CTRSP800DRBG, generate method

Scott .
Hello Again,

The code on line 383 in the following method (1.59) version (CTRSP800DRBG.java):

public int generate(byte[] output, byte[] additionalInput, boolean predictionResistant)

Creates an additionalInput of size _seedLength which is in bits, so it is creating 256 bytes or 384 bytes instead of 32 or 48 bytes, etc.

Old:
additionalInput = new byte[_seedLength];
Should be:
additionalInput = new byte[_seedLength / 8];


Thanks,
Scott Woodward
Reply | Threaded
Open this post in threaded view
|

Re: Another bug in CTRSP800DRBG, generate method

David Hook-3

Thanks for the report.

This change has been checked in.

Regards,

David

On 10/01/18 09:15, Scott . wrote:

> Hello Again,
>
> The code on line 383 in the following method (1.59) version
> (CTRSP800DRBG.java):
>
> public int generate(byte[] output, byte[] additionalInput, boolean
> predictionResistant)
>
> Creates an additionalInput of size _seedLength which is in bits, so it
> is creating 256 bytes or 384 bytes instead of 32 or 48 bytes, etc.
>
> Old:
> additionalInput = new byte[_seedLength];
> Should be:
> additionalInput = new byte[_seedLength / 8];
>
>
> Thanks,
> Scott Woodward