On Fri, 1 Jul 2022 23:38:51 GMT, Bradford Wetmore <wetm...@openjdk.org> wrote:

>> JDK-8170762 - update Javadoc to indicate ISO10126Padding pads with random 
>> bytes, though the spec does not require random bytes
>
> Just a comment, I believe both approaches are ok.  The ISO 10126 spec says:
> 
>> When padding with octets...the first subfield (pad fill) shall consist
>> of 0 to 7 octets with arbitrary contents. 
> 
> Adam's original comment was that because the spec says "arbitrary data," we 
> could potentially just optimize the code a small bit by not having to fill 
> with random data, and rather just leave as an uninitialized field.  But using 
> random data to get some arbitrary data it is possibly a little safer since it 
> will perturb the output a little vs. using an all zero padding.
> 
> So, fine to leave has been fixed.  However, I do have further comments on the 
> doc bug.

Yes, @bradfordwetmore. Agreed. Both approaches are valid; hence just taking the 
"document the choice" approach.

-------------

PR: https://git.openjdk.org/jdk/pull/9350

Reply via email to