2
0

ClpCryptoLibTypes.pas 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. { *********************************************************************************** }
  2. { * CryptoLib Library * }
  3. { * Copyright (c) 2018 - 20XX Ugochukwu Mmaduekwe * }
  4. { * Github Repository <https://github.com/Xor-el> * }
  5. { * Distributed under the MIT software license, see the accompanying file LICENSE * }
  6. { * or visit http://www.opensource.org/licenses/mit-license.php. * }
  7. { * Acknowledgements: * }
  8. { * * }
  9. { * Thanks to Sphere 10 Software (http://www.sphere10.com/) for sponsoring * }
  10. { * development of this library * }
  11. { * ******************************************************************************* * }
  12. (* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
  13. unit ClpCryptoLibTypes;
  14. {$I ..\Include\CryptoLib.inc}
  15. interface
  16. uses
  17. SysUtils;
  18. type
  19. PIInterface = ^IInterface;
  20. {$IFDEF FPC}
  21. PUInt64 = ^UInt64;
  22. {$ENDIF FPC}
  23. ECryptoLibException = class(Exception);
  24. EInvalidCastCryptoLibException = class(EInvalidCast);
  25. EArithmeticCryptoLibException = class(ECryptoLibException);
  26. EInvalidOperationCryptoLibException = class(ECryptoLibException);
  27. EInvalidParameterCryptoLibException = class(ECryptoLibException);
  28. EIndexOutOfRangeCryptoLibException = class(ECryptoLibException);
  29. EArgumentCryptoLibException = class(ECryptoLibException);
  30. EArgumentNilCryptoLibException = class(ECryptoLibException);
  31. EArgumentOutOfRangeCryptoLibException = class(ECryptoLibException);
  32. ENullReferenceCryptoLibException = class(ECryptoLibException);
  33. EUnsupportedTypeCryptoLibException = class(ECryptoLibException);
  34. EIOCryptoLibException = class(ECryptoLibException);
  35. EFormatCryptoLibException = class(ECryptoLibException);
  36. ENotImplementedCryptoLibException = class(ECryptoLibException);
  37. ENotSupportedCryptoLibException = class(ECryptoLibException);
  38. EEndOfStreamCryptoLibException = class(EIOCryptoLibException);
  39. EStreamOverflowCryptoLibException = class(ECryptoLibException);
  40. EAsn1CryptoLibException = class(ECryptoLibException);
  41. EAsn1ParsingCryptoLibException = class(ECryptoLibException);
  42. EInvalidKeyCryptoLibException = class(ECryptoLibException);
  43. EInvalidCipherTextCryptoLibException = class(ECryptoLibException);
  44. EStreamCryptoLibException = class(ECryptoLibException);
  45. ESecurityUtilityCryptoLibException = class(ECryptoLibException);
  46. EAccessCryptoLibException = class(ECryptoLibException);
  47. EDataLengthCryptoLibException = class(ECryptoLibException);
  48. EMaxBytesExceededCryptoLibException = class(ECryptoLibException);
  49. EOutputLengthCryptoLibException = class(ECryptoLibException);
  50. EBadBlockCryptoLibException = class(ECryptoLibException);
  51. /// <summary>
  52. /// Represents a dynamic array of Byte.
  53. /// </summary>
  54. TCryptoLibByteArray = TBytes;
  55. /// <summary>
  56. /// Represents a dynamic generic array of Type T.
  57. /// </summary>
  58. TCryptoLibGenericArray<T> = array of T;
  59. /// <summary>
  60. /// Represents a dynamic generic array of array of Type T.
  61. /// </summary>
  62. TCryptoLibMatrixGenericArray<T> = array of TCryptoLibGenericArray<T>;
  63. {$IFDEF DELPHIXE_UP}
  64. /// <summary>
  65. /// Represents a dynamic array of Boolean.
  66. /// </summary>
  67. TCryptoLibBooleanArray = TArray<Boolean>;
  68. /// <summary>
  69. /// Represents a dynamic array of ShortInt.
  70. /// </summary>
  71. TCryptoLibShortIntArray = TArray<ShortInt>;
  72. /// <summary>
  73. /// Represents a dynamic array of Int32.
  74. /// </summary>
  75. TCryptoLibInt32Array = TArray<Int32>;
  76. /// <summary>
  77. /// Represents a dynamic array of Int64.
  78. /// </summary>
  79. TCryptoLibInt64Array = TArray<Int64>;
  80. /// <summary>
  81. /// Represents a dynamic array of UInt32.
  82. /// </summary>
  83. TCryptoLibUInt32Array = TArray<UInt32>;
  84. /// <summary>
  85. /// Represents a dynamic array of UInt64.
  86. /// </summary>
  87. TCryptoLibUInt64Array = TArray<UInt64>;
  88. /// <summary>
  89. /// Represents a dynamic array of String.
  90. /// </summary>
  91. TCryptoLibStringArray = TArray<String>;
  92. /// <summary>
  93. /// Represents a dynamic array of Char.
  94. /// </summary>
  95. TCryptoLibCharArray = TArray<Char>;
  96. /// <summary>
  97. /// Represents a dynamic array of array of ShortInt.
  98. /// </summary>
  99. TCryptoLibMatrixShortIntArray = TArray<TCryptoLibShortIntArray>;
  100. /// <summary>
  101. /// Represents a dynamic array of array of byte.
  102. /// </summary>
  103. TCryptoLibMatrixByteArray = TArray<TCryptoLibByteArray>;
  104. /// <summary>
  105. /// Represents a dynamic array of array of Int32.
  106. /// </summary>
  107. TCryptoLibMatrixInt32Array = TArray<TCryptoLibInt32Array>;
  108. /// <summary>
  109. /// Represents a dynamic array of array of UInt32.
  110. /// </summary>
  111. TCryptoLibMatrixUInt32Array = TArray<TCryptoLibUInt32Array>;
  112. /// <summary>
  113. /// Represents a dynamic array of array of UInt64.
  114. /// </summary>
  115. TCryptoLibMatrixUInt64Array = TArray<TCryptoLibUInt64Array>;
  116. {$ELSE}
  117. /// <summary>
  118. /// Represents a dynamic array of Boolean.
  119. /// </summary>
  120. TCryptoLibBooleanArray = array of Boolean;
  121. /// <summary>
  122. /// Represents a dynamic array of ShortInt.
  123. /// </summary>
  124. TCryptoLibShortIntArray = array of ShortInt;
  125. /// <summary>
  126. /// Represents a dynamic array of Int32.
  127. /// </summary>
  128. TCryptoLibInt32Array = array of Int32;
  129. /// <summary>
  130. /// Represents a dynamic array of Int64.
  131. /// </summary>
  132. TCryptoLibInt64Array = array of Int64;
  133. /// <summary>
  134. /// Represents a dynamic array of UInt32.
  135. /// </summary>
  136. TCryptoLibUInt32Array = array of UInt32;
  137. /// <summary>
  138. /// Represents a dynamic array of UInt64.
  139. /// </summary>
  140. TCryptoLibUInt64Array = array of UInt64;
  141. /// <summary>
  142. /// Represents a dynamic array of String.
  143. /// </summary>
  144. TCryptoLibStringArray = array of String;
  145. /// <summary>
  146. /// Represents a dynamic array of Char.
  147. /// </summary>
  148. TCryptoLibCharArray = array of Char;
  149. /// <summary>
  150. /// Represents a dynamic array of array of ShortInt.
  151. /// </summary>
  152. TCryptoLibMatrixShortIntArray = array of TCryptoLibShortIntArray;
  153. /// <summary>
  154. /// Represents a dynamic array of array of byte.
  155. /// </summary>
  156. TCryptoLibMatrixByteArray = array of TCryptoLibByteArray;
  157. /// <summary>
  158. /// Represents a dynamic array of array of Int32.
  159. /// </summary>
  160. TCryptoLibMatrixInt32Array = array of TCryptoLibInt32Array;
  161. /// <summary>
  162. /// Represents a dynamic array of array of UInt32.
  163. /// </summary>
  164. TCryptoLibMatrixUInt32Array = array of TCryptoLibUInt32Array;
  165. /// <summary>
  166. /// Represents a dynamic array of array of UInt64.
  167. /// </summary>
  168. TCryptoLibMatrixUInt64Array = array of TCryptoLibUInt64Array;
  169. {$ENDIF DELPHIXE_UP}
  170. implementation
  171. {$IFDEF FPC}
  172. initialization
  173. // Set UTF-8 in AnsiStrings, just like Lazarus
  174. SetMultiByteConversionCodePage(CP_UTF8);
  175. // SetMultiByteFileSystemCodePage(CP_UTF8); not needed, this is the default under Windows
  176. SetMultiByteRTLFileSystemCodePage(CP_UTF8);
  177. {$ENDIF FPC}
  178. end.