8286378: Address possibly lossy conversions in java.base

Reviewed-by: naoto, xuelei, bpb, alanb
This commit is contained in:
Roger Riggs 2022-05-12 16:50:36 +00:00
parent 0a6832b24c
commit 17c52789b7
32 changed files with 68 additions and 71 deletions

View file

@ -217,7 +217,7 @@ final class AESCrypt extends SymmetricCipher implements AESConstants
for (t = 0; t < 8; t++) {
cox[i][t] = B[t];
for (j = 0; j < 8; j++) {
cox[i][t] ^= A[t][j] * box[i][j];
cox[i][t] ^= (byte)(A[t][j] * box[i][j]);
}
}
}
@ -227,7 +227,7 @@ final class AESCrypt extends SymmetricCipher implements AESConstants
for (i = 0; i < 256; i++) {
S[i] = (byte)(cox[i][0] << 7);
for (t = 1; t < 8; t++) {
S[i] ^= cox[i][t] << (7-t);
S[i] ^= (byte)(cox[i][t] << (7-t));
}
Si[S[i] & 0xFF] = (byte) i;
}
@ -276,7 +276,7 @@ final class AESCrypt extends SymmetricCipher implements AESConstants
for (t = 0; t < 4; t++) {
if (i != t) {
for (j = i+1; j < 8; j++) {
AA[t][j] ^= mul(AA[i][j], AA[t][i]);
AA[t][j] ^= (byte)(mul(AA[i][j], AA[t][i]));
}
AA[t][i] = 0;
}

View file

@ -246,9 +246,9 @@ final class Poly1305 {
keyBytes[7] &= 15;
keyBytes[11] &= 15;
keyBytes[15] &= 15;
keyBytes[4] &= 252;
keyBytes[8] &= 252;
keyBytes[12] &= 252;
keyBytes[4] &= (byte)252;
keyBytes[8] &= (byte)252;
keyBytes[12] &= (byte)252;
// Create IntegerModuloP elements from the r and s values
r = ipl1305.getElement(keyBytes, 0, RS_LENGTH, (byte)0);