diff options
author | David Hook <dgh@cryptoworkshop.com> | 2013-05-12 09:00:04 +0400 |
---|---|---|
committer | David Hook <dgh@cryptoworkshop.com> | 2013-05-12 09:00:04 +0400 |
commit | 9f94c6cae30c0d8296564fbc146248c8da6a5ff1 (patch) | |
tree | e27d7907827b140f02c284db6cb751a758805c10 | |
parent | 87f38cced3503fe5f20e7040b93ba0fee94578ae (diff) |
BJA-447 added ecCVCDSA for SHA384 and SHA512
3 files changed, 23 insertions, 4 deletions
diff --git a/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/EC.java b/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/EC.java index 31226180..4c2ca28b 100644 --- a/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/EC.java +++ b/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/EC.java @@ -82,6 +82,8 @@ public class EC addSignatureAlgorithm(provider, "SHA1", "CVC-ECDSA", PREFIX + "SignatureSpi$ecCVCDSA", EACObjectIdentifiers.id_TA_ECDSA_SHA_1); addSignatureAlgorithm(provider, "SHA224", "CVC-ECDSA", PREFIX + "SignatureSpi$ecCVCDSA224", EACObjectIdentifiers.id_TA_ECDSA_SHA_224); addSignatureAlgorithm(provider, "SHA256", "CVC-ECDSA", PREFIX + "SignatureSpi$ecCVCDSA256", EACObjectIdentifiers.id_TA_ECDSA_SHA_256); + addSignatureAlgorithm(provider, "SHA384", "CVC-ECDSA", PREFIX + "SignatureSpi$ecCVCDSA384", EACObjectIdentifiers.id_TA_ECDSA_SHA_384); + addSignatureAlgorithm(provider, "SHA512", "CVC-ECDSA", PREFIX + "SignatureSpi$ecCVCDSA512", EACObjectIdentifiers.id_TA_ECDSA_SHA_512); } } } diff --git a/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/SignatureSpi.java b/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/SignatureSpi.java index 8fc79b86..fc3a8bb7 100644 --- a/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/SignatureSpi.java +++ b/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/SignatureSpi.java @@ -199,6 +199,24 @@ public class SignatureSpi } } + static public class ecCVCDSA384 + extends SignatureSpi + { + public ecCVCDSA384() + { + super(new SHA384Digest(), new ECDSASigner(), new CVCDSAEncoder()); + } + } + + static public class ecCVCDSA512 + extends SignatureSpi + { + public ecCVCDSA512() + { + super(new SHA512Digest(), new ECDSASigner(), new CVCDSAEncoder()); + } + } + private static class StdDSAEncoder implements DSAEncoder { diff --git a/src/test/java/org/bouncycastle/jce/provider/test/DSATest.java b/src/test/java/org/bouncycastle/jce/provider/test/DSATest.java index 080e89ee..e0478997 100644 --- a/src/test/java/org/bouncycastle/jce/provider/test/DSATest.java +++ b/src/test/java/org/bouncycastle/jce/provider/test/DSATest.java @@ -477,9 +477,6 @@ public class DSATest private void testECDSA239bitBinary(String algorithm, DERObjectIdentifier oid) throws Exception { -// BigInteger r = new BigInteger("21596333210419611985018340039034612628818151486841789642455876922391552"); -// BigInteger s = new BigInteger("197030374000731686738334997654997227052849804072198819102649413465737174"); - byte[] kData = BigIntegers.asUnsignedByteArray(new BigInteger("171278725565216523967285789236956265265265235675811949404040041670216363")); SecureRandom k = new FixedSecureRandom(kData); @@ -956,7 +953,9 @@ public class DSATest testECDSA239bitBinary("SHA1withCVC-ECDSA", EACObjectIdentifiers.id_TA_ECDSA_SHA_1); testECDSA239bitBinary("SHA224withCVC-ECDSA", EACObjectIdentifiers.id_TA_ECDSA_SHA_224); testECDSA239bitBinary("SHA256withCVC-ECDSA", EACObjectIdentifiers.id_TA_ECDSA_SHA_256); - + testECDSA239bitBinary("SHA384withCVC-ECDSA", EACObjectIdentifiers.id_TA_ECDSA_SHA_384); + testECDSA239bitBinary("SHA512withCVC-ECDSA", EACObjectIdentifiers.id_TA_ECDSA_SHA_512); + testGeneration(); testParameters(); testDSA2Parameters(); |