RFR JDK-8000415: Add support for SHA-3

Wang Weijun weijun.wang at oracle.com
Thu May 5 08:16:11 UTC 2016


> On May 5, 2016, at 11:06 AM, Wang Weijun <weijun.wang at oracle.com> wrote:
> 
> So this assumes len % 4 == 0.
> 
> If you follow this, you might need to add Unsafe.putInt for the last 4 bytes.
> 
> On the other hand, if you think len % 8 == 0 should always be true, I can do some expand-and-shrink inside SHA5.java. My DRBG chanegset is not pushed yet.

I decided not to touch ByteArrayAccess.java. Instead, for SHA-512/224, I will use

int len = engineGetDigestLength();
if (len == 28) {
   // Special case for SHA-512/224
   l2bBig(state, 0, out, ofs, 24);
   i2bBig4((int)(state[3] >> 32), out, ofs + 24);
} else {
   l2bBig(state, 0, out, ofs, len);
}

Maybe we should add a check in l2bBig etc.

Thanks
Max




More information about the security-dev mailing list