Browse Source

simplify IES Parameter Spec

Ugochukwu Mmaduekwe 6 years ago
parent
commit
6173ffd090
1 changed files with 6 additions and 26 deletions
  1. 6 26
      src/libraries/cryptolib4pascal/ClpIESParameterSpec.pas

+ 6 - 26
src/libraries/cryptolib4pascal/ClpIESParameterSpec.pas

@@ -50,21 +50,6 @@ type
 
 
   public
   public
 
 
-    /// <summary>
-    /// Set the IES engine parameters.
-    /// </summary>
-    /// <param name="derivation">
-    /// the optional derivation vector for the KDF.
-    /// </param>
-    /// <param name="encoding">
-    /// the optional encoding vector for the KDF.
-    /// </param>
-    /// <param name="macKeySize">
-    /// the key size (in bits) for the MAC.
-    /// </param>
-    constructor Create(const derivation, encoding: TCryptoLibByteArray;
-      MacKeySize: Int32); overload;
-
     /// <summary>
     /// <summary>
     /// Set the IES engine parameters.
     /// Set the IES engine parameters.
     /// </summary>
     /// </summary>
@@ -85,7 +70,7 @@ type
     /// </param>
     /// </param>
     constructor Create(const derivation, encoding: TCryptoLibByteArray;
     constructor Create(const derivation, encoding: TCryptoLibByteArray;
       MacKeySize, CipherKeySize: Int32;
       MacKeySize, CipherKeySize: Int32;
-      const Nonce: TCryptoLibByteArray = Nil); overload;
+      const Nonce: TCryptoLibByteArray); overload;
 
 
     /// <summary>
     /// <summary>
     /// Set the IES engine parameters.
     /// Set the IES engine parameters.
@@ -109,8 +94,9 @@ type
     /// whether to use EC point compression or not (false by default)
     /// whether to use EC point compression or not (false by default)
     /// </param>
     /// </param>
     constructor Create(const derivation, encoding: TCryptoLibByteArray;
     constructor Create(const derivation, encoding: TCryptoLibByteArray;
-      MacKeySize, CipherKeySize: Int32; const Nonce: TCryptoLibByteArray;
-      UsePointCompression: Boolean); overload;
+      MacKeySize: Int32; CipherKeySize: Int32 = -1;
+      const Nonce: TCryptoLibByteArray = Nil;
+      UsePointCompression: Boolean = False); overload;
 
 
     /// <summary>
     /// <summary>
     /// Returns the derivation vector.
     /// Returns the derivation vector.
@@ -166,21 +152,15 @@ implementation
 
 
 { TIESParameterSpec }
 { TIESParameterSpec }
 
 
-constructor TIESParameterSpec.Create(const derivation,
-  encoding: TCryptoLibByteArray; MacKeySize: Int32);
-begin
-  Create(derivation, encoding, MacKeySize, -1, Nil, false);
-end;
-
 constructor TIESParameterSpec.Create(const derivation,
 constructor TIESParameterSpec.Create(const derivation,
   encoding: TCryptoLibByteArray; MacKeySize, CipherKeySize: Int32;
   encoding: TCryptoLibByteArray; MacKeySize, CipherKeySize: Int32;
   const Nonce: TCryptoLibByteArray);
   const Nonce: TCryptoLibByteArray);
 begin
 begin
-  Create(derivation, encoding, MacKeySize, CipherKeySize, Nonce, false);
+  Create(derivation, encoding, MacKeySize, CipherKeySize, Nonce, False);
 end;
 end;
 
 
 constructor TIESParameterSpec.Create(const derivation,
 constructor TIESParameterSpec.Create(const derivation,
-  encoding: TCryptoLibByteArray; MacKeySize, CipherKeySize: Int32;
+  encoding: TCryptoLibByteArray; MacKeySize: Int32; CipherKeySize: Int32;
   const Nonce: TCryptoLibByteArray; UsePointCompression: Boolean);
   const Nonce: TCryptoLibByteArray; UsePointCompression: Boolean);
 begin
 begin
   Inherited Create();
   Inherited Create();