summary refs log tree commit diff
path: root/crypto/src/security
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2018-04-08 21:33:09 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2018-04-08 21:33:09 +0700
commit4ba05d3a63090a5729665d6a3dbb120c4c996482 (patch)
tree64a3b8b90070caffbec025785a2b0ce50eaccff3 /crypto/src/security
parentAdd id_at_organizationIdentifier (diff)
downloadBouncyCastle.NET-ed25519-4ba05d3a63090a5729665d6a3dbb120c4c996482.tar.xz
Update registries for digests, MACs from bc-java
Diffstat (limited to 'crypto/src/security')
-rw-r--r--crypto/src/security/DigestUtilities.cs6
-rw-r--r--crypto/src/security/GeneratorUtilities.cs33
-rw-r--r--crypto/src/security/MacUtilities.cs10
3 files changed, 39 insertions, 10 deletions
diff --git a/crypto/src/security/DigestUtilities.cs b/crypto/src/security/DigestUtilities.cs
index c6adbdd95..445304196 100644
--- a/crypto/src/security/DigestUtilities.cs
+++ b/crypto/src/security/DigestUtilities.cs
@@ -83,6 +83,12 @@ namespace Org.BouncyCastle.Security
 
             algorithms[CryptoProObjectIdentifiers.GostR3411.Id] = "GOST3411";
 
+            algorithms["KECCAK224"] = "KECCAK-224";
+            algorithms["KECCAK256"] = "KECCAK-256";
+            algorithms["KECCAK288"] = "KECCAK-288";
+            algorithms["KECCAK384"] = "KECCAK-384";
+            algorithms["KECCAK512"] = "KECCAK-512";
+
             algorithms[NistObjectIdentifiers.IdSha3_224.Id] = "SHA3-224";
             algorithms[NistObjectIdentifiers.IdSha3_256.Id] = "SHA3-256";
             algorithms[NistObjectIdentifiers.IdSha3_384.Id] = "SHA3-384";
diff --git a/crypto/src/security/GeneratorUtilities.cs b/crypto/src/security/GeneratorUtilities.cs
index 3beebd05b..db1929c16 100644
--- a/crypto/src/security/GeneratorUtilities.cs
+++ b/crypto/src/security/GeneratorUtilities.cs
@@ -8,6 +8,7 @@ using Org.BouncyCastle.Asn1.Nist;
 using Org.BouncyCastle.Asn1.Ntt;
 using Org.BouncyCastle.Asn1.Oiw;
 using Org.BouncyCastle.Asn1.Pkcs;
+using Org.BouncyCastle.Asn1.Rosstandart;
 using Org.BouncyCastle.Asn1.X9;
 using Org.BouncyCastle.Crypto;
 using Org.BouncyCastle.Crypto.Generators;
@@ -138,17 +139,28 @@ namespace Org.BouncyCastle.Security
                 PkcsObjectIdentifiers.IdHmacWithSha512);
             AddHMacKeyGenerator("SHA512/224");
             AddHMacKeyGenerator("SHA512/256");
-            AddHMacKeyGenerator("SHA3-224");
-            AddHMacKeyGenerator("SHA3-256");
-            AddHMacKeyGenerator("SHA3-384");
-            AddHMacKeyGenerator("SHA3-512");
+            AddHMacKeyGenerator("KECCAK224");
+            AddHMacKeyGenerator("KECCAK256");
+            AddHMacKeyGenerator("KECCAK288");
+            AddHMacKeyGenerator("KECCAK384");
+            AddHMacKeyGenerator("KECCAK512");
+            AddHMacKeyGenerator("SHA3-224",
+                NistObjectIdentifiers.IdHMacWithSha3_224);
+            AddHMacKeyGenerator("SHA3-256",
+                NistObjectIdentifiers.IdHMacWithSha3_256);
+            AddHMacKeyGenerator("SHA3-384",
+                NistObjectIdentifiers.IdHMacWithSha3_384);
+            AddHMacKeyGenerator("SHA3-512",
+                NistObjectIdentifiers.IdHMacWithSha3_512);
             AddHMacKeyGenerator("RIPEMD128");
             AddHMacKeyGenerator("RIPEMD160",
                 IanaObjectIdentifiers.HmacRipeMD160);
             AddHMacKeyGenerator("TIGER",
                 IanaObjectIdentifiers.HmacTiger);
