Skip to content

Commit a852df9

Browse files
author
royb
committed
Merge remote-tracking branch 'origin/main' into java-25-kdf
2 parents 2ff23dd + 444055e commit a852df9

File tree

9 files changed

+105
-46
lines changed

9 files changed

+105
-46
lines changed

core/src/main/java/org/bouncycastle/crypto/agreement/SM2KeyExchange.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public void init(
5252
if (privParam instanceof ParametersWithID)
5353
{
5454
baseParam = (SM2KeyExchangePrivateParameters)((ParametersWithID)privParam).getParameters();
55-
userID = ((ParametersWithID)privParam).getID();
55+
userID = checkUserID(((ParametersWithID)privParam).getID());
5656
}
5757
else
5858
{
@@ -80,7 +80,7 @@ public byte[] calculateKey(int kLen, CipherParameters pubParam)
8080
if (pubParam instanceof ParametersWithID)
8181
{
8282
otherPub = (SM2KeyExchangePublicParameters)((ParametersWithID)pubParam).getParameters();
83-
otherUserID = ((ParametersWithID)pubParam).getID();
83+
otherUserID = checkUserID(((ParametersWithID)pubParam).getID());
8484
}
8585
else
8686
{
@@ -114,7 +114,7 @@ public byte[][] calculateKeyWithConfirmation(int kLen, byte[] confirmationTag, C
114114
if (pubParam instanceof ParametersWithID)
115115
{
116116
otherPub = (SM2KeyExchangePublicParameters)((ParametersWithID)pubParam).getParameters();
117-
otherUserID = ((ParametersWithID)pubParam).getID();
117+
otherUserID = checkUserID(((ParametersWithID)pubParam).getID());
118118
}
119119
else
120120
{
@@ -276,6 +276,7 @@ private byte[] getZ(Digest digest, byte[] userID, ECPoint pubPoint)
276276
private void addUserID(Digest digest, byte[] userID)
277277
{
278278
int len = userID.length * 8;
279+
// assert len >>> 16 == 0;
279280

280281
digest.update((byte)(len >>> 8));
281282
digest.update((byte)len);
@@ -294,4 +295,15 @@ private byte[] digestDoFinal()
294295
digest.doFinal(result, 0);
295296
return result;
296297
}
298+
299+
private static byte[] checkUserID(byte[] userID)
300+
{
301+
// The length in bits must be expressible in two bytes
302+
if (userID.length >= 8192)
303+
{
304+
throw new IllegalArgumentException("SM2 user ID must be less than 2^16 bits long");
305+
}
306+
307+
return userID;
308+
}
297309
}

core/src/main/java/org/bouncycastle/crypto/digests/Kangaroo.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package org.bouncycastle.crypto.digests;
22

3-
import org.bouncycastle.crypto.*;
3+
import org.bouncycastle.crypto.CipherParameters;
4+
import org.bouncycastle.crypto.CryptoServicePurpose;
5+
import org.bouncycastle.crypto.CryptoServicesRegistrar;
6+
import org.bouncycastle.crypto.ExtendedDigest;
7+
import org.bouncycastle.crypto.Xof;
48
import org.bouncycastle.util.Arrays;
59
import org.bouncycastle.util.Bytes;
610
import org.bouncycastle.util.Pack;
@@ -220,8 +224,6 @@ abstract static class KangarooBase
220224
*/
221225
private int theProcessed;
222226

223-
private final CryptoServicePurpose purpose;
224-
225227
/**
226228
* Constructor.
227229
*
@@ -241,7 +243,6 @@ abstract static class KangarooBase
241243

242244
/* Build personalisation */
243245
buildPersonal(null);
244-
this.purpose = purpose;
245246

246247
CryptoServicesRegistrar.checkConstraints(Utils.getDefaultProperties(this, pStrength, purpose));
247248

@@ -542,7 +543,7 @@ private static class KangarooSponge
542543
/**
543544
* The round constants.
544545
*/
545-
private static long[] KeccakRoundConstants = new long[]{0x0000000000000001L, 0x0000000000008082L,
546+
private static final long[] KeccakRoundConstants = new long[]{0x0000000000000001L, 0x0000000000008082L,
546547
0x800000000000808aL, 0x8000000080008000L, 0x000000000000808bL, 0x0000000080000001L, 0x8000000080008081L,
547548
0x8000000000008009L, 0x000000000000008aL, 0x0000000000000088L, 0x0000000080008009L, 0x000000008000000aL,
548549
0x000000008000808bL, 0x800000000000008bL, 0x8000000000008089L, 0x8000000000008003L, 0x8000000000008002L,
@@ -625,6 +626,12 @@ private void absorb(final byte[] data,
625626
int count = 0;
626627
while (count < len)
627628
{
629+
if (bytesInQueue == theRateBytes)
630+
{
631+
KangarooAbsorb(theQueue, 0);
632+
bytesInQueue = 0;
633+
}
634+
628635
if (bytesInQueue == 0 && count <= (len - theRateBytes))
629636
{
630637
do
@@ -642,12 +649,6 @@ private void absorb(final byte[] data,
642649

643650
bytesInQueue += partialBlock;
644651
count += partialBlock;
645-
646-
if (bytesInQueue == theRateBytes)
647-
{
648-
KangarooAbsorb(theQueue, 0);
649-
bytesInQueue = 0;
650-
}
651652
}
652653
}
653654
}

core/src/main/java/org/bouncycastle/crypto/signers/SM2Signer.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ public void init(boolean forSigning, CipherParameters param)
7979
baseParam = ((ParametersWithID)param).getParameters();
8080
userID = ((ParametersWithID)param).getID();
8181

82+
// The length in bits must be expressible in two bytes
8283
if (userID.length >= 8192)
8384
{
84-
throw new IllegalArgumentException("SM2 user ID must be less than 2^13 bits long");
85+
throw new IllegalArgumentException("SM2 user ID must be less than 2^16 bits long");
8586
}
8687
}
8788
else
@@ -323,6 +324,8 @@ private byte[] getZ(byte[] userID)
323324
private void addUserID(Digest digest, byte[] userID)
324325
{
325326
int len = userID.length * 8;
327+
// assert len >>> 16 == 0;
328+
326329
digest.update((byte)(len >>> 8));
327330
digest.update((byte)len);
328331
digest.update(userID, 0, userID.length);

core/src/main/jdk1.4/org/bouncycastle/util/Arrays.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,37 @@ public static boolean constantTimeAreEqual(
177177
return nonEqual == 0;
178178
}
179179

180+
public static boolean constantTimeAreEqual(int len, long[] a, int aOff, long[] b, int bOff)
181+
{
182+
if (null == a)
183+
{
184+
throw new NullPointerException("'a' cannot be null");
185+
}
186+
if (null == b)
187+
{
188+
throw new NullPointerException("'b' cannot be null");
189+
}
190+
if (len < 0)
191+
{
192+
throw new IllegalArgumentException("'len' cannot be negative");
193+
}
194+
if (aOff > (a.length - len))
195+
{
196+
throw new IndexOutOfBoundsException("'aOff' value invalid for specified length");
197+
}
198+
if (bOff > (b.length - len))
199+
{
200+
throw new IndexOutOfBoundsException("'bOff' value invalid for specified length");
201+
}
202+
203+
long d = 0;
204+
for (int i = 0; i < len; ++i)
205+
{
206+
d |= (a[aOff + i] ^ b[bOff + i]);
207+
}
208+
return 0L == d;
209+
}
210+
180211
public static int compareUnsigned(byte[] a, byte[] b)
181212
{
182213
if (a == b)

core/src/test/java/org/bouncycastle/crypto/test/KangarooTest.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
/**
1010
* Test Cases for Kangaroo12. No TestVectors are available for MarsupilamiFourteen.
11-
* Test Vectors taken from https://tools.ietf.org/html/draft-viguier-kangarootwelve-04.
11+
* Test Vectors taken from https://tools.ietf.org/html/draft-viguier-kangarootwelve-04,
12+
* and generated using the reference implementation given in https://keccak.team/files/KangarooTwelve.pdf.
1213
*/
1314
public class KangarooTest
1415
extends SimpleTest
@@ -147,7 +148,13 @@ static class Kangaroo12Test
147148
"FAB658DB63E94A246188BF7AF69A133045F46EE984C56E3C3328CAAF1AA1A583",
148149
"D848C5068CED736F4462159B9867FD4C20B808ACC3D5BC48E0B06BA0A3762EC4",
149150
"C389E5009AE57120854C2E8C64670AC01358CF4C1BAF89447A724234DC7CED74",
150-
"75D2F86A2E644566726B4FBCFC5657B9DBCF070C7B0DCA06450AB291D7443BCF"
151+
"75D2F86A2E644566726B4FBCFC5657B9DBCF070C7B0DCA06450AB291D7443BCF",
152+
"61F2AD5657F4F2632A0822138EFE20C6A68A1885E1C0643EBF5587103219301D",
153+
"CBBE9DD1E423F20003FBA7BB219491C8D1F445FA5C4199D6C6C70C9FDC101964",
154+
"77DF46FD2D22BCE26E636E02CE10F9A42AE925E071F9056A9236328DB01BA411",
155+
"711835517A182DD4BC0E816BF5C72A278B227AE0B3D68F82577F97AD3CBFCA6A",
156+
"640728E5B4BE29F04A4FFFA645CB308102170F4D2B69D61F030CDC569BC74BAC",
157+
"5D7D68B49A5D999B8699FC4EDBEF0F0B4E4E7E904FE4B2B6B10C7C922407CF66"
151158
};
152159

153160
/**
@@ -170,6 +177,12 @@ void checkDigests(final KangarooTest pTest)
170177
pTest.testKangaroo(1, false, 41, EXPECTED[11]);
171178
pTest.testKangaroo(3, false, 41*41, EXPECTED[12]);
172179
pTest.testKangaroo(7, false, 41*41*41, EXPECTED[13]);
180+
pTest.testKangaroo(165, true, 0, EXPECTED[14]);
181+
pTest.testKangaroo(166, true, 0, EXPECTED[15]);
182+
pTest.testKangaroo(167, true, 0, EXPECTED[16]);
183+
pTest.testKangaroo(8192 + 165, false, 0, EXPECTED[17]);
184+
pTest.testKangaroo(8192 + 166, false, 0, EXPECTED[18]);
185+
pTest.testKangaroo(8192 + 167, false, 0, EXPECTED[19]);
173186
}
174187
}
175188

core/src/test/java/org/bouncycastle/pqc/crypto/test/MLDSATest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void testConsistency()
7979
{
8080
AsymmetricCipherKeyPair kp = kpg.generateKeyPair();
8181

82-
Signer signer = parameters.isPreHash() ? new HashMLDSASigner() : new MLDSASigner();
82+
Signer signer = parameters.isPreHash() ? (Signer)new HashMLDSASigner() : (Signer)new MLDSASigner();
8383

8484
for (int j = 0; j < 2; ++j)
8585
{

prov/src/main/java/org/bouncycastle/jcajce/CompositeUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class CompositeUtil
3535

3636
static ASN1ObjectIdentifier getOid(String name)
3737
{
38-
ASN1ObjectIdentifier oid = algorithmOids.get(Strings.toUpperCase(name));
38+
ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier)algorithmOids.get(Strings.toUpperCase(name));
3939
if (oid == null)
4040
{
4141
throw new IllegalArgumentException("name " + name + " not recognized");

prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/compositesignatures/SignatureSpi.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.security.spec.MGF1ParameterSpec;
2020
import java.security.spec.PSSParameterSpec;
2121
import java.util.HashMap;
22+
import java.util.LinkedHashMap;
2223
import java.util.List;
2324
import java.util.Map;
2425

@@ -41,7 +42,6 @@
4142
import org.bouncycastle.jcajce.util.SpecUtil;
4243
import org.bouncycastle.util.Arrays;
4344
import org.bouncycastle.util.Exceptions;
44-
import org.bouncycastle.util.Strings;
4545
import org.bouncycastle.util.encoders.Hex;
4646

4747
/**
@@ -53,7 +53,7 @@ public class SignatureSpi
5353
//the byte encoding of the ASCII string "CompositeAlgorithmSignatures2025"
5454
private static final byte[] prefix = Hex.decode("436f6d706f73697465416c676f726974686d5369676e61747572657332303235");
5555
private static final Map<String, String> canonicalNames = new HashMap<String, String>();
56-
private static final HashMap<ASN1ObjectIdentifier, byte[]> domainSeparators = new HashMap<ASN1ObjectIdentifier, byte[]>();
56+
private static final HashMap<ASN1ObjectIdentifier, byte[]> domainSeparators = new LinkedHashMap<ASN1ObjectIdentifier, byte[]>();
5757
private static final HashMap<ASN1ObjectIdentifier, AlgorithmParameterSpec> algorithmsParameterSpecs = new HashMap<ASN1ObjectIdentifier, AlgorithmParameterSpec>();
5858
private static final String ML_DSA_44 = "ML-DSA-44";
5959
private static final String ML_DSA_65 = "ML-DSA-65";
@@ -69,25 +69,25 @@ public class SignatureSpi
6969
canonicalNames.put(NISTObjectIdentifiers.id_ml_dsa_44.getId(), ML_DSA_44);
7070
canonicalNames.put(NISTObjectIdentifiers.id_ml_dsa_65.getId(), ML_DSA_65);
7171
canonicalNames.put(NISTObjectIdentifiers.id_ml_dsa_87.getId(), ML_DSA_87);
72-
73-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA44_RSA2048_PSS_SHA256, Strings.toByteArray("COMPSIG-MLDSA44-RSA2048-PSS-SHA256"));
74-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA44_RSA2048_PKCS15_SHA256, Strings.toByteArray("COMPSIG-MLDSA44-RSA2048-PKCS15-SHA256"));
75-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA44_Ed25519_SHA512, Strings.toByteArray("COMPSIG-MLDSA44-Ed25519-SHA512"));
76-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA44_ECDSA_P256_SHA256, Strings.toByteArray("COMPSIG-MLDSA44-ECDSA-P256-SHA256"));
77-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA65_RSA3072_PSS_SHA512, Strings.toByteArray("COMPSIG-MLDSA65-RSA3072-PSS-SHA512"));
78-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA65_RSA3072_PKCS15_SHA512, Strings.toByteArray("COMPSIG-MLDSA65-RSA3072-PKCS15-SHA512"));
79-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA65_RSA4096_PSS_SHA512, Strings.toByteArray("COMPSIG-MLDSA65-RSA4096-PSS-SHA512"));
80-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA65_RSA4096_PKCS15_SHA512, Strings.toByteArray("COMPSIG-MLDSA65-RSA4096-PKCS15-SHA512"));
81-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA65_ECDSA_P256_SHA512, Strings.toByteArray("COMPSIG-MLDSA65-ECDSA-P256-SHA512"));
82-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA65_ECDSA_P384_SHA512, Strings.toByteArray("COMPSIG-MLDSA65-ECDSA-P384-SHA512"));
83-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA65_ECDSA_brainpoolP256r1_SHA512, Strings.toByteArray("COMPSIG-MLDSA65-ECDSA-BP256-SHA512"));
84-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA65_Ed25519_SHA512, Strings.toByteArray("COMPSIG-MLDSA65-Ed25519-SHA512"));
85-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA87_ECDSA_brainpoolP384r1_SHA512, Strings.toByteArray("COMPSIG-MLDSA87-ECDSA-BP384-SHA512"));
86-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA87_Ed448_SHAKE256, Strings.toByteArray("COMPSIG-MLDSA87-Ed448-SHAKE256"));
87-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA87_RSA3072_PSS_SHA512, Strings.toByteArray("COMPSIG-MLDSA87-RSA3072-PSS-SHA512"));
88-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA87_RSA4096_PSS_SHA512, Strings.toByteArray("COMPSIG-MLDSA87-RSA4096-PSS-SHA512"));
89-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA87_ECDSA_P384_SHA512, Strings.toByteArray("COMPSIG-MLDSA87-ECDSA-P384-SHA512"));
90-
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA87_ECDSA_P521_SHA512, Strings.toByteArray("COMPSIG-MLDSA87-ECDSA-P521-SHA512"));
72+
73+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA44_RSA2048_PSS_SHA256, Hex.decode("434f4d505349472d4d4c44534134342d525341323034382d5053532d534841323536")); // COMPSIG-MLDSA44-RSA2048-PSS-SHA256
74+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA44_RSA2048_PKCS15_SHA256, Hex.decode("434f4d505349472d4d4c44534134342d525341323034382d504b435331352d534841323536")); // COMPSIG-MLDSA44-RSA2048-PKCS15-SHA256
75+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA44_Ed25519_SHA512, Hex.decode("434f4d505349472d4d4c44534134342d456432353531392d534841353132")); // COMPSIG-MLDSA44-Ed25519-SHA512
76+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA44_ECDSA_P256_SHA256, Hex.decode("434f4d505349472d4d4c44534134342d45434453412d503235362d534841323536")); // COMPSIG-MLDSA44-ECDSA-P256-SHA256
77+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA65_RSA3072_PSS_SHA512, Hex.decode("434f4d505349472d4d4c44534136352d525341333037322d5053532d534841353132")); // COMPSIG-MLDSA65-RSA3072-PSS-SHA512
78+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA65_RSA3072_PKCS15_SHA512, Hex.decode("434f4d505349472d4d4c44534136352d525341333037322d504b435331352d534841353132")); // COMPSIG-MLDSA65-RSA3072-PKCS15-SHA512
79+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA65_RSA4096_PSS_SHA512, Hex.decode("434f4d505349472d4d4c44534136352d525341343039362d5053532d534841353132")); // COMPSIG-MLDSA65-RSA4096-PSS-SHA512
80+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA65_RSA4096_PKCS15_SHA512, Hex.decode("434f4d505349472d4d4c44534136352d525341343039362d504b435331352d534841353132")); // COMPSIG-MLDSA65-RSA4096-PKCS15-SHA512
81+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA65_ECDSA_P256_SHA512, Hex.decode("434f4d505349472d4d4c44534136352d45434453412d503235362d534841353132")); // COMPSIG-MLDSA65-ECDSA-P256-SHA512
82+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA65_ECDSA_P384_SHA512, Hex.decode("434f4d505349472d4d4c44534136352d45434453412d503338342d534841353132")); // COMPSIG-MLDSA65-ECDSA-P384-SHA512
83+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA65_ECDSA_brainpoolP256r1_SHA512, Hex.decode("434f4d505349472d4d4c44534136352d45434453412d42503235362d534841353132")); // COMPSIG-MLDSA65-ECDSA-BP256-SHA512
84+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA65_Ed25519_SHA512, Hex.decode("434f4d505349472d4d4c44534136352d456432353531392d534841353132")); // COMPSIG-MLDSA65-Ed25519-SHA512
85+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA87_ECDSA_brainpoolP384r1_SHA512, Hex.decode("434f4d505349472d4d4c44534138372d45434453412d42503338342d534841353132")); // COMPSIG-MLDSA87-ECDSA-BP384-SHA512
86+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA87_Ed448_SHAKE256, Hex.decode("434f4d505349472d4d4c44534138372d45643434382d5348414b45323536")); // COMPSIG-MLDSA87-Ed448-SHAKE256
87+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA87_RSA3072_PSS_SHA512, Hex.decode("434f4d505349472d4d4c44534138372d525341333037322d5053532d534841353132")); // COMPSIG-MLDSA87-RSA3072-PSS-SHA512
88+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA87_RSA4096_PSS_SHA512, Hex.decode("434f4d505349472d4d4c44534138372d525341343039362d5053532d534841353132")); // COMPSIG-MLDSA87-RSA4096-PSS-SHA512
89+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA87_ECDSA_P384_SHA512, Hex.decode("434f4d505349472d4d4c44534138372d45434453412d503338342d534841353132")); // COMPSIG-MLDSA87-ECDSA-P384-SHA512
90+
domainSeparators.put(IANAObjectIdentifiers.id_MLDSA87_ECDSA_P521_SHA512, Hex.decode("434f4d505349472d4d4c44534138372d45434453412d503532312d534841353132")); // COMPSIG-MLDSA87-ECDSA-P521-SHA512
9191

9292
algorithmsParameterSpecs.put(IANAObjectIdentifiers.id_MLDSA44_RSA2048_PSS_SHA256,
9393
new PSSParameterSpec("SHA-256", "MGF1", new MGF1ParameterSpec("SHA-256"), 32, 1));
@@ -439,15 +439,15 @@ protected boolean engineVerify(byte[] signature)
439439
throws SignatureException
440440
{
441441
int mldsaSigLen = 0;
442-
if (componentSignatures[0] instanceof org.bouncycastle.jcajce.provider.asymmetric.mldsa.SignatureSpi.MLDSA44)
442+
if (algs[0].indexOf("44") > 0)
443443
{
444444
mldsaSigLen = 2420;
445445
}
446-
else if (componentSignatures[0] instanceof org.bouncycastle.jcajce.provider.asymmetric.mldsa.SignatureSpi.MLDSA65)
446+
else if (algs[0].indexOf("65") > 0)
447447
{
448448
mldsaSigLen = 3309;
449449
}
450-
else if (componentSignatures[0] instanceof org.bouncycastle.jcajce.provider.asymmetric.mldsa.SignatureSpi.MLDSA87)
450+
else if (algs[0].indexOf("87") > 0)
451451
{
452452
mldsaSigLen = 4627;
453453
}

prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/util/BaseDeterministicOrRandomSignature.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import java.security.ProviderException;
88
import java.security.PublicKey;
99
import java.security.SecureRandom;
10-
import java.security.Signature;
1110
import java.security.SignatureException;
11+
import java.security.SignatureSpi;
1212
import java.security.spec.AlgorithmParameterSpec;
1313

1414
import org.bouncycastle.crypto.CipherParameters;
@@ -22,7 +22,7 @@
2222
import org.bouncycastle.util.Exceptions;
2323

2424
public abstract class BaseDeterministicOrRandomSignature
25-
extends Signature
25+
extends SignatureSpi
2626
{
2727
private final JcaJceHelper helper = new BCJcaJceHelper();
2828
private final AlgorithmParameterSpec originalSpec;
@@ -35,7 +35,6 @@ public abstract class BaseDeterministicOrRandomSignature
3535

3636
protected BaseDeterministicOrRandomSignature(String name)
3737
{
38-
super(name);
3938
this.originalSpec = ContextParameterSpec.EMPTY_CONTEXT_SPEC;
4039
}
4140

0 commit comments

Comments
 (0)