summary refs log tree commit diff
path: root/crypto/src/bcpg/ECDHPublicBCPGKey.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2015-10-12 15:49:54 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2015-10-12 15:49:54 +0700
commit06ba713c9b19102310675a6c58e07c68d8efb3c7 (patch)
tree2d4e747d988f74abca2a5513713e4ff0e8ed8e69 /crypto/src/bcpg/ECDHPublicBCPGKey.cs
parentAdd new file entries (diff)
downloadBouncyCastle.NET-ed25519-06ba713c9b19102310675a6c58e07c68d8efb3c7.tar.xz
Port of latest PGP tests and supporting code changes
Diffstat (limited to 'crypto/src/bcpg/ECDHPublicBCPGKey.cs')
-rw-r--r--crypto/src/bcpg/ECDHPublicBCPGKey.cs24
1 files changed, 12 insertions, 12 deletions
diff --git a/crypto/src/bcpg/ECDHPublicBCPGKey.cs b/crypto/src/bcpg/ECDHPublicBCPGKey.cs
index b85379586..dc225e31e 100644
--- a/crypto/src/bcpg/ECDHPublicBCPGKey.cs
+++ b/crypto/src/bcpg/ECDHPublicBCPGKey.cs
@@ -10,8 +10,8 @@ namespace Org.BouncyCastle.Bcpg
         : ECPublicBcpgKey
     {
         private byte reserved;
-        private byte hashFunctionId;
-        private byte symAlgorithmId;
+        private HashAlgorithmTag hashFunctionId;
+        private SymmetricKeyAlgorithmTag symAlgorithmId;
 
         /// <param name="bcpgIn">The stream to read the packet from.</param>
         public ECDHPublicBcpgKey(
@@ -26,8 +26,8 @@ namespace Org.BouncyCastle.Bcpg
             bcpgIn.ReadFully(kdfParameters);
 
             reserved = kdfParameters[0];
-            hashFunctionId = kdfParameters[1];
-            symAlgorithmId = kdfParameters[2];
+            hashFunctionId = (HashAlgorithmTag)kdfParameters[1];
+            symAlgorithmId = (SymmetricKeyAlgorithmTag)kdfParameters[2];
 
             VerifyHashAlgorithm();
             VerifySymmetricKeyAlgorithm();
@@ -36,13 +36,13 @@ namespace Org.BouncyCastle.Bcpg
         public ECDHPublicBcpgKey(
             DerObjectIdentifier oid,
             ECPoint point,
-            int hashAlgorithm,
-            int symmetricKeyAlgorithm)
+            HashAlgorithmTag hashAlgorithm,
+            SymmetricKeyAlgorithmTag symmetricKeyAlgorithm)
             : base(oid, point)
         {
             reserved = 1;
-            hashFunctionId = (byte)hashAlgorithm;
-            symAlgorithmId = (byte)symmetricKeyAlgorithm;
+            hashFunctionId = hashAlgorithm;
+            symAlgorithmId = symmetricKeyAlgorithm;
 
             VerifyHashAlgorithm();
             VerifySymmetricKeyAlgorithm();
@@ -53,12 +53,12 @@ namespace Org.BouncyCastle.Bcpg
             get { return reserved; }
         }
 
-        public virtual byte HashAlgorithm
+        public virtual HashAlgorithmTag HashAlgorithm
         {
             get { return hashFunctionId; }
         }
 
-        public virtual byte SymmetricKeyAlgorithm
+        public virtual SymmetricKeyAlgorithmTag SymmetricKeyAlgorithm
         {
             get { return symAlgorithmId; }
         }
@@ -69,8 +69,8 @@ namespace Org.BouncyCastle.Bcpg
             base.Encode(bcpgOut);
             bcpgOut.WriteByte(0x3);
             bcpgOut.WriteByte(reserved);
-            bcpgOut.WriteByte(hashFunctionId);
-            bcpgOut.WriteByte(symAlgorithmId);
+            bcpgOut.WriteByte((byte)hashFunctionId);
+            bcpgOut.WriteByte((byte)symAlgorithmId);
         }
 
         private void VerifyHashAlgorithm()