8285743: Ensure each IntegerPolynomial object is only created once

Reviewed-by: xuelei, ascarpino
This commit is contained in:
Weijun Wang 2022-05-09 17:18:34 +00:00
parent 29ccb8fbb8
commit 397d095f66
10 changed files with 42 additions and 491 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -48,8 +48,8 @@ final class Poly1305 {
private static final int BLOCK_LENGTH = 16;
private static final int TAG_LENGTH = 16;
private static final IntegerFieldModuloP ipl1305 =
new IntegerPolynomial1305();
private static final IntegerFieldModuloP ipl1305
= IntegerPolynomial1305.ONE;
private byte[] keyBytes;
private final byte[] block = new byte[BLOCK_LENGTH];