Skip to content

Commit 9e43e5f

Browse files
committed
Use method arg as key length
1 parent 08658ae commit 9e43e5f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

core/src/main/java/org/bouncycastle/pqc/crypto/saber/Symmetric.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.bouncycastle.pqc.crypto.saber;
22

3-
import org.bouncycastle.crypto.Digest;
43
import org.bouncycastle.crypto.Xof;
54
import org.bouncycastle.crypto.digests.SHA256Digest;
65
import org.bouncycastle.crypto.digests.SHA3Digest;
@@ -10,7 +9,6 @@
109
import org.bouncycastle.crypto.modes.SICBlockCipher;
1110
import org.bouncycastle.crypto.params.KeyParameter;
1211
import org.bouncycastle.crypto.params.ParametersWithIV;
13-
import sun.security.provider.SHA;
1412

1513
abstract class Symmetric
1614
{
@@ -91,7 +89,7 @@ void hash_g(byte[] out, byte[] in)
9189
@Override
9290
void prf(byte[] out, byte[] in, int inLen, int outLen)
9391
{
94-
ParametersWithIV kp = new ParametersWithIV(new KeyParameter(in, 0, 32 ), new byte[16]);
92+
ParametersWithIV kp = new ParametersWithIV(new KeyParameter(in, 0, inLen), new byte[16]);
9593
cipher.init(true, kp);
9694
byte[] buf = new byte[outLen]; // TODO: there might be a more efficient way of doing this...
9795
cipher.processBytes(buf, 0, outLen, out, 0);

0 commit comments

Comments
 (0)