summary refs log tree commit diff
path: root/crypto/src/security
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2015-11-21 17:13:41 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2015-11-21 17:13:41 +0700
commitde4c05d989ec0e04acd3a84d07d2e79ebb29b3db (patch)
tree145dea9d9f8eee976f2265a26b433bfd52c1a45e /crypto/src/security
parentBMA-52 Fix SerpentEngine byte-ordering (diff)
downloadBouncyCastle.NET-ed25519-de4c05d989ec0e04acd3a84d07d2e79ebb29b3db.tar.xz
Add Threefish entries to factories to get tests passing
Diffstat (limited to 'crypto/src/security')
-rw-r--r--crypto/src/security/CipherUtilities.cs15
-rw-r--r--crypto/src/security/GeneratorUtilities.cs12
-rw-r--r--crypto/src/security/ParameterUtilities.cs3
3 files changed, 25 insertions, 5 deletions
diff --git a/crypto/src/security/CipherUtilities.cs b/crypto/src/security/CipherUtilities.cs
index e09eff8d6..3217f3183 100644
--- a/crypto/src/security/CipherUtilities.cs
+++ b/crypto/src/security/CipherUtilities.cs
@@ -54,6 +54,9 @@ namespace Org.BouncyCastle.Security
             SERPENT,
             SKIPJACK,
             TEA,
+            THREEFISH_256,
+            THREEFISH_512,
+            THREEFISH_1024,
             TNEPRES,
             TWOFISH,
             VMPC,
@@ -433,6 +436,15 @@ namespace Org.BouncyCastle.Security
                 case CipherAlgorithm.TEA:
                     blockCipher = new TeaEngine();
                     break;
+                case CipherAlgorithm.THREEFISH_256:
+                    blockCipher = new ThreefishEngine(ThreefishEngine.BLOCKSIZE_256);
+                    break;
+                case CipherAlgorithm.THREEFISH_512:
+                    blockCipher = new ThreefishEngine(ThreefishEngine.BLOCKSIZE_512);
+                    break;
+                case CipherAlgorithm.THREEFISH_1024:
+                    blockCipher = new ThreefishEngine(ThreefishEngine.BLOCKSIZE_1024);
+                    break;
                 case CipherAlgorithm.TNEPRES:
                     blockCipher = new TnepresEngine();
                     break;
@@ -729,6 +741,9 @@ namespace Org.BouncyCastle.Security
                 case CipherAlgorithm.SERPENT: return new SerpentEngine();
                 case CipherAlgorithm.SKIPJACK: return new SkipjackEngine();
                 case CipherAlgorithm.TEA: return new TeaEngine();
+                case CipherAlgorithm.THREEFISH_256: return new ThreefishEngine(ThreefishEngine.BLOCKSIZE_256);
+                case CipherAlgorithm.THREEFISH_512: return new ThreefishEngine(ThreefishEngine.BLOCKSIZE_512);
+                case CipherAlgorithm.THREEFISH_1024: return new ThreefishEngine(ThreefishEngine.BLOCKSIZE_1024);
                 case CipherAlgorithm.TNEPRES: return new TnepresEngine();
                 case CipherAlgorithm.TWOFISH: return new TwofishEngine();
                 case CipherAlgorithm.XTEA: return new XteaEngine();
diff --git a/crypto/src/security/GeneratorUtilities.cs b/crypto/src/security/GeneratorUtilities.cs
index 2104a67ba..3beebd05b 100644
--- a/crypto/src/security/GeneratorUtilities.cs
+++ b/crypto/src/security/GeneratorUtilities.cs
@@ -109,6 +109,9 @@ namespace Org.BouncyCastle.Security
             AddKgAlgorithm("SERPENT");
             AddKgAlgorithm("SKIPJACK");
             AddKgAlgorithm("TEA");
+            AddKgAlgorithm("THREEFISH-256");
+            AddKgAlgorithm("THREEFISH-512");
+            AddKgAlgorithm("THREEFISH-1024");
             AddKgAlgorithm("TNEPRES");
             AddKgAlgorithm("TWOFISH");
             AddKgAlgorithm("VMPC");
@@ -180,13 +183,12 @@ namespace Org.BouncyCastle.Security
             AddDefaultKeySizeEntries(160, "HMACRIPEMD160", "HMACSHA1");
             AddDefaultKeySizeEntries(192, "AES", "AES192", "CAMELLIA192", "DESEDE3", "HMACTIGER",
                 "RIJNDAEL", "SERPENT", "TNEPRES");
-            AddDefaultKeySizeEntries(224, "HMACSHA224");
+            AddDefaultKeySizeEntries(224, "HMACSHA224", "HMACSHA512/224");
             AddDefaultKeySizeEntries(256, "AES256", "CAMELLIA", "CAMELLIA256", "CAST6", "GOST28147",
-                "HC256", "HMACSHA256", "RC5-64", "RC6", "TWOFISH");
+                "HC256", "HMACSHA256", "HMACSHA512/256", "RC5-64", "RC6", "THREEFISH-256", "TWOFISH");
             AddDefaultKeySizeEntries(384, "HMACSHA384");
-            AddDefaultKeySizeEntries(512, "HMACSHA512");
-            AddDefaultKeySizeEntries(224, "HMACSHA512/224");
-            AddDefaultKeySizeEntries(256, "HMACSHA512/256");
+            AddDefaultKeySizeEntries(512, "HMACSHA512", "THREEFISH-512");
+            AddDefaultKeySizeEntries(1024, "THREEFISH-1024");
         }
 
         private static void AddDefaultKeySizeEntries(int size, params string[] algorithms)
diff --git a/crypto/src/security/ParameterUtilities.cs b/crypto/src/security/ParameterUtilities.cs
index 8fc3732f5..c12155878 100644
--- a/crypto/src/security/ParameterUtilities.cs
+++ b/crypto/src/security/ParameterUtilities.cs
@@ -104,6 +104,9 @@ namespace Org.BouncyCastle.Security
             AddAlgorithm("SERPENT");
             AddAlgorithm("SKIPJACK");
             AddAlgorithm("TEA");
+            AddAlgorithm("THREEFISH-256");
+            AddAlgorithm("THREEFISH-512");
+            AddAlgorithm("THREEFISH-1024");
             AddAlgorithm("TNEPRES");
             AddAlgorithm("TWOFISH");
             AddAlgorithm("VMPC");