Ugochukwu Mmaduekwe 7 years ago
parent
commit
d41d3dca82

+ 0 - 99
CryptoLib/src/Crypto/Parameters/ClpIESWithCipherParameters.pas

@@ -1,99 +0,0 @@
-{ *********************************************************************************** }
-{ *                              CryptoLib Library                                  * }
-{ *                Copyright (c) 2018 - 20XX Ugochukwu Mmaduekwe                    * }
-{ *                 Github Repository <https://github.com/Xor-el>                   * }
-
-{ *  Distributed under the MIT software license, see the accompanying file LICENSE  * }
-{ *          or visit http://www.opensource.org/licenses/mit-license.php.           * }
-
-{ *                              Acknowledgements:                                  * }
-{ *                                                                                 * }
-{ *      Thanks to Sphere 10 Software (http://www.sphere10.com/) for sponsoring     * }
-{ *                           development of this library                           * }
-
-{ * ******************************************************************************* * }
-
-(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
-
-unit ClpIESWithCipherParameters;
-
-{$I ..\..\Include\CryptoLib.inc}
-
-interface
-
-uses
-  ClpIESParameters,
-  ClpIIESParameters,
-  ClpIIESWithCipherParameters,
-  ClpCryptoLibTypes;
-
-type
-
-  TIESWithCipherParameters = class(TIESParameters, IIESParameters,
-    IIESWithCipherParameters)
-
-  strict private
-  var
-    FCipherKeySize: Int32;
-    FPointCompression: Boolean;
-    FNonce: TCryptoLibByteArray;
-    function GetCipherKeySize(): Int32; inline;
-    function GetPointCompression(): Boolean; inline;
-    function GetNonce(): TCryptoLibByteArray; inline;
-  public
-    property CipherKeySize: Int32 read GetCipherKeySize;
-    property PointCompression: Boolean read GetPointCompression;
-    property Nonce: TCryptoLibByteArray read GetNonce;
-
-    /// <param name="derivation">
-    /// the derivation parameter for the KDF function.
-    /// </param>
-    /// <param name="encoding">
-    /// the encoding parameter for the KDF function.
-    /// </param>
-    /// <param name="nonce">
-    /// the iv used in the cipher engine.
-    /// </param>
-    /// <param name="MacKeySize">
-    /// the size of the MAC key (in bits).
-    /// </param>
-    /// <param name="CipherKeySize">
-    /// the size of the associated Cipher key (in bits).
-    /// </param>
-    /// <param name="PointCompression">
-    /// whether to use point compression or not in EphemeralKeyPairGenerator.
-    /// </param>
-    constructor Create(derivation, encoding, Nonce: TCryptoLibByteArray;
-      MacKeySize, CipherKeySize: Int32; PointCompression: Boolean);
-  end;
-
-implementation
-
-{ TIESWithCipherParameters }
-
-constructor TIESWithCipherParameters.Create(derivation, encoding,
-  Nonce: TCryptoLibByteArray; MacKeySize, CipherKeySize: Int32;
-  PointCompression: Boolean);
-begin
-  Inherited Create(derivation, encoding, MacKeySize);
-  FNonce := Nonce;
-  FCipherKeySize := CipherKeySize;
-  FPointCompression := PointCompression;
-end;
-
-function TIESWithCipherParameters.GetCipherKeySize: Int32;
-begin
-  result := FCipherKeySize;
-end;
-
-function TIESWithCipherParameters.GetNonce: TCryptoLibByteArray;
-begin
-  result := FNonce;
-end;
-
-function TIESWithCipherParameters.GetPointCompression: Boolean;
-begin
-  result := FPointCompression;
-end;
-
-end.

+ 0 - 87
CryptoLib/src/Crypto/Parameters/ClpIesParameters.pas

@@ -1,87 +0,0 @@
-{ *********************************************************************************** }
-{ *                              CryptoLib Library                                  * }
-{ *                Copyright (c) 2018 - 20XX Ugochukwu Mmaduekwe                    * }
-{ *                 Github Repository <https://github.com/Xor-el>                   * }
-
-{ *  Distributed under the MIT software license, see the accompanying file LICENSE  * }
-{ *          or visit http://www.opensource.org/licenses/mit-license.php.           * }
-
-{ *                              Acknowledgements:                                  * }
-{ *                                                                                 * }
-{ *      Thanks to Sphere 10 Software (http://www.sphere10.com/) for sponsoring     * }
-{ *                           development of this library                           * }
-
-{ * ******************************************************************************* * }
-
-(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
-
-unit ClpIESParameters;
-
-{$I ..\..\Include\CryptoLib.inc}
-
-interface
-
-uses
-  ClpICipherParameters,
-  ClpIIESParameters,
-  ClpCryptoLibTypes;
-
-type
-
-  /// <summary>
-  /// parameters for using an integrated cipher in stream mode.
-  /// </summary>
-  TIESParameters = class(TInterfacedObject, IIESParameters, ICipherParameters)
-
-  strict private
-  var
-    Fderivation, Fencoding: TCryptoLibByteArray;
-    FmacKeySize: Int32;
-    function GetMacKeySize(): Int32; inline;
-  public
-    function GetDerivationV(): TCryptoLibByteArray; inline;
-    function GetEncodingV(): TCryptoLibByteArray; inline;
-    property MacKeySize: Int32 read GetMacKeySize;
-
-    /// <param name="derivation">
-    /// the derivation parameter for the KDF function.
-    /// </param>
-    /// <param name="encoding">
-    /// the encoding parameter for the KDF function.
-    /// </param>
-    /// <param name="MacKeySize">
-    /// the size of the MAC key (in bits).
-    /// </param>
-    constructor Create(derivation, encoding: TCryptoLibByteArray;
-      MacKeySize: Int32);
-  end;
-
-implementation
-
-{ TIESParameters }
-
-constructor TIESParameters.Create(derivation, encoding: TCryptoLibByteArray;
-  MacKeySize: Int32);
-begin
-  Inherited Create();
-  Fderivation := derivation;
-  Fencoding := encoding;
-  FmacKeySize := MacKeySize;
-end;
-
-function TIESParameters.GetDerivationV: TCryptoLibByteArray;
-begin
-  result := Fderivation;
-end;
-
-function TIESParameters.GetEncodingV: TCryptoLibByteArray;
-begin
-  result := Fencoding;
-end;
-
-function TIESParameters.GetMacKeySize: Int32;
-begin
-  result := FmacKeySize;
-end;
-
-end.

+ 0 - 42
CryptoLib/src/Interfaces/ClpIIesParameters.pas

@@ -1,42 +0,0 @@
-{ *********************************************************************************** }
-{ *                              CryptoLib Library                                  * }
-{ *                Copyright (c) 2018 - 20XX Ugochukwu Mmaduekwe                    * }
-{ *                 Github Repository <https://github.com/Xor-el>                   * }
-
-{ *  Distributed under the MIT software license, see the accompanying file LICENSE  * }
-{ *          or visit http://www.opensource.org/licenses/mit-license.php.           * }
-
-{ *                              Acknowledgements:                                  * }
-{ *                                                                                 * }
-{ *      Thanks to Sphere 10 Software (http://www.sphere10.com/) for sponsoring     * }
-{ *                           development of this library                           * }
-
-{ * ******************************************************************************* * }
-
-(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
-
-unit ClpIIESParameters;
-
-{$I ..\Include\CryptoLib.inc}
-
-interface
-
-uses
-  ClpICipherParameters,
-  ClpCryptoLibTypes;
-
-type
-
-  IIESParameters = interface(ICipherParameters)
-    ['{F95232BB-594C-492E-AF63-C5A6822C96FD}']
-
-    function GetDerivationV(): TCryptoLibByteArray;
-    function GetEncodingV(): TCryptoLibByteArray;
-    function GetMacKeySize(): Int32;
-    property MacKeySize: Int32 read GetMacKeySize;
-
-  end;
-
-implementation
-
-end.

+ 0 - 44
CryptoLib/src/Interfaces/ClpIIesWithCipherParameters.pas

@@ -1,44 +0,0 @@
-{ *********************************************************************************** }
-{ *                              CryptoLib Library                                  * }
-{ *                Copyright (c) 2018 - 20XX Ugochukwu Mmaduekwe                    * }
-{ *                 Github Repository <https://github.com/Xor-el>                   * }
-
-{ *  Distributed under the MIT software license, see the accompanying file LICENSE  * }
-{ *          or visit http://www.opensource.org/licenses/mit-license.php.           * }
-
-{ *                              Acknowledgements:                                  * }
-{ *                                                                                 * }
-{ *      Thanks to Sphere 10 Software (http://www.sphere10.com/) for sponsoring     * }
-{ *                           development of this library                           * }
-
-{ * ******************************************************************************* * }
-
-(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
-
-unit ClpIIESWithCipherParameters;
-
-{$I ..\Include\CryptoLib.inc}
-
-interface
-
-uses
-  ClpIIESParameters,
-  ClpCryptoLibTypes;
-
-type
-
-  IIESWithCipherParameters = interface(IIESParameters)
-    ['{77F38EA8-08F2-4D0D-A8E9-F3796DCCCA54}']
-
-    function GetCipherKeySize(): Int32;
-    property CipherKeySize: Int32 read GetCipherKeySize;
-    function GetPointCompression(): Boolean;
-    property PointCompression: Boolean read GetPointCompression;
-    function GetNonce(): TCryptoLibByteArray;
-    property Nonce: TCryptoLibByteArray read GetNonce;
-
-  end;
-
-implementation
-
-end.