-
-
+            AddHMacKeyGenerator("GOST3411-2012-256",
+                RosstandartObjectIdentifiers.id_tc26_hmac_gost_3411_12_256);
+            AddHMacKeyGenerator("GOST3411-2012-512",
+                RosstandartObjectIdentifiers.id_tc26_hmac_gost_3411_12_512);
 
             //
             // key pair generators.
@@ -183,11 +195,12 @@ namespace Org.BouncyCastle.Security
             AddDefaultKeySizeEntries(160, "HMACRIPEMD160", "HMACSHA1");
             AddDefaultKeySizeEntries(192, "AES", "AES192", "CAMELLIA192", "DESEDE3", "HMACTIGER",
                 "RIJNDAEL", "SERPENT", "TNEPRES");
-            AddDefaultKeySizeEntries(224, "HMACSHA224", "HMACSHA512/224");
+            AddDefaultKeySizeEntries(224, "HMACSHA3-224", "HMACKECCAK224", "HMACSHA224", "HMACSHA512/224");
             AddDefaultKeySizeEntries(256, "AES256", "CAMELLIA", "CAMELLIA256", "CAST6", "GOST28147",
-                "HC256", "HMACSHA256", "HMACSHA512/256", "RC5-64", "RC6", "THREEFISH-256", "TWOFISH");
-            AddDefaultKeySizeEntries(384, "HMACSHA384");
-            AddDefaultKeySizeEntries(512, "HMACSHA512", "THREEFISH-512");
+                "HC256", "HMACGOST3411-2012-256", "HMACSHA3-256", "HMACKECCAK256", "HMACSHA256", "HMACSHA512/256", "RC5-64", "RC6", "THREEFISH-256", "TWOFISH");
+            AddDefaultKeySizeEntries(288, "HMACKECCAK288");
+            AddDefaultKeySizeEntries(384, "HMACSHA3-384", "HMACKECCAK384", "HMACSHA384");
+            AddDefaultKeySizeEntries(512, "HMACGOST3411-2012-512", "HMACSHA3-512", "HMACKECCAK512", "HMACSHA512", "THREEFISH-512");
             AddDefaultKeySizeEntries(1024, "THREEFISH-1024");
         }
 
diff --git a/crypto/src/security/MacUtilities.cs b/crypto/src/security/MacUtilities.cs
index 278f3bec1..a3bf8809f 100644
--- a/crypto/src/security/MacUtilities.cs
+++ b/crypto/src/security/MacUtilities.cs
@@ -4,7 +4,9 @@ using System.Globalization;
 
 using Org.BouncyCastle.Asn1;
 using Org.BouncyCastle.Asn1.Iana;
+using Org.BouncyCastle.Asn1.Nist;
 using Org.BouncyCastle.Asn1.Pkcs;
+using Org.BouncyCastle.Asn1.Rosstandart;
 using Org.BouncyCastle.Crypto;
 using Org.BouncyCastle.Crypto.Engines;
 using Org.BouncyCastle.Crypto.Macs;
@@ -38,6 +40,14 @@ namespace Org.BouncyCastle.Security
             algorithms[PkcsObjectIdentifiers.IdHmacWithSha384.Id] = "HMAC-SHA384";
             algorithms[PkcsObjectIdentifiers.IdHmacWithSha512.Id] = "HMAC-SHA512";
 
+            algorithms[NistObjectIdentifiers.IdHMacWithSha3_224.Id] = "HMAC-SHA3-224";
+            algorithms[NistObjectIdentifiers.IdHMacWithSha3_256.Id] = "HMAC-SHA3-256";
+            algorithms[NistObjectIdentifiers.IdHMacWithSha3_384.Id] = "HMAC-SHA3-384";
+            algorithms[NistObjectIdentifiers.IdHMacWithSha3_512.Id] = "HMAC-SHA3-512";
+
+            algorithms[RosstandartObjectIdentifiers.id_tc26_hmac_gost_3411_12_256.Id] = "HMAC-GOST3411-2012-256";
+            algorithms[RosstandartObjectIdentifiers.id_tc26_hmac_gost_3411_12_512.Id] = "HMAC-GOST3411-2012-512";
+
             // TODO AESMAC?
 
             algorithms["DES"] = "DESMAC";