summary refs log tree commit diff
path: root/crypto/src/security/ParameterUtilities.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2021-05-24 12:48:52 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2021-05-24 12:48:52 +0700
commit017ebcc7e78ded8046a89437dc1b56f9f1eb259f (patch)
treea34fed7d1db542e608a195129ea1e20a1a9c57bd /crypto/src/security/ParameterUtilities.cs
parentNoekeon improvements (diff)
downloadBouncyCastle.NET-ed25519-017ebcc7e78ded8046a89437dc1b56f9f1eb259f.tar.xz
Add support for ARIA
Diffstat (limited to 'crypto/src/security/ParameterUtilities.cs')
-rw-r--r--crypto/src/security/ParameterUtilities.cs40
1 files changed, 37 insertions, 3 deletions
diff --git a/crypto/src/security/ParameterUtilities.cs b/crypto/src/security/ParameterUtilities.cs
index 0ff1bdb4a..fdb8d86be 100644
--- a/crypto/src/security/ParameterUtilities.cs
+++ b/crypto/src/security/ParameterUtilities.cs
@@ -6,6 +6,7 @@ using Org.BouncyCastle.Asn1.CryptoPro;
 using Org.BouncyCastle.Asn1.Kisa;
 using Org.BouncyCastle.Asn1.Misc;
 using Org.BouncyCastle.Asn1.Nist;
+using Org.BouncyCastle.Asn1.Nsri;
 using Org.BouncyCastle.Asn1.Ntt;
 using Org.BouncyCastle.Asn1.Oiw;
 using Org.BouncyCastle.Asn1.Pkcs;
@@ -31,24 +32,58 @@ namespace Org.BouncyCastle.Security
             AddAlgorithm("AES128",
                 "2.16.840.1.101.3.4.2",
                 NistObjectIdentifiers.IdAes128Cbc,
+                NistObjectIdentifiers.IdAes128Ccm,
                 NistObjectIdentifiers.IdAes128Cfb,
                 NistObjectIdentifiers.IdAes128Ecb,
+                NistObjectIdentifiers.IdAes128Gcm,
                 NistObjectIdentifiers.IdAes128Ofb,
                 NistObjectIdentifiers.IdAes128Wrap);
             AddAlgorithm("AES192",
                 "2.16.840.1.101.3.4.22",
                 NistObjectIdentifiers.IdAes192Cbc,
+                NistObjectIdentifiers.IdAes192Ccm,
                 NistObjectIdentifiers.IdAes192Cfb,
                 NistObjectIdentifiers.IdAes192Ecb,
+                NistObjectIdentifiers.IdAes192Gcm,
                 NistObjectIdentifiers.IdAes192Ofb,
                 NistObjectIdentifiers.IdAes192Wrap);
             AddAlgorithm("AES256",
                 "2.16.840.1.101.3.4.42",
                 NistObjectIdentifiers.IdAes256Cbc,
+                NistObjectIdentifiers.IdAes256Ccm,
                 NistObjectIdentifiers.IdAes256Cfb,
                 NistObjectIdentifiers.IdAes256Ecb,
+                NistObjectIdentifiers.IdAes256Gcm,
                 NistObjectIdentifiers.IdAes256Ofb,
                 NistObjectIdentifiers.IdAes256Wrap);
+            AddAlgorithm("ARIA");
+            AddAlgorithm("ARIA128",
+                NsriObjectIdentifiers.id_aria128_cbc,
+                NsriObjectIdentifiers.id_aria128_ccm,
+                NsriObjectIdentifiers.id_aria128_cfb,
+                NsriObjectIdentifiers.id_aria128_ctr,
+                NsriObjectIdentifiers.id_aria128_ecb,
+                NsriObjectIdentifiers.id_aria128_gcm,
+                NsriObjectIdentifiers.id_aria128_ocb2,
+                NsriObjectIdentifiers.id_aria128_ofb);
+            AddAlgorithm("ARIA192",
+                NsriObjectIdentifiers.id_aria192_cbc,
+                NsriObjectIdentifiers.id_aria192_ccm,
+                NsriObjectIdentifiers.id_aria192_cfb,
+                NsriObjectIdentifiers.id_aria192_ctr,
+                NsriObjectIdentifiers.id_aria192_ecb,
+                NsriObjectIdentifiers.id_aria192_gcm,
+                NsriObjectIdentifiers.id_aria192_ocb2,
+                NsriObjectIdentifiers.id_aria192_ofb);
+            AddAlgorithm("ARIA256",
+                NsriObjectIdentifiers.id_aria256_cbc,
+                NsriObjectIdentifiers.id_aria256_ccm,
+                NsriObjectIdentifiers.id_aria256_cfb,
+                NsriObjectIdentifiers.id_aria256_ctr,
+                NsriObjectIdentifiers.id_aria256_ecb,
+                NsriObjectIdentifiers.id_aria256_gcm,
+                NsriObjectIdentifiers.id_aria256_ocb2,
+                NsriObjectIdentifiers.id_aria256_ofb);
             AddAlgorithm("BLOWFISH",
                 "1.3.6.1.4.1.3029.1.2");
             AddAlgorithm("CAMELLIA",
@@ -121,9 +156,8 @@ namespace Org.BouncyCastle.Security
 
             AddBasicIVSizeEntries(8, "BLOWFISH", "CHACHA", "DES", "DESEDE", "DESEDE3", "SALSA20");
             AddBasicIVSizeEntries(12, "CHACHA7539");
-            AddBasicIVSizeEntries(16, "AES", "AES128", "AES192", "AES256",
-                "CAMELLIA", "CAMELLIA128", "CAMELLIA192", "CAMELLIA256",
-                "NOEKEON", "SEED", "SM4");
+            AddBasicIVSizeEntries(16, "AES", "AES128", "AES192", "AES256", "ARIA", "ARIA128", "ARIA192", "ARIA256",
+                "CAMELLIA", "CAMELLIA128", "CAMELLIA192", "CAMELLIA256", "NOEKEON", "SEED", "SM4");
 
             // TODO These algorithms support an IV
             // but JCE doesn't seem to provide an AlgorithmParametersGenerator for them