summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2014-01-21 15:29:29 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2014-01-21 15:29:29 +0700
commitdf3c3f6b57c999421474aed2e2c53522b4da22bb (patch)
tree616ebfed7cf90fe54c2b5ec0a9e48b42b88e4d9d
parentRemove old MonoDevelop project files, since MonoDevelop now supports the Visu... (diff)
parentadded Camellia tags (diff)
downloadBouncyCastle.NET-ed25519-df3c3f6b57c999421474aed2e2c53522b4da22bb.tar.xz
Merge branch 'master' of git.bouncycastle.org:bc-csharp
-rw-r--r--crypto/src/bcpg/SymmetricKeyAlgorithmTags.cs25
-rw-r--r--crypto/src/openpgp/PgpUtilities.cs13
2 files changed, 25 insertions, 13 deletions
diff --git a/crypto/src/bcpg/SymmetricKeyAlgorithmTags.cs b/crypto/src/bcpg/SymmetricKeyAlgorithmTags.cs
index 7633b1dba..e05a48616 100644
--- a/crypto/src/bcpg/SymmetricKeyAlgorithmTags.cs
+++ b/crypto/src/bcpg/SymmetricKeyAlgorithmTags.cs
@@ -5,16 +5,19 @@ namespace Org.BouncyCastle.Bcpg
     */
     public enum SymmetricKeyAlgorithmTag
     {
-        Null = 0,        // Plaintext or unencrypted data
-        Idea = 1,        // IDEA [IDEA]
-        TripleDes = 2,  // Triple-DES (DES-EDE, as per spec -168 bit key derived from 192)
-        Cast5 = 3,       // Cast5 (128 bit key, as per RFC 2144)
-        Blowfish = 4,    // Blowfish (128 bit key, 16 rounds) [Blowfish]
-        Safer = 5,       // Safer-SK128 (13 rounds) [Safer]
-        Des = 6,         // Reserved for DES/SK
-        Aes128 = 7,     // Reserved for AES with 128-bit key
-        Aes192 = 8,     // Reserved for AES with 192-bit key
-        Aes256 = 9,     // Reserved for AES with 256-bit key
-        Twofish = 10     // Reserved for Twofish
+        Null = 0,         // Plaintext or unencrypted data
+        Idea = 1,         // IDEA [IDEA]
+        TripleDes = 2,    // Triple-DES (DES-EDE, as per spec -168 bit key derived from 192)
+        Cast5 = 3,        // Cast5 (128 bit key, as per RFC 2144)
+        Blowfish = 4,     // Blowfish (128 bit key, 16 rounds) [Blowfish]
+        Safer = 5,        // Safer-SK128 (13 rounds) [Safer]
+        Des = 6,          // Reserved for DES/SK
+        Aes128 = 7,       // Reserved for AES with 128-bit key
+        Aes192 = 8,       // Reserved for AES with 192-bit key
+        Aes256 = 9,       // Reserved for AES with 256-bit key
+        Twofish = 10,     // Reserved for Twofish
+        Camellia128 = 11, // Reserved for AES with 128-bit key
+        Camellia192 = 12, // Reserved for AES with 192-bit key
+        Camellia256 = 13  // Reserved for AES with 256-bit key
     }
 }
diff --git a/crypto/src/openpgp/PgpUtilities.cs b/crypto/src/openpgp/PgpUtilities.cs
index 7cd3dfc4f..32e37b819 100644
--- a/crypto/src/openpgp/PgpUtilities.cs
+++ b/crypto/src/openpgp/PgpUtilities.cs
@@ -97,7 +97,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp
 			return GetDigestName(hashAlgorithm) + "with" + encAlg;
         }
 
-		public static string GetSymmetricCipherName(
+	public static string GetSymmetricCipherName(
             SymmetricKeyAlgorithmTag algorithm)
         {
             switch (algorithm)
@@ -124,12 +124,18 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp
 					return "AES";
 				case SymmetricKeyAlgorithmTag.Twofish:
 					return "Twofish";
+				case SymmetricKeyAlgorithmTag.Camellia128:
+					return "Camellia";
+				case SymmetricKeyAlgorithmTag.Camellia192:
+					return "Camellia";
+				case SymmetricKeyAlgorithmTag.Camellia256:
+					return "Camellia";
 				default:
 					throw new PgpException("unknown symmetric algorithm: " + algorithm);
             }
         }
 
-		public static int GetKeySize(SymmetricKeyAlgorithmTag algorithm)
+	public static int GetKeySize(SymmetricKeyAlgorithmTag algorithm)
         {
             int keySize;
             switch (algorithm)
@@ -142,14 +148,17 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp
                 case SymmetricKeyAlgorithmTag.Blowfish:
                 case SymmetricKeyAlgorithmTag.Safer:
                 case SymmetricKeyAlgorithmTag.Aes128:
+                case SymmetricKeyAlgorithmTag.Camellia128:
                     keySize = 128;
                     break;
                 case SymmetricKeyAlgorithmTag.TripleDes:
                 case SymmetricKeyAlgorithmTag.Aes192:
+                case SymmetricKeyAlgorithmTag.Camellia192:
                     keySize = 192;
                     break;
                 case SymmetricKeyAlgorithmTag.Aes256:
                 case SymmetricKeyAlgorithmTag.Twofish:
+                case SymmetricKeyAlgorithmTag.Camellia256:
                     keySize = 256;
                     break;
                 default: