mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8209129: Further improvements to cipher buffer management
Reviewed-by: weijun, igerasim
This commit is contained in:
parent
58e2f2d41c
commit
50ec35819d
15 changed files with 388 additions and 316 deletions
|
@ -25,6 +25,8 @@
|
|||
|
||||
package sun.security.provider;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import static sun.security.provider.ByteArrayAccess.*;
|
||||
|
||||
/**
|
||||
|
@ -66,7 +68,7 @@ public final class MD5 extends DigestBase {
|
|||
super("MD5", 16, 64);
|
||||
state = new int[4];
|
||||
x = new int[16];
|
||||
implReset();
|
||||
resetHashes();
|
||||
}
|
||||
|
||||
// clone this object
|
||||
|
@ -82,6 +84,12 @@ public final class MD5 extends DigestBase {
|
|||
*/
|
||||
void implReset() {
|
||||
// Load magic initialization constants.
|
||||
resetHashes();
|
||||
// clear out old data
|
||||
Arrays.fill(x, 0);
|
||||
}
|
||||
|
||||
private void resetHashes() {
|
||||
state[0] = 0x67452301;
|
||||
state[1] = 0xefcdab89;
|
||||
state[2] = 0x98badcfe;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue