summary refs log tree commit diff
path: root/crypto/src
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2018-04-17 14:05:18 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2018-04-17 14:05:18 +0700
commitc4a30a143026375f8731072ff89fcf32a5e64468 (patch)
tree8452b79a7833e4931d28aa408fbdca55111b90d5 /crypto/src
parentUpdate TSP algorithms from bc-java (diff)
downloadBouncyCastle.NET-ed25519-c4a30a143026375f8731072ff89fcf32a5e64468.tar.xz
Update TSP digest tables from bc-java
Diffstat (limited to 'crypto/src')
-rw-r--r--crypto/src/tsp/TSPUtil.cs14
1 files changed, 11 insertions, 3 deletions
diff --git a/crypto/src/tsp/TSPUtil.cs b/crypto/src/tsp/TSPUtil.cs
index dc8ed3c21..a17657472 100644
--- a/crypto/src/tsp/TSPUtil.cs
+++ b/crypto/src/tsp/TSPUtil.cs
@@ -4,9 +4,11 @@ using System.IO;
 
 using Org.BouncyCastle.Asn1;
 using Org.BouncyCastle.Asn1.CryptoPro;
+using Org.BouncyCastle.Asn1.GM;
 using Org.BouncyCastle.Asn1.Nist;
 using Org.BouncyCastle.Asn1.Oiw;
 using Org.BouncyCastle.Asn1.Pkcs;
+using Org.BouncyCastle.Asn1.Rosstandart;
 using Org.BouncyCastle.Asn1.TeleTrust;
 using Org.BouncyCastle.Asn1.X509;
 using Org.BouncyCastle.Cms;
@@ -38,6 +40,9 @@ namespace Org.BouncyCastle.Tsp
             digestLengths.Add(TeleTrusTObjectIdentifiers.RipeMD160.Id, 20);
             digestLengths.Add(TeleTrusTObjectIdentifiers.RipeMD256.Id, 32);
             digestLengths.Add(CryptoProObjectIdentifiers.GostR3411.Id, 32);
+            digestLengths.Add(RosstandartObjectIdentifiers.id_tc26_gost_3411_12_256.Id, 32);
+            digestLengths.Add(RosstandartObjectIdentifiers.id_tc26_gost_3411_12_512.Id, 64);
+            digestLengths.Add(GMObjectIdentifiers.sm3.Id, 32);
 
             digestNames.Add(PkcsObjectIdentifiers.MD5.Id, "MD5");
             digestNames.Add(OiwObjectIdentifiers.IdSha1.Id, "SHA1");
@@ -45,7 +50,7 @@ namespace Org.BouncyCastle.Tsp
             digestNames.Add(NistObjectIdentifiers.IdSha256.Id, "SHA256");
             digestNames.Add(NistObjectIdentifiers.IdSha384.Id, "SHA384");
             digestNames.Add(NistObjectIdentifiers.IdSha512.Id, "SHA512");
-            digestNames.Add(PkcsObjectIdentifiers.MD5WithRsaEncryption, "MD5");
+            digestNames.Add(PkcsObjectIdentifiers.MD5WithRsaEncryption.Id, "MD5");
 			digestNames.Add(PkcsObjectIdentifiers.Sha1WithRsaEncryption.Id, "SHA1");
             digestNames.Add(PkcsObjectIdentifiers.Sha224WithRsaEncryption.Id, "SHA224");
             digestNames.Add(PkcsObjectIdentifiers.Sha256WithRsaEncryption.Id, "SHA256");
@@ -57,8 +62,11 @@ namespace Org.BouncyCastle.Tsp
             digestNames.Add(CryptoProObjectIdentifiers.GostR3411.Id, "GOST3411");
             digestNames.Add(OiwObjectIdentifiers.DsaWithSha1.Id, "SHA1");
             digestNames.Add(OiwObjectIdentifiers.Sha1WithRsa.Id, "SHA1");
-            digestNames.Add(OiwObjectIdentifiers.MD5WithRsa, "MD5");
-		}
+            digestNames.Add(OiwObjectIdentifiers.MD5WithRsa.Id, "MD5");
+            digestNames.Add(RosstandartObjectIdentifiers.id_tc26_gost_3411_12_256.Id, "GOST3411-2012-256");
+            digestNames.Add(RosstandartObjectIdentifiers.id_tc26_gost_3411_12_512.Id, "GOST3411-2012-512");
+            digestNames.Add(GMObjectIdentifiers.sm3.Id, "SM3");
+        }
 
 
 	    /**