├── LibSodium.pas ├── README.md ├── license ├── lsDemo.cfg ├── lsDemo.dof ├── lsDemo.dpr ├── lsDemo.dproj ├── lsDemo.drc ├── lsDemo.dsk └── lsDemo.res /LibSodium.pas: -------------------------------------------------------------------------------- 1 | // Delphi Wrapper for libsodium.dll 2 | // should work with most versions of 32-bit and 64-bit Delphi/FreePascal 3 | // for 64-bit, tries to load libsodium64.dll instead of libsodium.dll, if available 4 | // 5 | // by Alexander Paul Morris, 2015-08-08 6 | // 7 | // based on libsodium 1.0.3 C DLL header files 8 | // 9 | // a bit of the initial grunt work performed by the very helpful 10 | // HeadConv 4.20 (c) 2000 by Bob Swart (aka Dr.Bob - www.drbob42.com) 11 | // 12 | // This unit is still a work in progress. I'm sure I still missed 13 | // or misunderstood a few things along the way, so feel free to submit 14 | // corrections or updates. 15 | // 16 | // for more details of the inner workings of this API, see the docs at: 17 | // http://doc.libsodium.org/ 18 | // 19 | // for a better understand of why this encryption library is useful: 20 | // https://blog.cloudflare.com/do-the-chacha-better-mobile-performance-with-cryptography/ 21 | // https://blog.cloudflare.com/a-relatively-easy-to-understand-primer-on-elliptic-curve-cryptography/ 22 | // 23 | // complete libsodium implementation in javascript using Emscripten: 24 | // https://github.com/jedisct1/libsodium.js 25 | // 26 | // the latest libsodium library releases can be found here: 27 | // http://download.libsodium.org/libsodium/releases/ 28 | // 29 | // v0.14 - 2017-09-29, updated for deprecations and new functions through libsodium 1.0.14 30 | // v0.13 - 2016-06-27, updated for deprecations through libsodium 1.0.10 31 | // v0.12 - 2015-11-02, updated for deprecations and new features through libsodium 1.0.6 32 | // v0.11 - 2015-08-08, a few minor changes for 64-bit compatibility 33 | // v0.10 - 2015-08-06, initial release 34 | // 35 | // conversion table used for C++ -> delphi types 36 | // const char ** const = PAnsiChar 37 | // const unsigned char = const : PAnsiChar 38 | // const unsigned char * = const : PAnsiChar 39 | // size_t = dwSIZE_T 40 | // size_t * const = out : dwSIZE_T 41 | // uint8_t = UINT8 42 | // unsigned char = byte 43 | // unsigned char * = PAnsiChar 44 | // unsigned char * const = PAnsiChar 45 | // unsigned long long = UINT64 46 | // void * const = Pointer 47 | 48 | 49 | {$IFDEF fpc} 50 | {$MODE delphi}{$H+} 51 | {$ENDIF} 52 | 53 | unit libsodium; 54 | 55 | 56 | interface 57 | 58 | uses SysUtils, Wintypes, WinProcs; 59 | 60 | {=> LIBSODIUM.H <=} 61 | 62 | // unsigned long long = UINT64 63 | {$IF CompilerVersion <= 15.0} { Delphi 7+ } 64 | type 65 | //SIZE_T = DWORD; 66 | UINT8 = Byte; 67 | UINT16 = WORD; 68 | UINT32 = DWORD; 69 | INT16 = SmallInt; 70 | INT32 = LongInt; 71 | {$IFEND} 72 | 73 | type 74 | dwSIZE_T = DWORD; 75 | crypto_hash_sha256_state = packed record 76 | state: Array[0..7] of UINT32; 77 | count: Array[0..1] of UINT32; 78 | buf: Array[0..63] of Byte; 79 | end {crypto_hash_sha256_state}; 80 | 81 | crypto_hash_sha512_state = packed record 82 | state: Array[0..7] of UINT64; 83 | count: Array[0..1] of UINT64; 84 | buf: Array[0..127] of Byte; 85 | end {crypto_hash_sha512_state}; 86 | 87 | crypto_auth_hmacsha256_state = packed record 88 | ictx: CRYPTO_HASH_SHA256_STATE; 89 | octx: CRYPTO_HASH_SHA256_STATE; 90 | end {crypto_auth_hmacsha256_state}; 91 | 92 | crypto_auth_hmacsha512_state = packed record 93 | ictx: CRYPTO_HASH_SHA512_STATE; 94 | octx: CRYPTO_HASH_SHA512_STATE; 95 | end {crypto_auth_hmacsha512_state}; 96 | crypto_auth_hmacsha512256_state = CRYPTO_AUTH_HMACSHA512_STATE; 97 | 98 | { //#pragma pack(push, 1) CRYPTO_ALIGN(64) = __declspec(align(64)) } 99 | crypto_generichash_blake2b_state = packed record 100 | h: Array[0..7] of UINT64; 101 | t: Array[0..1] of UINT64; 102 | f: Array[0..1] of UINT64; 103 | buf: Array[0..255] of UINT8; 104 | buflen: dwSIZE_T; 105 | last_node: UINT8; 106 | padding64: array[0..26] of byte; 107 | end {CRYPTO_ALIGN(64) crypto_generichash_blake2b_state}; 108 | { //#pragma pack(pop) } 109 | crypto_generichash_state = CRYPTO_GENERICHASH_BLAKE2B_STATE; 110 | 111 | crypto_onetimeauth_poly1305_state = packed record 112 | aligner: UINT64; 113 | opaque: Array[0..135] of Byte; 114 | end {crypto_onetimeauth_poly1305_state}; 115 | 116 | crypto_int32 = INT32; 117 | crypto_int64 = INT64; 118 | crypto_onetimeauth_state = CRYPTO_ONETIMEAUTH_POLY1305_STATE; 119 | 120 | crypto_uint16 = UINT16; 121 | crypto_uint32 = UINT32; 122 | crypto_uint64 = UINT64; 123 | crypto_uint8 = UINT8; 124 | 125 | PUINT8 = ^UINT8; 126 | 127 | 128 | const 129 | ls_crypto_aead_chacha20poly1305_KEYBYTES = 32; 130 | ls_crypto_aead_chacha20poly1305_NSECBYTES = 0; 131 | ls_crypto_aead_chacha20poly1305_NPUBBYTES = 8; 132 | ls_crypto_aead_chacha20poly1305_IETF_NPUBBYTES = 12; 133 | ls_crypto_aead_chacha20poly1305_ABYTES = 16; 134 | 135 | ls_crypto_auth_hmacsha512256_BYTES = 32; 136 | ls_crypto_auth_hmacsha512256_KEYBYTES = 32; 137 | ls_crypto_auth_BYTES = ls_crypto_auth_hmacsha512256_BYTES; 138 | ls_crypto_auth_KEYBYTES = ls_crypto_auth_hmacsha512256_KEYBYTES; 139 | ls_crypto_auth_PRIMITIVE = 'hmacsha512256'; 140 | ls_crypto_auth_hmacsha256_BYTES = 32; 141 | ls_crypto_auth_hmacsha256_KEYBYTES = 32; 142 | ls_crypto_auth_hmacsha512_BYTES = 64; 143 | ls_crypto_auth_hmacsha512_KEYBYTES = 32; 144 | 145 | ls_crypto_randombytes_SEEDBYTES = 32; 146 | ls_crypto_box_curve25519xsalsa20poly1305_SEEDBYTES = 32; 147 | ls_crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES = 32; 148 | ls_crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES = 32; 149 | ls_crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES = 32; 150 | ls_crypto_box_curve25519xsalsa20poly1305_NONCEBYTES = 24; 151 | ls_crypto_box_curve25519xsalsa20poly1305_ZEROBYTES = 32; 152 | ls_crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES = 16; 153 | ls_crypto_box_curve25519xsalsa20poly1305_MACBYTES = (ls_crypto_box_curve25519xsalsa20poly1305_ZEROBYTES - ls_crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES); 154 | ls_crypto_box_SEEDBYTES = ls_crypto_box_curve25519xsalsa20poly1305_SEEDBYTES; 155 | ls_crypto_box_PUBLICKEYBYTES = ls_crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES; 156 | ls_crypto_box_SECRETKEYBYTES = ls_crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES; 157 | ls_crypto_box_NONCEBYTES = ls_crypto_box_curve25519xsalsa20poly1305_NONCEBYTES; 158 | ls_crypto_box_MACBYTES = ls_crypto_box_curve25519xsalsa20poly1305_MACBYTES; 159 | ls_crypto_box_PRIMITIVE = 'curve25519xsalsa20poly1305'; 160 | ls_crypto_box_BEFORENMBYTES = ls_crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES; 161 | ls_crypto_box_SEALBYTES = (ls_crypto_box_PUBLICKEYBYTES + ls_crypto_box_MACBYTES); 162 | ls_crypto_box_ZEROBYTES = ls_crypto_box_curve25519xsalsa20poly1305_ZEROBYTES; 163 | ls_crypto_box_BOXZEROBYTES = ls_crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES; 164 | 165 | ls_crypto_core_hsalsa20_OUTPUTBYTES = 32; 166 | ls_crypto_core_hsalsa20_INPUTBYTES = 16; 167 | ls_crypto_core_hsalsa20_KEYBYTES = 32; 168 | ls_crypto_core_hsalsa20_CONSTBYTES = 16; 169 | ls_crypto_core_salsa20_OUTPUTBYTES = 64; 170 | ls_crypto_core_salsa20_INPUTBYTES = 16; 171 | ls_crypto_core_salsa20_KEYBYTES = 32; 172 | ls_crypto_core_salsa20_CONSTBYTES = 16; 173 | ls_crypto_core_salsa2012_OUTPUTBYTES = 64; 174 | ls_crypto_core_salsa2012_INPUTBYTES = 16; 175 | ls_crypto_core_salsa2012_KEYBYTES = 32; 176 | ls_crypto_core_salsa2012_CONSTBYTES = 16; 177 | ls_crypto_core_salsa208_OUTPUTBYTES = 64; 178 | ls_crypto_core_salsa208_INPUTBYTES = 16; 179 | ls_crypto_core_salsa208_KEYBYTES = 32; 180 | ls_crypto_core_salsa208_CONSTBYTES = 16; 181 | 182 | ls_crypto_generichash_blake2b_BYTES_MIN = 16; 183 | ls_crypto_generichash_blake2b_BYTES_MAX = 64; 184 | ls_crypto_generichash_blake2b_BYTES = 32; 185 | ls_crypto_generichash_blake2b_KEYBYTES_MIN = 16; 186 | ls_crypto_generichash_blake2b_KEYBYTES_MAX = 64; 187 | ls_crypto_generichash_blake2b_KEYBYTES = 32; 188 | ls_crypto_generichash_blake2b_SALTBYTES = 16; 189 | ls_crypto_generichash_blake2b_PERSONALBYTES = 16; 190 | 191 | ls_crypto_generichash_BYTES_MIN = ls_crypto_generichash_blake2b_BYTES_MIN; 192 | ls_crypto_generichash_BYTES_MAX = ls_crypto_generichash_blake2b_BYTES_MAX; 193 | ls_crypto_generichash_BYTES = ls_crypto_generichash_blake2b_BYTES; 194 | ls_crypto_generichash_KEYBYTES_MIN = ls_crypto_generichash_blake2b_KEYBYTES_MIN; 195 | ls_crypto_generichash_KEYBYTES_MAX = ls_crypto_generichash_blake2b_KEYBYTES_MAX; 196 | ls_crypto_generichash_KEYBYTES = ls_crypto_generichash_blake2b_KEYBYTES; 197 | ls_crypto_generichash_PRIMITIVE = 'blake2b'; 198 | 199 | ls_crypto_hash_sha256_BYTES = 32; 200 | ls_crypto_hash_sha512_BYTES = 64; 201 | 202 | ls_crypto_hash_BYTES = ls_crypto_hash_sha512_BYTES; 203 | ls_crypto_hash_PRIMITIVE = 'sha512'; 204 | 205 | ls_crypto_onetimeauth_poly1305_BYTES = 16; 206 | ls_crypto_onetimeauth_poly1305_KEYBYTES = 32; 207 | 208 | ls_crypto_onetimeauth_BYTES = ls_crypto_onetimeauth_poly1305_BYTES; 209 | ls_crypto_onetimeauth_KEYBYTES = ls_crypto_onetimeauth_poly1305_KEYBYTES; 210 | ls_crypto_onetimeauth_PRIMITIVE = 'poly1305'; 211 | 212 | ls_crypto_pwhash_scryptsalsa208sha256_SALTBYTES = 32; 213 | ls_crypto_pwhash_scryptsalsa208sha256_STRBYTES = 102; 214 | ls_crypto_pwhash_scryptsalsa208sha256_STRPREFIX = '$7$'; 215 | ls_crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE = 524288; 216 | ls_crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE = 16777216; 217 | ls_crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE = 33554432; 218 | ls_crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE = 1073741824; 219 | 220 | ls_crypto_scalarmult_curve25519_BYTES = 32; 221 | ls_crypto_scalarmult_curve25519_SCALARBYTES = 32; 222 | 223 | ls_crypto_scalarmult_BYTES = ls_crypto_scalarmult_curve25519_BYTES; 224 | ls_crypto_scalarmult_SCALARBYTES = ls_crypto_scalarmult_curve25519_SCALARBYTES; 225 | ls_crypto_scalarmult_PRIMITIVE = 'curve25519'; 226 | 227 | ls_crypto_secretbox_xsalsa20poly1305_KEYBYTES = 32; 228 | ls_crypto_secretbox_xsalsa20poly1305_NONCEBYTES = 24; 229 | ls_crypto_secretbox_xsalsa20poly1305_ZEROBYTES = 32; 230 | ls_crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES = 16; 231 | ls_crypto_secretbox_xsalsa20poly1305_MACBYTES = (ls_crypto_secretbox_xsalsa20poly1305_ZEROBYTES - ls_crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES); 232 | 233 | ls_crypto_secretbox_KEYBYTES = ls_crypto_secretbox_xsalsa20poly1305_KEYBYTES; 234 | ls_crypto_secretbox_NONCEBYTES = ls_crypto_secretbox_xsalsa20poly1305_NONCEBYTES; 235 | ls_crypto_secretbox_MACBYTES = ls_crypto_secretbox_xsalsa20poly1305_MACBYTES; 236 | ls_crypto_secretbox_ZEROBYTES = ls_crypto_secretbox_xsalsa20poly1305_ZEROBYTES; 237 | ls_crypto_secretbox_BOXZEROBYTES = ls_crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES; 238 | ls_crypto_secretbox_PRIMITIVE = 'xsalsa20poly1305'; 239 | 240 | ls_crypto_shorthash_siphash24_BYTES = 8; 241 | ls_crypto_shorthash_siphash24_KEYBYTES = 16; 242 | 243 | ls_crypto_shorthash_BYTES = ls_crypto_shorthash_siphash24_BYTES; 244 | ls_crypto_shorthash_KEYBYTES = ls_crypto_shorthash_siphash24_KEYBYTES; 245 | ls_crypto_shorthash_PRIMITIVE = 'siphash24'; 246 | 247 | ls_crypto_sign_ed25519_BYTES = 64; 248 | ls_crypto_sign_ed25519_SEEDBYTES = 32; 249 | ls_crypto_sign_ed25519_PUBLICKEYBYTES = 32; 250 | ls_crypto_sign_ed25519_SECRETKEYBYTES = (32 + 32); 251 | 252 | ls_crypto_sign_BYTES = ls_crypto_sign_ed25519_BYTES; 253 | ls_crypto_sign_SEEDBYTES = ls_crypto_sign_ed25519_SEEDBYTES; 254 | ls_crypto_sign_PUBLICKEYBYTES = ls_crypto_sign_ed25519_PUBLICKEYBYTES; 255 | ls_crypto_sign_SECRETKEYBYTES = ls_crypto_sign_ed25519_SECRETKEYBYTES; 256 | ls_crypto_sign_PRIMITIVE = 'ed25519'; 257 | 258 | ls_crypto_sign_edwards25519sha512batch_BYTES = 64; 259 | ls_crypto_sign_edwards25519sha512batch_PUBLICKEYBYTES = 32; 260 | ls_crypto_sign_edwards25519sha512batch_SECRETKEYBYTES = (32 + 32); 261 | 262 | ls_crypto_stream_chacha20_KEYBYTES = 32; 263 | ls_crypto_stream_chacha20_NONCEBYTES = 8; 264 | ls_crypto_stream_chacha20_IETF_KEYBYTES = 32; 265 | ls_crypto_stream_chacha20_IETF_NONCEBYTES = 12; 266 | ls_crypto_stream_salsa20_KEYBYTES = 32; 267 | ls_crypto_stream_salsa20_NONCEBYTES = 8; 268 | ls_crypto_stream_salsa2012_KEYBYTES = 32; 269 | ls_crypto_stream_salsa2012_NONCEBYTES = 8; 270 | ls_crypto_stream_salsa208_KEYBYTES = 32; 271 | ls_crypto_stream_salsa208_NONCEBYTES = 8; 272 | ls_crypto_stream_xsalsa20_KEYBYTES = 32; 273 | ls_crypto_stream_xsalsa20_NONCEBYTES = 24; 274 | 275 | ls_crypto_stream_KEYBYTES = ls_crypto_stream_xsalsa20_KEYBYTES; 276 | ls_crypto_stream_NONCEBYTES = ls_crypto_stream_xsalsa20_NONCEBYTES; 277 | ls_crypto_stream_PRIMITIVE = 'xsalsa20'; 278 | 279 | ls_crypto_verify_16_BYTES = 16; 280 | ls_crypto_verify_32_BYTES = 32; 281 | ls_crypto_verify_64_BYTES = 64; 282 | ls_SODIUM_VERSION_STRING = '1.0.3'; 283 | ls_SODIUM_LIBRARY_VERSION_MAJOR = 7; 284 | ls_SODIUM_LIBRARY_VERSION_MINOR = 5; 285 | 286 | 287 | type 288 | 289 | crypto_secretstream_xchacha20poly1305_state = packed record 290 | k: Array[0..ls_crypto_stream_chacha20_IETF_KEYBYTES-1] of UINT32; 291 | nonce: Array[0..ls_crypto_stream_chacha20_ietf_NONCEBYTES-1] of UINT32; 292 | _pad: Array[0..7] of Byte; 293 | end {crypto_hash_sha256_state}; 294 | 295 | Tcrypto_aead_chacha20poly1305_keybytes = function: dwSIZE_T cdecl; 296 | Tcrypto_aead_chacha20poly1305_nsecbytes = function: dwSIZE_T cdecl; 297 | Tcrypto_aead_chacha20poly1305_npubbytes = function: dwSIZE_T cdecl; 298 | Tcrypto_aead_chacha20poly1305_abytes = function: dwSIZE_T cdecl; 299 | 300 | Tcrypto_aead_chacha20poly1305_encrypt = function(const c: PAnsiChar; 301 | out clen: UINT64; 302 | const m: PAnsiChar; 303 | mlen: UINT64; 304 | const ad: PAnsiChar; 305 | adlen: UINT64; 306 | const nsec: PAnsiChar; 307 | const npub: PAnsiChar; 308 | const k: PAnsiChar): Integer cdecl; 309 | 310 | Tcrypto_aead_chacha20poly1305_decrypt = function(const m: PAnsiChar; 311 | out mlen: UINT64; 312 | const nsec: PAnsiChar; 313 | const c: PAnsiChar; 314 | clen: UINT64; 315 | const ad: PAnsiChar; 316 | adlen: UINT64; 317 | const npub: PAnsiChar; 318 | const k: PAnsiChar): Integer cdecl; 319 | 320 | Tcrypto_aead_chacha20poly1305_ietf_npubbytes = function: dwSIZE_T cdecl; 321 | 322 | Tcrypto_aead_chacha20poly1305_ietf_encrypt = function(const c: PAnsiChar; 323 | out clen: UINT64; 324 | const m: PAnsiChar; 325 | mlen: UINT64; 326 | const ad: PAnsiChar; 327 | adlen: UINT64; 328 | const nsec: PAnsiChar; 329 | const npub: PAnsiChar; 330 | const k: PAnsiChar): Integer cdecl; 331 | 332 | Tcrypto_aead_chacha20poly1305_ietf_decrypt = function(const m: PAnsiChar; 333 | out mlen: UINT64; 334 | const nsec: PAnsiChar; 335 | const c: PAnsiChar; 336 | clen: UINT64; 337 | const ad: PAnsiChar; 338 | adlen: UINT64; 339 | const npub: PAnsiChar; 340 | const k: PAnsiChar): Integer cdecl; 341 | 342 | Tcrypto_auth_bytes = function: dwSIZE_T cdecl; 343 | 344 | Tcrypto_auth_keybytes = function: dwSIZE_T cdecl; 345 | 346 | Tcrypto_auth_primitive = function: PAnsiChar cdecl; 347 | 348 | Tcrypto_auth = function(const outBuf: PAnsiChar; 349 | const inBuf: PAnsiChar; 350 | inlen: UINT64; 351 | const k: PAnsiChar): Integer cdecl; 352 | 353 | Tcrypto_auth_verify = function(const h: PAnsiChar; 354 | const inBuf: PAnsiChar; 355 | inlen: UINT64; 356 | const k: PAnsiChar): Integer cdecl; 357 | 358 | Tcrypto_auth_hmacsha256_bytes = function: dwSIZE_T cdecl; 359 | 360 | Tcrypto_auth_hmacsha256_keybytes = function: dwSIZE_T cdecl; 361 | 362 | Tcrypto_auth_hmacsha256 = function(const outBuf: PAnsiChar; 363 | const inBuf: PAnsiChar; 364 | inlen: UINT64; 365 | const k: PAnsiChar): Integer cdecl; 366 | 367 | Tcrypto_auth_hmacsha256_verify = function(const h: PAnsiChar; 368 | const inBuf: PAnsiChar; 369 | inlen: UINT64; 370 | const k: PAnsiChar): Integer cdecl; 371 | 372 | Tcrypto_auth_hmacsha256_statebytes = function: dwSIZE_T cdecl; 373 | 374 | Tcrypto_auth_hmacsha256_init = function(var state: CRYPTO_AUTH_HMACSHA256_STATE; 375 | const key: PAnsiChar; 376 | keylen: dwSIZE_T): Integer cdecl; 377 | 378 | Tcrypto_auth_hmacsha256_update = function(var state: CRYPTO_AUTH_HMACSHA256_STATE; 379 | const inBuf: PAnsiChar; 380 | inlen: UINT64): Integer cdecl; 381 | 382 | Tcrypto_auth_hmacsha256_final = function(var state: CRYPTO_AUTH_HMACSHA256_STATE; 383 | const outBuf: PAnsiChar): Integer cdecl; 384 | 385 | Tcrypto_auth_hmacsha512_bytes = function: dwSIZE_T cdecl; 386 | 387 | Tcrypto_auth_hmacsha512_keybytes = function: dwSIZE_T cdecl; 388 | 389 | Tcrypto_auth_hmacsha512 = function(const outBuf: PAnsiChar; 390 | const inBuf: PAnsiChar; 391 | inlen: UINT64; 392 | const k: PAnsiChar): Integer cdecl; 393 | 394 | Tcrypto_auth_hmacsha512_verify = function(const h: PAnsiChar; 395 | const inBuf: PAnsiChar; 396 | inlen: UINT64; 397 | const k: PAnsiChar): Integer cdecl; 398 | 399 | Tcrypto_auth_hmacsha512_statebytes = function: dwSIZE_T cdecl; 400 | 401 | Tcrypto_auth_hmacsha512_init = function(var state: CRYPTO_AUTH_HMACSHA512_STATE; 402 | const key: PAnsiChar; 403 | keylen: dwSIZE_T): Integer cdecl; 404 | 405 | Tcrypto_auth_hmacsha512_update = function(var state: CRYPTO_AUTH_HMACSHA512_STATE; 406 | const inBuf: PAnsiChar; 407 | inlen: UINT64): Integer cdecl; 408 | 409 | Tcrypto_auth_hmacsha512_final = function(var state: CRYPTO_AUTH_HMACSHA512_STATE; 410 | const outBuf: PAnsiChar): Integer cdecl; 411 | 412 | Tcrypto_auth_hmacsha512256_bytes = function: dwSIZE_T cdecl; 413 | 414 | Tcrypto_auth_hmacsha512256_keybytes = function: dwSIZE_T cdecl; 415 | 416 | Tcrypto_auth_hmacsha512256 = function(const outBuf: PAnsiChar; 417 | const inBuf: PAnsiChar; 418 | inlen: UINT64; 419 | const k: PAnsiChar): Integer cdecl; 420 | 421 | Tcrypto_auth_hmacsha512256_verify = function(const h: PAnsiChar; 422 | const inBuf: PAnsiChar; 423 | inlen: UINT64; 424 | const k: PAnsiChar): Integer cdecl; 425 | 426 | Tcrypto_auth_hmacsha512256_statebytes = function: dwSIZE_T cdecl; 427 | 428 | Tcrypto_auth_hmacsha512256_init = function(var state: CRYPTO_AUTH_HMACSHA512256_STATE; 429 | const key: PAnsiChar; 430 | keylen: dwSIZE_T): Integer cdecl; 431 | 432 | Tcrypto_auth_hmacsha512256_update = function(var state: CRYPTO_AUTH_HMACSHA512256_STATE; 433 | const inBuf: PAnsiChar; 434 | inlen: UINT64): Integer cdecl; 435 | 436 | Tcrypto_auth_hmacsha512256_final = function(var state: CRYPTO_AUTH_HMACSHA512256_STATE; 437 | const outBuf: PAnsiChar): Integer cdecl; 438 | 439 | // * THREAD SAFETY: crypto_box_keypair() is thread-safe, 440 | // * provided that you called sodium_init() once before using any 441 | // * other libsodium function. 442 | // * Other functions are always thread-safe. 443 | 444 | Tcrypto_box_seedbytes = function: dwSIZE_T cdecl; 445 | 446 | Tcrypto_box_publickeybytes = function: dwSIZE_T cdecl; 447 | 448 | Tcrypto_box_secretkeybytes = function: dwSIZE_T cdecl; 449 | 450 | tcrypto_box_noncebytes = function: dwSIZE_T cdecl; 451 | 452 | Tcrypto_box_macbytes = function: dwSIZE_T cdecl; 453 | 454 | Tcrypto_box_primitive = function: PAnsiChar cdecl; 455 | 456 | Tcrypto_box_seed_keypair = function(const pk: PAnsiChar; 457 | const sk: PAnsiChar; 458 | const seed: PAnsiChar): Integer cdecl; 459 | 460 | Tcrypto_box_keypair = function(const pk: PAnsiChar; 461 | const sk: PAnsiChar): Integer cdecl; 462 | 463 | Tcrypto_box_easy = function(const c: PAnsiChar; 464 | const m: PAnsiChar; 465 | mlen: UINT64; 466 | const n: PAnsiChar; 467 | const pk: PAnsiChar; 468 | const sk: PAnsiChar): Integer cdecl; 469 | 470 | Tcrypto_box_open_easy = function(const m: PAnsiChar; 471 | const c: PAnsiChar; 472 | clen: UINT64; 473 | const n: PAnsiChar; 474 | const pk: PAnsiChar; 475 | const sk: PAnsiChar): Integer cdecl; 476 | 477 | Tcrypto_box_detached = function(const c: PAnsiChar; 478 | const mac: PAnsiChar; 479 | const m: PAnsiChar; 480 | mlen: UINT64; 481 | const n: PAnsiChar; 482 | const pk: PAnsiChar; 483 | const sk: PAnsiChar): Integer cdecl; 484 | 485 | Tcrypto_box_open_detached = function(const m: PAnsiChar; 486 | const c: PAnsiChar; 487 | const mac: PAnsiChar; 488 | clen: UINT64; 489 | const n: PAnsiChar; 490 | const pk: PAnsiChar; 491 | const sk: PAnsiChar): Integer cdecl; 492 | 493 | // -- Precomputation interface -- } 494 | 495 | Tcrypto_box_beforenmbytes = function: dwSIZE_T cdecl; 496 | 497 | Tcrypto_box_beforenm = function(const k: PAnsiChar; 498 | const pk: PAnsiChar; 499 | const sk: PAnsiChar): Integer cdecl; 500 | 501 | Tcrypto_box_easy_afternm = function(const c: PAnsiChar; 502 | const m: PAnsiChar; 503 | mlen: UINT64; 504 | const n: PAnsiChar; 505 | const k: PAnsiChar): Integer cdecl; 506 | 507 | Tcrypto_box_open_easy_afternm = function(const m: PAnsiChar; 508 | const c: PAnsiChar; 509 | clen: UINT64; 510 | const n: PAnsiChar; 511 | const k: PAnsiChar): Integer cdecl; 512 | 513 | Tcrypto_box_detached_afternm = function(const c: PAnsiChar; 514 | const mac: PAnsiChar; 515 | const m: PAnsiChar; 516 | mlen: UINT64; 517 | const n: PAnsiChar; 518 | const k: PAnsiChar): Integer cdecl; 519 | 520 | Tcrypto_box_open_detached_afternm = function(const m: PAnsiChar; 521 | const c: PAnsiChar; 522 | const mac: PAnsiChar; 523 | clen: UINT64; 524 | const n: PAnsiChar; 525 | const k: PAnsiChar): Integer cdecl; 526 | 527 | // -- Ephemeral SK interface -- } 528 | 529 | Tcrypto_box_sealbytes = function: dwSIZE_T cdecl; 530 | 531 | Tcrypto_box_seal = function(const c: PAnsiChar; 532 | const m: PAnsiChar; 533 | mlen: UINT64; 534 | const pk: PAnsiChar): Integer cdecl; 535 | 536 | Tcrypto_box_seal_open = function(const m: PAnsiChar; 537 | const c: PAnsiChar; 538 | clen: UINT64; 539 | const pk: PAnsiChar; 540 | const sk: PAnsiChar): Integer cdecl; 541 | 542 | // -- NaCl compatibility interface ; Requires padding -- } 543 | 544 | Tcrypto_box_zerobytes = function: dwSIZE_T cdecl; 545 | 546 | Tcrypto_box_boxzerobytes = function: dwSIZE_T cdecl; 547 | 548 | Tcrypto_box = function(const c: PAnsiChar; 549 | const m: PAnsiChar; 550 | mlen: UINT64; 551 | const n: PAnsiChar; 552 | const pk: PAnsiChar; 553 | const sk: PAnsiChar): Integer cdecl; 554 | 555 | Tcrypto_box_open = function(const m: PAnsiChar; 556 | const c: PAnsiChar; 557 | clen: UINT64; 558 | const n: PAnsiChar; 559 | const pk: PAnsiChar; 560 | const sk: PAnsiChar): Integer cdecl; 561 | 562 | Tcrypto_box_afternm = function(const c: PAnsiChar; 563 | const m: PAnsiChar; 564 | mlen: UINT64; 565 | const n: PAnsiChar; 566 | const k: PAnsiChar): Integer cdecl; 567 | 568 | Tcrypto_box_open_afternm = function(const m: PAnsiChar; 569 | const c: PAnsiChar; 570 | clen: UINT64; 571 | const n: PAnsiChar; 572 | const k: PAnsiChar): Integer cdecl; 573 | 574 | Tcrypto_box_curve25519xsalsa20poly1305_seedbytes = function: dwSIZE_T cdecl; 575 | 576 | Tcrypto_box_curve25519xsalsa20poly1305_publickeybytes = function: dwSIZE_T cdecl; 577 | 578 | Tcrypto_box_curve25519xsalsa20poly1305_secretkeybytes = function: dwSIZE_T cdecl; 579 | 580 | Tcrypto_box_curve25519xsalsa20poly1305_beforenmbytes = function: dwSIZE_T cdecl; 581 | 582 | Tcrypto_box_curve25519xsalsa20poly1305_noncebytes = function: dwSIZE_T cdecl; 583 | 584 | Tcrypto_box_curve25519xsalsa20poly1305_zerobytes = function: dwSIZE_T cdecl; 585 | 586 | Tcrypto_box_curve25519xsalsa20poly1305_boxzerobytes = function: dwSIZE_T cdecl; 587 | 588 | Tcrypto_box_curve25519xsalsa20poly1305_macbytes = function: dwSIZE_T cdecl; 589 | 590 | Tcrypto_box_curve25519xsalsa20poly1305 = function(const c: PAnsiChar; 591 | const m: PAnsiChar; 592 | mlen: UINT64; 593 | const n: PAnsiChar; 594 | const pk: PAnsiChar; 595 | const sk: PAnsiChar): Integer cdecl; 596 | 597 | Tcrypto_box_curve25519xsalsa20poly1305_open = function(const m: PAnsiChar; 598 | const c: PAnsiChar; 599 | clen: UINT64; 600 | const n: PAnsiChar; 601 | const pk: PAnsiChar; 602 | const sk: PAnsiChar): Integer cdecl; 603 | 604 | Tcrypto_box_curve25519xsalsa20poly1305_seed_keypair = function(var pk: Byte; 605 | var sk: Byte; 606 | const seed: PAnsiChar): Integer cdecl; 607 | 608 | Tcrypto_box_curve25519xsalsa20poly1305_keypair = function(const pk: PAnsiChar; 609 | const sk: PAnsiChar): Integer cdecl; 610 | 611 | Tcrypto_box_curve25519xsalsa20poly1305_beforenm = function(const k: PAnsiChar; 612 | const pk: PAnsiChar; 613 | const sk: PAnsiChar): Integer cdecl; 614 | 615 | Tcrypto_box_curve25519xsalsa20poly1305_afternm = function(const c: PAnsiChar; 616 | const m: PAnsiChar; 617 | mlen: UINT64; 618 | const n: PAnsiChar; 619 | const k: PAnsiChar): Integer cdecl; 620 | 621 | Tcrypto_box_curve25519xsalsa20poly1305_open_afternm = function(const m: PAnsiChar; 622 | const c: PAnsiChar; 623 | clen: UINT64; 624 | const n: PAnsiChar; 625 | const k: PAnsiChar): Integer cdecl; 626 | 627 | Tcrypto_core_hsalsa20_outputbytes = function: dwSIZE_T cdecl; 628 | 629 | Tcrypto_core_hsalsa20_inputbytes = function: dwSIZE_T cdecl; 630 | 631 | Tcrypto_core_hsalsa20_keybytes = function: dwSIZE_T cdecl; 632 | 633 | Tcrypto_core_hsalsa20_constbytes = function: dwSIZE_T cdecl; 634 | 635 | Tcrypto_core_hsalsa20 = function(const outBuf: PAnsiChar; 636 | const inBuf: PAnsiChar; 637 | const k: PAnsiChar; 638 | const c: PAnsiChar): Integer cdecl; 639 | 640 | Tcrypto_core_salsa20_outputbytes = function: dwSIZE_T cdecl; 641 | 642 | Tcrypto_core_salsa20_inputbytes = function: dwSIZE_T cdecl; 643 | 644 | Tcrypto_core_salsa20_keybytes = function: dwSIZE_T cdecl; 645 | 646 | Tcrypto_core_salsa20_constbytes = function: dwSIZE_T cdecl; 647 | 648 | Tcrypto_core_salsa20 = function(const outBuf: PAnsiChar; 649 | const inBuf: PAnsiChar; 650 | const k: PAnsiChar; 651 | const c: PAnsiChar): Integer cdecl; 652 | 653 | Tcrypto_core_salsa2012_outputbytes = function: dwSIZE_T cdecl; 654 | 655 | Tcrypto_core_salsa2012_inputbytes = function: dwSIZE_T cdecl; 656 | 657 | Tcrypto_core_salsa2012_keybytes = function: dwSIZE_T cdecl; 658 | 659 | Tcrypto_core_salsa2012_constbytes = function: dwSIZE_T cdecl; 660 | 661 | Tcrypto_core_salsa2012 = function(const outBuf: PAnsiChar; 662 | const inBuf: PAnsiChar; 663 | const k: PAnsiChar; 664 | const c: PAnsiChar): Integer cdecl; 665 | 666 | Tcrypto_core_salsa208_outputbytes = function: dwSIZE_T cdecl; 667 | 668 | Tcrypto_core_salsa208_inputbytes = function: dwSIZE_T cdecl; 669 | 670 | Tcrypto_core_salsa208_keybytes = function: dwSIZE_T cdecl; 671 | 672 | Tcrypto_core_salsa208_constbytes = function: dwSIZE_T cdecl; 673 | 674 | Tcrypto_core_salsa208 = function(const outBuf: PAnsiChar; 675 | const inBuf: PAnsiChar; 676 | const k: PAnsiChar; 677 | const c: PAnsiChar): Integer cdecl; 678 | 679 | Tcrypto_generichash_bytes_min = function: dwSIZE_T cdecl; 680 | 681 | Tcrypto_generichash_bytes_max = function: dwSIZE_T cdecl; 682 | 683 | Tcrypto_generichash_bytes = function: dwSIZE_T cdecl; 684 | 685 | Tcrypto_generichash_keybytes_min = function: dwSIZE_T cdecl; 686 | 687 | Tcrypto_generichash_keybytes_max = function: dwSIZE_T cdecl; 688 | 689 | Tcrypto_generichash_keybytes = function: dwSIZE_T cdecl; 690 | 691 | Tcrypto_generichash_primitive = function: PAnsiChar cdecl; 692 | 693 | Tcrypto_generichash_statebytes = function: dwSIZE_T cdecl; 694 | 695 | Tcrypto_generichash = function(const outBuf: PAnsiChar; 696 | outlen: dwSIZE_T; 697 | const inBuf: PAnsiChar; 698 | inlen: UINT64; 699 | const key: PAnsiChar; 700 | keylen: dwSIZE_T): Integer cdecl; 701 | 702 | Tcrypto_generichash_init = function(var state: CRYPTO_GENERICHASH_STATE; 703 | const key: PAnsiChar; 704 | const keylen: dwSIZE_T; 705 | const outlen: dwSIZE_T): Integer cdecl; 706 | 707 | Tcrypto_generichash_update = function(var state: CRYPTO_GENERICHASH_STATE; 708 | const inBuf: PAnsiChar; 709 | inlen: UINT64): Integer cdecl; 710 | 711 | Tcrypto_generichash_final = function(var state: CRYPTO_GENERICHASH_STATE; 712 | const outBuf: PAnsiChar; 713 | const outlen: dwSIZE_T): Integer cdecl; 714 | 715 | Tcrypto_generichash_blake2b_bytes_min = function: dwSIZE_T cdecl; 716 | 717 | Tcrypto_generichash_blake2b_bytes_max = function: dwSIZE_T cdecl; 718 | 719 | Tcrypto_generichash_blake2b_bytes = function: dwSIZE_T cdecl; 720 | 721 | Tcrypto_generichash_blake2b_keybytes_min = function: dwSIZE_T cdecl; 722 | 723 | Tcrypto_generichash_blake2b_keybytes_max = function: dwSIZE_T cdecl; 724 | 725 | Tcrypto_generichash_blake2b_keybytes = function: dwSIZE_T cdecl; 726 | 727 | Tcrypto_generichash_blake2b_saltbytes = function: dwSIZE_T cdecl; 728 | 729 | Tcrypto_generichash_blake2b_personalbytes = function: dwSIZE_T cdecl; 730 | 731 | Tcrypto_generichash_blake2b = function(const outBuf: PAnsiChar; 732 | outlen: dwSIZE_T; 733 | const inBuf: PAnsiChar; 734 | inlen: UINT64; 735 | const key: PAnsiChar; 736 | keylen: dwSIZE_T): Integer cdecl; 737 | 738 | Tcrypto_generichash_blake2b_salt_personal = function(const outBuf: PAnsiChar; 739 | outlen: dwSIZE_T; 740 | const inBuf: PAnsiChar; 741 | inlen: UINT64; 742 | const key: PAnsiChar; 743 | keylen: dwSIZE_T; 744 | const salt: PAnsiChar; 745 | const personal: PAnsiChar): Integer cdecl; 746 | 747 | Tcrypto_generichash_blake2b_init = function(var state: CRYPTO_GENERICHASH_BLAKE2B_STATE; 748 | const key: PAnsiChar; 749 | const keylen: dwSIZE_T; 750 | const outlen: dwSIZE_T): Integer cdecl; 751 | 752 | Tcrypto_generichash_blake2b_init_salt_personal = function(var state: CRYPTO_GENERICHASH_BLAKE2B_STATE; 753 | const key: PAnsiChar; 754 | const keylen: dwSIZE_T; 755 | const outlen: dwSIZE_T; 756 | const salt: PAnsiChar; 757 | const personal: PAnsiChar): Integer cdecl; 758 | 759 | Tcrypto_generichash_blake2b_update = function(var state: CRYPTO_GENERICHASH_BLAKE2B_STATE; 760 | const inBuf: PAnsiChar; 761 | inlen: UINT64): Integer cdecl; 762 | 763 | Tcrypto_generichash_blake2b_final = function(var state: CRYPTO_GENERICHASH_BLAKE2B_STATE; 764 | const outBuf: PAnsiChar; 765 | const outlen: dwSIZE_T): Integer cdecl; 766 | 767 | // * WARNING: Unless you absolutely need to use SHA512 for interoperatibility, 768 | // * purposes, you might want to consider crypto_generichash() instead. 769 | // * Unlike SHA512, crypto_generichash() is not vulnerable to length 770 | // * extension attacks. 771 | 772 | Tcrypto_hash_bytes = function: dwSIZE_T cdecl; 773 | 774 | Tcrypto_hash = function(const outBuf: PAnsiChar; 775 | const inBuf: PAnsiChar; 776 | inlen: UINT64): Integer cdecl; 777 | 778 | Tcrypto_hash_primitive = function: PAnsiChar cdecl; 779 | 780 | // * WARNING: Unless you absolutely need to use SHA256 for interoperatibility, 781 | // * purposes, you might want to consider crypto_generichash() instead. 782 | // * Unlike SHA256, crypto_generichash() is not vulnerable to length 783 | // * extension attacks. 784 | 785 | Tcrypto_hash_sha256_statebytes = function: dwSIZE_T cdecl; 786 | 787 | Tcrypto_hash_sha256_bytes = function: dwSIZE_T cdecl; 788 | 789 | Tcrypto_hash_sha256 = function(const outBuf: PAnsiChar; 790 | const inBuf: PAnsiChar; 791 | inlen: UINT64): Integer cdecl; 792 | 793 | Tcrypto_hash_sha256_init = function(var state: CRYPTO_HASH_SHA256_STATE): Integer cdecl; 794 | 795 | Tcrypto_hash_sha256_update = function(var state: CRYPTO_HASH_SHA256_STATE; 796 | const inBuf: PAnsiChar; 797 | inlen: UINT64): Integer cdecl; 798 | 799 | Tcrypto_hash_sha256_final = function(var state: CRYPTO_HASH_SHA256_STATE; 800 | const outBuf: PAnsiChar): Integer cdecl; 801 | 802 | // * WARNING: Unless you absolutely need to use SHA512 for interoperatibility, 803 | // * purposes, you might want to consider crypto_generichash() instead. 804 | // * Unlike SHA512, crypto_generichash() is not vulnerable to length 805 | // * extension attacks. 806 | 807 | Tcrypto_hash_sha512_statebytes = function: dwSIZE_T cdecl; 808 | 809 | Tcrypto_hash_sha512_bytes = function: dwSIZE_T cdecl; 810 | 811 | Tcrypto_hash_sha512 = function(const outBuf: PAnsiChar; 812 | const inBuf: PAnsiChar; 813 | inlen: UINT64): Integer cdecl; 814 | 815 | Tcrypto_hash_sha512_init = function(var state: CRYPTO_HASH_SHA512_STATE): Integer cdecl; 816 | 817 | Tcrypto_hash_sha512_update = function(var state: CRYPTO_HASH_SHA512_STATE; 818 | const inBuf: PAnsiChar; 819 | inlen: UINT64): Integer cdecl; 820 | 821 | Tcrypto_hash_sha512_final = function(var state: CRYPTO_HASH_SHA512_STATE; 822 | const outBuf: PAnsiChar): Integer cdecl; 823 | 824 | Tcrypto_onetimeauth_statebytes = function: dwSIZE_T cdecl; 825 | 826 | Tcrypto_onetimeauth_bytes = function: dwSIZE_T cdecl; 827 | 828 | Tcrypto_onetimeauth_keybytes = function: dwSIZE_T cdecl; 829 | 830 | Tcrypto_onetimeauth_primitive = function: PAnsiChar cdecl; 831 | 832 | Tcrypto_onetimeauth = function(const outBuf: PAnsiChar; 833 | const inBuf: PAnsiChar; 834 | inlen: UINT64; 835 | const k: PAnsiChar): Integer cdecl; 836 | 837 | Tcrypto_onetimeauth_verify = function(const h: PAnsiChar; 838 | const inBuf: PAnsiChar; 839 | inlen: UINT64; 840 | const k: PAnsiChar): Integer cdecl; 841 | 842 | Tcrypto_onetimeauth_init = function(var state: CRYPTO_ONETIMEAUTH_STATE; 843 | const key: PAnsiChar): Integer cdecl; 844 | 845 | Tcrypto_onetimeauth_update = function(var state: CRYPTO_ONETIMEAUTH_STATE; 846 | const inBuf: PAnsiChar; 847 | inlen: UINT64): Integer cdecl; 848 | 849 | Tcrypto_onetimeauth_final = function(var state: CRYPTO_ONETIMEAUTH_STATE; 850 | const outBuf: PAnsiChar): Integer cdecl; 851 | 852 | Tcrypto_onetimeauth_poly1305_bytes = function: dwSIZE_T cdecl; 853 | 854 | Tcrypto_onetimeauth_poly1305_keybytes = function: dwSIZE_T cdecl; 855 | 856 | Tcrypto_onetimeauth_poly1305 = function(const outBuf: PAnsiChar; 857 | const inBuf: PAnsiChar; 858 | inlen: UINT64; 859 | const k: PAnsiChar): Integer cdecl; 860 | 861 | Tcrypto_onetimeauth_poly1305_verify = function(const h: PAnsiChar; 862 | const inBuf: PAnsiChar; 863 | inlen: UINT64; 864 | const k: PAnsiChar): Integer cdecl; 865 | 866 | Tcrypto_onetimeauth_poly1305_init = function(var state: CRYPTO_ONETIMEAUTH_POLY1305_STATE; 867 | const key: PAnsiChar): Integer cdecl; 868 | 869 | Tcrypto_onetimeauth_poly1305_update = function(var state: CRYPTO_ONETIMEAUTH_POLY1305_STATE; 870 | const inBuf: PAnsiChar; 871 | inlen: UINT64): Integer cdecl; 872 | 873 | Tcrypto_onetimeauth_poly1305_final = function(var state: CRYPTO_ONETIMEAUTH_POLY1305_STATE; 874 | const outBuf: PAnsiChar): Integer cdecl; 875 | 876 | Tcrypto_pwhash_scryptsalsa208sha256_saltbytes = function: dwSIZE_T cdecl; 877 | 878 | Tcrypto_pwhash_scryptsalsa208sha256_strbytes = function: dwSIZE_T cdecl; 879 | 880 | Tcrypto_pwhash_scryptsalsa208sha256_strprefix = function: PAnsiChar cdecl; 881 | 882 | Tcrypto_pwhash_scryptsalsa208sha256_opslimit_interactive = function: dwSIZE_T cdecl; 883 | 884 | Tcrypto_pwhash_scryptsalsa208sha256_memlimit_interactive = function: dwSIZE_T cdecl; 885 | 886 | Tcrypto_pwhash_scryptsalsa208sha256_opslimit_sensitive = function: dwSIZE_T cdecl; 887 | 888 | Tcrypto_pwhash_scryptsalsa208sha256_memlimit_sensitive = function: dwSIZE_T cdecl; 889 | 890 | Tcrypto_pwhash_scryptsalsa208sha256 = function(const outBuf: PAnsiChar; 891 | outlen: UINT64; 892 | const passwd: PAnsiChar; 893 | passwdlen: UINT64; 894 | const salt: PAnsiChar; 895 | opslimit: UINT64; 896 | memlimit: dwSIZE_T): Integer cdecl; 897 | 898 | Tcrypto_pwhash_scryptsalsa208sha256_str = function(outBuf: PAnsiChar{ls_crypto_pwhash_scryptsalsa208sha256_STRBYTES}; 899 | const passwd: PAnsiChar; 900 | passwdlen: UINT64; 901 | opslimit: UINT64; 902 | memlimit: UINT64): Integer cdecl; 903 | 904 | Tcrypto_pwhash_scryptsalsa208sha256_str_verify = function(const str: PAnsiChar{ls_crypto_pwhash_scryptsalsa208sha256_STRBYTES}; 905 | const passwd: PAnsiChar; 906 | passwdlen: UINT64): Integer cdecl; 907 | 908 | Tcrypto_pwhash_scryptsalsa208sha256_ll = function(const passwd: PUINT8; 909 | passwdlen: dwSIZE_T; 910 | const salt: PUINT8; 911 | saltlen: dwSIZE_T; 912 | N: UINT64; 913 | r: UINT32; 914 | p: UINT32; 915 | var buf: UINT8; 916 | buflen: dwSIZE_T): Integer cdecl; 917 | 918 | Tcrypto_scalarmult_bytes = function: dwSIZE_T cdecl; 919 | 920 | Tcrypto_scalarmult_scalarbytes = function: dwSIZE_T cdecl; 921 | 922 | Tcrypto_scalarmult_primitive = function: PAnsiChar cdecl; 923 | 924 | Tcrypto_scalarmult_base = function(const q: PAnsiChar; 925 | const n: PAnsiChar): Integer cdecl; 926 | 927 | Tcrypto_scalarmult = function(const q: PAnsiChar; 928 | const n: PAnsiChar; 929 | const p: PAnsiChar): Integer cdecl; 930 | 931 | Tcrypto_scalarmult_curve25519_bytes = function: dwSIZE_T cdecl; 932 | 933 | Tcrypto_scalarmult_curve25519_scalarbytes = function: dwSIZE_T cdecl; 934 | 935 | Tcrypto_scalarmult_curve25519 = function(const q: PAnsiChar; 936 | const n: PAnsiChar; 937 | const p: PAnsiChar): Integer cdecl; 938 | 939 | Tcrypto_scalarmult_curve25519_base = function(const q: PAnsiChar; 940 | const n: PAnsiChar): Integer cdecl; 941 | 942 | Tcrypto_secretbox_keybytes = function: dwSIZE_T cdecl; 943 | 944 | Tcrypto_secretbox_noncebytes = function: dwSIZE_T cdecl; 945 | 946 | Tcrypto_secretbox_macbytes = function: dwSIZE_T cdecl; 947 | 948 | Tcrypto_secretbox_primitive = function: PAnsiChar cdecl; 949 | 950 | Tcrypto_secretbox_easy = function(const c: PAnsiChar; 951 | const m: PAnsiChar; 952 | mlen: UINT64; 953 | const n: PAnsiChar; 954 | const k: PAnsiChar): Integer cdecl; 955 | 956 | Tcrypto_secretbox_open_easy = function(const m: PAnsiChar; 957 | const c: PAnsiChar; 958 | clen: UINT64; 959 | const n: PAnsiChar; 960 | const k: PAnsiChar): Integer cdecl; 961 | 962 | Tcrypto_secretbox_detached = function(const c: PAnsiChar; 963 | const mac: PAnsiChar; 964 | const m: PAnsiChar; 965 | mlen: UINT64; 966 | const n: PAnsiChar; 967 | const k: PAnsiChar): Integer cdecl; 968 | 969 | Tcrypto_secretbox_open_detached = function(const m: PAnsiChar; 970 | const c: PAnsiChar; 971 | const mac: PAnsiChar; 972 | clen: UINT64; 973 | const n: PAnsiChar; 974 | const k: PAnsiChar): Integer cdecl; 975 | 976 | // -- NaCl compatibility interface ; Requires padding -- } 977 | 978 | Tcrypto_secretbox_zerobytes = function: dwSIZE_T cdecl; 979 | 980 | Tcrypto_secretbox_boxzerobytes = function: dwSIZE_T cdecl; 981 | 982 | Tcrypto_secretbox = function(const c: PAnsiChar; 983 | const m: PAnsiChar; 984 | mlen: UINT64; 985 | const n: PAnsiChar; 986 | const k: PAnsiChar): Integer cdecl; 987 | 988 | Tcrypto_secretbox_open = function(const m: PAnsiChar; 989 | const c: PAnsiChar; 990 | clen: UINT64; 991 | const n: PAnsiChar; 992 | const k: PAnsiChar): Integer cdecl; 993 | 994 | Tcrypto_secretbox_xsalsa20poly1305_keybytes = function: dwSIZE_T cdecl; 995 | 996 | Tcrypto_secretbox_xsalsa20poly1305_noncebytes = function: dwSIZE_T cdecl; 997 | 998 | Tcrypto_secretbox_xsalsa20poly1305_zerobytes = function: dwSIZE_T cdecl; 999 | 1000 | Tcrypto_secretbox_xsalsa20poly1305_boxzerobytes = function: dwSIZE_T cdecl; 1001 | 1002 | Tcrypto_secretbox_xsalsa20poly1305_macbytes = function: dwSIZE_T cdecl; 1003 | 1004 | Tcrypto_secretbox_xsalsa20poly1305 = function(const c: PAnsiChar; 1005 | const m: PAnsiChar; 1006 | mlen: UINT64; 1007 | const n: PAnsiChar; 1008 | const k: PAnsiChar): Integer cdecl; 1009 | 1010 | Tcrypto_secretbox_xsalsa20poly1305_open = function(const m: PAnsiChar; 1011 | const c: PAnsiChar; 1012 | clen: UINT64; 1013 | const n: PAnsiChar; 1014 | const k: PAnsiChar): Integer cdecl; 1015 | 1016 | Tcrypto_shorthash_bytes = function: dwSIZE_T cdecl; 1017 | 1018 | Tcrypto_shorthash_keybytes = function: dwSIZE_T cdecl; 1019 | 1020 | Tcrypto_shorthash_primitive = function: PAnsiChar cdecl; 1021 | 1022 | Tcrypto_shorthash = function(const outBuf: PAnsiChar; 1023 | const inBuf: PAnsiChar; 1024 | inlen: UINT64; 1025 | const k: PAnsiChar): Integer cdecl; 1026 | 1027 | Tcrypto_shorthash_siphash24_bytes = function: dwSIZE_T cdecl; 1028 | 1029 | Tcrypto_shorthash_siphash24_keybytes = function: dwSIZE_T cdecl; 1030 | 1031 | Tcrypto_shorthash_siphash24 = function(const outBuf: PAnsiChar; 1032 | const inBuf: PAnsiChar; 1033 | inlen: UINT64; 1034 | const k: PAnsiChar): Integer cdecl; 1035 | 1036 | // * THREAD SAFETY: crypto_sign_keypair() is thread-safe, 1037 | // * provided that you called sodium_init() once before using any 1038 | // * other libsodium function. 1039 | // * Other functions, including crypto_sign_seed_keypair() are always thread-safe. 1040 | 1041 | Tcrypto_sign_bytes = function: dwSIZE_T cdecl; 1042 | 1043 | Tcrypto_sign_seedbytes = function: dwSIZE_T cdecl; 1044 | 1045 | Tcrypto_sign_publickeybytes = function: dwSIZE_T cdecl; 1046 | 1047 | Tcrypto_sign_secretkeybytes = function: dwSIZE_T cdecl; 1048 | 1049 | Tcrypto_sign_primitive = function: PAnsiChar cdecl; 1050 | 1051 | Tcrypto_sign_seed_keypair = function(const pk: PAnsiChar; 1052 | const sk: PAnsiChar; 1053 | const seed: PAnsiChar): Integer cdecl; 1054 | 1055 | Tcrypto_sign_keypair = function(const pk: PAnsiChar; 1056 | const sk: PAnsiChar): Integer cdecl; 1057 | 1058 | Tcrypto_sign = function(const sm: PAnsiChar; 1059 | var smlen_p: UINT64; 1060 | const m: PAnsiChar; 1061 | mlen: UINT64; 1062 | const sk: PAnsiChar): Integer cdecl; 1063 | 1064 | Tcrypto_sign_open = function(const m: PAnsiChar; 1065 | var mlen_p: UINT64; 1066 | const sm: PAnsiChar; 1067 | smlen: UINT64; 1068 | const pk: PAnsiChar): Integer cdecl; 1069 | 1070 | Tcrypto_sign_detached = function(const sig: PAnsiChar; 1071 | var siglen_p: UINT64; 1072 | const m: PAnsiChar; 1073 | mlen: UINT64; 1074 | const sk: PAnsiChar): Integer cdecl; 1075 | 1076 | Tcrypto_sign_verify_detached = function(const sig: PAnsiChar; 1077 | const m: PAnsiChar; 1078 | mlen: UINT64; 1079 | const pk: PAnsiChar): Integer cdecl; 1080 | 1081 | Tcrypto_sign_ed25519_bytes = function: dwSIZE_T cdecl; 1082 | 1083 | Tcrypto_sign_ed25519_seedbytes = function: dwSIZE_T cdecl; 1084 | 1085 | Tcrypto_sign_ed25519_publickeybytes = function: dwSIZE_T cdecl; 1086 | 1087 | Tcrypto_sign_ed25519_secretkeybytes = function: dwSIZE_T cdecl; 1088 | 1089 | Tcrypto_sign_ed25519 = function(const sm: PAnsiChar; 1090 | var smlen_p: UINT64; 1091 | const m: PAnsiChar; 1092 | mlen: UINT64; 1093 | const sk: PAnsiChar): Integer cdecl; 1094 | 1095 | Tcrypto_sign_ed25519_open = function(const m: PAnsiChar; 1096 | var mlen_p: UINT64; 1097 | const sm: PAnsiChar; 1098 | smlen: UINT64; 1099 | const pk: PAnsiChar): Integer cdecl; 1100 | 1101 | Tcrypto_sign_ed25519_detached = function(const sig: PAnsiChar; 1102 | var siglen_p: UINT64; 1103 | const m: PAnsiChar; 1104 | mlen: UINT64; 1105 | const sk: PAnsiChar): Integer cdecl; 1106 | 1107 | Tcrypto_sign_ed25519_verify_detached = function(const sig: PAnsiChar; 1108 | const m: PAnsiChar; 1109 | mlen: UINT64; 1110 | const pk: PAnsiChar): Integer cdecl; 1111 | 1112 | Tcrypto_sign_ed25519_keypair = function(const pk: PAnsiChar; 1113 | const sk: PAnsiChar): Integer cdecl; 1114 | 1115 | Tcrypto_sign_ed25519_seed_keypair = function(const pk: PAnsiChar; 1116 | const sk: PAnsiChar; 1117 | const seed: PAnsiChar): Integer cdecl; 1118 | 1119 | Tcrypto_sign_ed25519_pk_to_curve25519 = function(const curve25519_pk: PAnsiChar; 1120 | const ed25519_pk: PAnsiChar): Integer cdecl; 1121 | 1122 | Tcrypto_sign_ed25519_sk_to_curve25519 = function(const curve25519_sk: PAnsiChar; 1123 | const ed25519_sk: PAnsiChar): Integer cdecl; 1124 | 1125 | Tcrypto_sign_ed25519_sk_to_seed = function(const seed: PAnsiChar; 1126 | const sk: PAnsiChar): Integer cdecl; 1127 | 1128 | Tcrypto_sign_ed25519_sk_to_pk = function(const pk: PAnsiChar; 1129 | const sk: PAnsiChar): Integer cdecl; 1130 | 1131 | // * WARNING: This construction was a prototype, which should not be used 1132 | // * any more in new projects. 1133 | // * 1134 | // * crypto_sign_edwards25519sha512batch is provided for applications 1135 | // * initially built with NaCl, but as recommended by the author of this 1136 | // * construction, new applications should use ed25519 instead. 1137 | // * 1138 | // * In Sodium, you should use the high-level crypto_sign_*() functions instead. 1139 | 1140 | Tcrypto_sign_edwards25519sha512batch_bytes = function: dwSIZE_T cdecl; 1141 | 1142 | Tcrypto_sign_edwards25519sha512batch_publickeybytes = function: dwSIZE_T cdecl; 1143 | 1144 | Tcrypto_sign_edwards25519sha512batch_secretkeybytes = function: dwSIZE_T cdecl; 1145 | 1146 | Tcrypto_sign_edwards25519sha512batch = function(const sm: PAnsiChar; 1147 | var smlen_p: UINT64; 1148 | const m: PAnsiChar; 1149 | mlen: UINT64; 1150 | const sk: PAnsiChar): Integer cdecl; 1151 | 1152 | Tcrypto_sign_edwards25519sha512batch_open = function(const m: PAnsiChar; 1153 | var mlen_p: UINT64; 1154 | const sm: PAnsiChar; 1155 | smlen: UINT64; 1156 | const pk: PAnsiChar): Integer cdecl; 1157 | 1158 | Tcrypto_sign_edwards25519sha512batch_keypair = function(const pk: PAnsiChar; 1159 | const sk: PAnsiChar): Integer cdecl; 1160 | 1161 | 1162 | // * WARNING: This is just a stream cipher. It is NOT authenticated encryption. 1163 | // * While it provides some protection against eavesdropping, it does NOT 1164 | // * provide any security against active attacks. 1165 | // * Unless you know what you're doing, what you are looking for is probably 1166 | // * the crypto_box functions. 1167 | 1168 | Tcrypto_stream_keybytes = function: dwSIZE_T cdecl; 1169 | 1170 | Tcrypto_stream_noncebytes = function: dwSIZE_T cdecl; 1171 | 1172 | Tcrypto_stream_primitive = function: PAnsiChar cdecl; 1173 | 1174 | Tcrypto_stream = function(const c: PAnsiChar; 1175 | clen: UINT64; 1176 | const n: PAnsiChar; 1177 | const k: PAnsiChar): Integer cdecl; 1178 | 1179 | Tcrypto_stream_xor = function(const c: PAnsiChar; 1180 | const m: PAnsiChar; 1181 | mlen: UINT64; 1182 | const n: PAnsiChar; 1183 | const k: PAnsiChar): Integer cdecl; 1184 | 1185 | // * WARNING: This is just a stream cipher. It is NOT authenticated encryption. 1186 | // * While it provides some protection against eavesdropping, it does NOT 1187 | // * provide any security against active attacks. 1188 | // * Unless you know what you're doing, what you are looking for is probably 1189 | // * the crypto_box functions. 1190 | 1191 | Tcrypto_secretstream_xchacha20poly1305_abytes = function: dwSIZE_T cdecl; 1192 | 1193 | Tcrypto_secretstream_xchacha20poly1305_headerbytes = function: dwSIZE_T cdecl; 1194 | 1195 | Tcrypto_secretstream_xchacha20poly1305_keybytes = function: dwSIZE_T cdecl; 1196 | 1197 | Tcrypto_secretstream_xchacha20poly1305_messagebytes_max = function: dwSIZE_T cdecl; 1198 | 1199 | Tcrypto_secretstream_xchacha20poly1305_tag_message = function: byte cdecl; 1200 | 1201 | Tcrypto_secretstream_xchacha20poly1305_tag_push = function: byte cdecl; 1202 | 1203 | Tcrypto_secretstream_xchacha20poly1305_tag_rekey = function: byte cdecl; 1204 | 1205 | Tcrypto_secretstream_xchacha20poly1305_tag_final = function: byte cdecl; 1206 | 1207 | Tcrypto_secretstream_xchacha20poly1305_statebytes = function: dwSIZE_T cdecl; 1208 | 1209 | Tcrypto_secretstream_xchacha20poly1305_keygen = procedure(const k: PAnsiChar) cdecl; 1210 | 1211 | Tcrypto_secretstream_xchacha20poly1305_init_push = function(var state: Pointer; 1212 | header: PAnsiChar; 1213 | k: PAnsiChar): integer cdecl; 1214 | 1215 | Tcrypto_secretstream_xchacha20poly1305_push = function(var state: Pointer; 1216 | c: PAnsiChar; 1217 | clen_p: UINT64; 1218 | const m: PAnsiChar; 1219 | mlen: UINT64; 1220 | const ad: PAnsiChar; 1221 | adlen: UINT64; 1222 | tag: byte): integer cdecl; 1223 | 1224 | Tcrypto_secretstream_xchacha20poly1305_init_pull = function(var state: Pointer; 1225 | header: PAnsiChar; 1226 | k: PAnsiChar): integer cdecl; 1227 | 1228 | Tcrypto_secretstream_xchacha20poly1305_pull = function(var state: Pointer; 1229 | m: PAnsiChar; 1230 | mlen_p: UINT64; 1231 | tag_p: PAnsiChar; 1232 | const c: PAnsiChar; 1233 | clen: UINT64; 1234 | const ad: PAnsiChar; 1235 | adlen: UINT64): integer cdecl; 1236 | 1237 | Tcrypto_secretstream_xchacha20poly1305_rekey = procedure(var state: PAnsiChar) cdecl; 1238 | 1239 | // * WARNING: This is just a stream cipher. It is NOT authenticated encryption. 1240 | // * While it provides some protection against eavesdropping, it does NOT 1241 | // * provide any security against active attacks. 1242 | // * Unless you know what you're doing, what you are looking for is probably 1243 | // * the crypto_box functions. 1244 | 1245 | // * ChaCha20 with a 64-bit nonce and a 64-bit counter, as originally designed 1246 | 1247 | Tcrypto_stream_chacha20_keybytes = function: dwSIZE_T cdecl; 1248 | 1249 | Tcrypto_stream_chacha20_noncebytes = function: dwSIZE_T cdecl; 1250 | 1251 | Tcrypto_stream_chacha20 = function(const c: PAnsiChar; 1252 | clen: UINT64; 1253 | const n: PAnsiChar; 1254 | const k: PAnsiChar): Integer cdecl; 1255 | 1256 | Tcrypto_stream_chacha20_xor = function(const c: PAnsiChar; 1257 | const m: PAnsiChar; 1258 | mlen: UINT64; 1259 | const n: PAnsiChar; 1260 | const k: PAnsiChar): Integer cdecl; 1261 | 1262 | Tcrypto_stream_chacha20_xor_ic = function(const c: PAnsiChar; 1263 | const m: PAnsiChar; 1264 | mlen: UINT64; 1265 | const n: PAnsiChar; 1266 | ic: UINT64; 1267 | const k: PAnsiChar): Integer cdecl; 1268 | 1269 | // * ChaCha20 with a 96-bit nonce and a 32-bit counter (IETF) 1270 | 1271 | Tcrypto_stream_chacha20_ietf_noncebytes = function: dwSIZE_T cdecl; 1272 | 1273 | Tcrypto_stream_chacha20_ietf = function(const c: PAnsiChar; 1274 | clen: UINT64; 1275 | const n: PAnsiChar; 1276 | const k: PAnsiChar): Integer cdecl; 1277 | 1278 | Tcrypto_stream_chacha20_ietf_xor = function(const c: PAnsiChar; 1279 | const m: PAnsiChar; 1280 | mlen: UINT64; 1281 | const n: PAnsiChar; 1282 | const k: PAnsiChar): Integer cdecl; 1283 | 1284 | Tcrypto_stream_chacha20_ietf_xor_ic = function(const c: PAnsiChar; 1285 | const m: PAnsiChar; 1286 | mlen: UINT64; 1287 | const n: PAnsiChar; 1288 | ic: UINT32; 1289 | const k: PAnsiChar): Integer cdecl; 1290 | 1291 | // * WARNING: This is just a stream cipher. It is NOT authenticated encryption. 1292 | // * While it provides some protection against eavesdropping, it does NOT 1293 | // * provide any security against active attacks. 1294 | // * Unless you know what you're doing, what you are looking for is probably 1295 | // * the crypto_box functions. 1296 | 1297 | Tcrypto_stream_salsa20_keybytes = function: dwSIZE_T cdecl; 1298 | 1299 | Tcrypto_stream_salsa20_noncebytes = function: dwSIZE_T cdecl; 1300 | 1301 | Tcrypto_stream_salsa20 = function(const c: PAnsiChar; 1302 | clen: UINT64; 1303 | const n: PAnsiChar; 1304 | const k: PAnsiChar): Integer cdecl; 1305 | 1306 | Tcrypto_stream_salsa20_xor = function(const c: PAnsiChar; 1307 | const m: PAnsiChar; 1308 | mlen: UINT64; 1309 | const n: PAnsiChar; 1310 | const k: PAnsiChar): Integer cdecl; 1311 | 1312 | Tcrypto_stream_salsa20_xor_ic = function(const c: PAnsiChar; 1313 | const m: PAnsiChar; 1314 | mlen: UINT64; 1315 | const n: PAnsiChar; 1316 | ic: UINT64; 1317 | const k: PAnsiChar): Integer cdecl; 1318 | 1319 | // * WARNING: This is just a stream cipher. It is NOT authenticated encryption. 1320 | // * While it provides some protection against eavesdropping, it does NOT 1321 | // * provide any security against active attacks. 1322 | // * Unless you know what you're doing, what you are looking for is probably 1323 | // * the crypto_box functions. 1324 | 1325 | Tcrypto_stream_salsa2012_keybytes = function: dwSIZE_T cdecl; 1326 | 1327 | Tcrypto_stream_salsa2012_noncebytes = function: dwSIZE_T cdecl; 1328 | 1329 | Tcrypto_stream_salsa2012 = function(const c: PAnsiChar; 1330 | clen: UINT64; 1331 | const n: PAnsiChar; 1332 | const k: PAnsiChar): Integer cdecl; 1333 | 1334 | Tcrypto_stream_salsa2012_xor = function(const c: PAnsiChar; 1335 | const m: PAnsiChar; 1336 | mlen: UINT64; 1337 | const n: PAnsiChar; 1338 | const k: PAnsiChar): Integer cdecl; 1339 | 1340 | // * WARNING: This is just a stream cipher. It is NOT authenticated encryption. 1341 | // * While it provides some protection against eavesdropping, it does NOT 1342 | // * provide any security against active attacks. 1343 | // * Unless you know what you're doing, what you are looking for is probably 1344 | // * the crypto_box functions. 1345 | 1346 | Tcrypto_stream_xsalsa20_keybytes = function: dwSIZE_T cdecl; 1347 | 1348 | Tcrypto_stream_xsalsa20_noncebytes = function: dwSIZE_T cdecl; 1349 | 1350 | Tcrypto_stream_xsalsa20 = function(const c: PAnsiChar; 1351 | clen: UINT64; 1352 | const n: PAnsiChar; 1353 | const k: PAnsiChar): Integer cdecl; 1354 | 1355 | Tcrypto_stream_xsalsa20_xor = function(const c: PAnsiChar; 1356 | const m: PAnsiChar; 1357 | mlen: UINT64; 1358 | const n: PAnsiChar; 1359 | const k: PAnsiChar): Integer cdecl; 1360 | 1361 | Tcrypto_stream_xsalsa20_xor_ic = function(const c: PAnsiChar; 1362 | const m: PAnsiChar; 1363 | mlen: UINT64; 1364 | const n: PAnsiChar; 1365 | ic: UINT64; 1366 | const k: PAnsiChar): Integer cdecl; 1367 | 1368 | Tcrypto_verify_16_bytes = function: dwSIZE_T cdecl; 1369 | 1370 | Tcrypto_verify_16 = function(const x: PAnsiChar; 1371 | const y: PAnsiChar): Integer cdecl; 1372 | 1373 | Tcrypto_verify_32_bytes = function: dwSIZE_T cdecl; 1374 | 1375 | Tcrypto_verify_32 = function(const x: PAnsiChar; 1376 | const y: PAnsiChar): Integer cdecl; 1377 | 1378 | Tcrypto_verify_64_bytes = function: dwSIZE_T cdecl; 1379 | 1380 | Tcrypto_verify_64 = function(const x: PAnsiChar; 1381 | const y: PAnsiChar): Integer cdecl; 1382 | 1383 | Trandombytes_buf = procedure(const buf: Pointer; 1384 | const size: dwSIZE_T) cdecl; 1385 | 1386 | Trandombytes_buf_deterministic = procedure(const buf: Pointer; 1387 | const size: dwSIZE_T; 1388 | const seed: PAnsiChar) cdecl; 1389 | 1390 | Trandombytes_random = function: UINT32 cdecl; 1391 | 1392 | Trandombytes_uniform = function(const upper_bound: UINT32): UINT32 cdecl; 1393 | 1394 | Trandombytes_stir = procedure cdecl; 1395 | 1396 | Trandombytes_close = function: Integer cdecl; 1397 | 1398 | Trandombytes_implementation_name = function: PAnsiChar cdecl; 1399 | 1400 | randombytes_implementation = packed record 1401 | implementation_name: Trandombytes_implementation_name; 1402 | random: Trandombytes_random; 1403 | stir: Trandombytes_stir; 1404 | uniform: Trandombytes_uniform; 1405 | buf: Trandombytes_buf; 1406 | close: Trandombytes_close; 1407 | end {randombytes_implementation}; 1408 | 1409 | Trandombytes_set_implementation = function(var impl: RANDOMBYTES_IMPLEMENTATION): Integer cdecl; 1410 | 1411 | // -- NaCl compatibility interface -- } 1412 | 1413 | Trandombytes = procedure(const buf: PAnsiChar; 1414 | const buf_len: UINT64) cdecl; 1415 | 1416 | // * THREAD SAFETY: randombytes_salsa20_random*() functions are 1417 | // * fork()-safe but not thread-safe. 1418 | // * Always wrap them in a mutex if you need thread safety. 1419 | 1420 | Trandombytes_salsa20_implementation_name = function: PAnsiChar cdecl; 1421 | 1422 | Trandombytes_salsa20_random = function: UINT32 cdecl; 1423 | 1424 | Trandombytes_salsa20_random_stir = procedure cdecl; 1425 | 1426 | Trandombytes_salsa20_random_uniform = function(const upper_bound: UINT32): UINT32 cdecl; 1427 | 1428 | Trandombytes_salsa20_random_buf = procedure(const buf: Pointer; 1429 | const size: dwSIZE_T) cdecl; 1430 | 1431 | Trandombytes_salsa20_random_close = function: Integer cdecl; 1432 | 1433 | // * THREAD SAFETY: randombytes_sysrandom() functions are thread-safe, 1434 | // * provided that you called sodium_init() once before using any 1435 | // * other libsodium function. 1436 | 1437 | Trandombytes_sysrandom_implementation_name = function: PAnsiChar cdecl; 1438 | 1439 | Trandombytes_sysrandom = function: UINT32 cdecl; 1440 | 1441 | Trandombytes_sysrandom_stir = procedure cdecl; 1442 | 1443 | Trandombytes_sysrandom_uniform = function(const upper_bound: UINT32): UINT32 cdecl; 1444 | 1445 | Trandombytes_sysrandom_buf = procedure(const buf: Pointer; 1446 | const size: dwSIZE_T) cdecl; 1447 | 1448 | Trandombytes_sysrandom_close = function: Integer cdecl; 1449 | 1450 | Tsodium_runtime_has_neon = function: Integer cdecl; 1451 | 1452 | Tsodium_runtime_has_sse2 = function: Integer cdecl; 1453 | 1454 | Tsodium_runtime_has_sse3 = function: Integer cdecl; 1455 | 1456 | Tsodium_memzero = procedure(const pnt: Pointer; 1457 | const len: dwSIZE_T) cdecl; 1458 | 1459 | // * WARNING: sodium_memcmp() must be used to verify if two secret keys 1460 | // * are equal, in constant time. 1461 | // * It returns 0 if the keys are equal, and -1 if they differ. 1462 | // * This function is not designed for lexicographical comparisons. 1463 | // * 1464 | // * http://codahale.com/a-lesson-in-timing-attacks/ 1465 | 1466 | Tsodium_memcmp = function(const b1_: PAnsiChar; 1467 | const b2_: PAnsiChar; 1468 | len: dwSIZE_T): Integer cdecl; 1469 | 1470 | Tsodium_bin2hex = function(const hex: PAnsiChar; 1471 | const hex_maxlen: dwSIZE_T; 1472 | const bin: PAnsiChar; 1473 | const bin_len: dwSIZE_T): PAnsiChar cdecl; 1474 | 1475 | Tsodium_hex2bin = function(const bin: PAnsiChar; 1476 | const bin_maxlen: dwSIZE_T; 1477 | const hex: PAnsiChar; 1478 | const hex_len: dwSIZE_T; 1479 | const ignore: PAnsiChar; 1480 | out bin_len: dwSIZE_T; 1481 | const hex_end: PAnsiChar): Integer cdecl; 1482 | 1483 | Tsodium_bin2base64 = function(const b64: PAnsiChar; 1484 | const b64_maxlen: dwSIZE_T; 1485 | const bin: PAnsiChar; 1486 | const bin_len: dwSIZE_T; 1487 | const variant: Integer): PAnsiChar cdecl; 1488 | 1489 | Tsodium_base642bin = function(const bin: PAnsiChar; 1490 | const bin_maxlen: dwSIZE_T; 1491 | const b64: PAnsiChar; 1492 | const b64_len: dwSIZE_T; 1493 | const ignore: PAnsiChar; 1494 | out bin_len: dwSIZE_T; 1495 | const b64_end: PAnsiChar; 1496 | const variant: integer): Integer cdecl; 1497 | 1498 | Tsodium_mlock = function(const addr: Pointer; 1499 | const len: dwSIZE_T): Integer cdecl; 1500 | 1501 | Tsodium_munlock = function(const addr: Pointer; 1502 | const len: dwSIZE_T): Integer cdecl; 1503 | 1504 | // * WARNING: sodium_malloc() and sodium_allocarray() are not general-purpose 1505 | // * allocation functions. 1506 | // * 1507 | // * They return a pointer to a region filled with 0xd0 bytes, immediately 1508 | // * followed by a guard page. 1509 | // * As a result, accessing a single byte after the requested allocation size 1510 | // * will intentionally trigger a segmentation fault. 1511 | // * 1512 | // * A canary and an additional guard page placed before the beginning of the 1513 | // * region may also kill the process if a buffer underflow is detected. 1514 | // * 1515 | // * The memory layout is: 1516 | // * [unprotected region size (read only)][guard page (no access)][unprotected pages (read/write)][guard page (no access)] 1517 | // * With the layout of the unprotected pages being: 1518 | // * [optional padding][16-bytes canary][user region] 1519 | // * 1520 | // * However: 1521 | // * - These functions are significantly slower than standard functions 1522 | // * - Each allocation requires 3 or 4 additional pages 1523 | // * - The returned address will not be aligned if the allocation size is not 1524 | // * a multiple of the required alignment. For this reason, these functions 1525 | // * are designed to store data, such as secret keys and messages. 1526 | // * 1527 | // * sodium_malloc() can be used to allocate any libsodium data structure, 1528 | // * with the exception of crypto_generichash_state. 1529 | // * 1530 | // * The crypto_generichash_state structure is packed and its length is 1531 | // * either 357 or 361 bytes. For this reason, when using sodium_malloc() to 1532 | // * allocate a crypto_generichash_state structure, padding must be added in 1533 | // * order to ensure proper alignment: 1534 | // * state = sodium_malloc((crypto_generichash_statebytes() + (dwSIZE_T) 63U) 1535 | // * & ~(dwSIZE_T) 63U); 1536 | 1537 | Tsodium_malloc = function(const size: dwSIZE_T): Pointer cdecl; 1538 | 1539 | Tsodium_allocarray = function(count: dwSIZE_T; 1540 | size: dwSIZE_T): Pointer cdecl; 1541 | 1542 | Tsodium_mprotect_noaccess = function(ptr: Pointer): Integer cdecl; 1543 | 1544 | Tsodium_mprotect_readonly = function(ptr: Pointer): Integer cdecl; 1545 | 1546 | Tsodium_mprotect_readwrite = function(ptr: Pointer): Integer cdecl; 1547 | 1548 | Tsodium_pad = function(var padded_buflen_p: dwSIZE_T; 1549 | const buf: PAnsiChar; 1550 | const unpadded_buflen: dwSIZE_T; 1551 | const blocksize: dwSIZE_T): Integer cdecl; 1552 | 1553 | Tsodium_unpad = function(var unpadded_buflen_p: dwSIZE_T; 1554 | const buf: PAnsiChar; 1555 | const padded_buflen: dwSIZE_T; 1556 | const blocksize: dwSIZE_T): Integer cdecl; 1557 | 1558 | T_sodium_alloc_init = function: Integer cdecl; 1559 | 1560 | Tsodium_version_string = function: PAnsiChar cdecl; 1561 | 1562 | Tsodium_library_version_major = function: Integer cdecl; 1563 | 1564 | Tsodium_library_version_minor = function: Integer cdecl; 1565 | 1566 | Tsodium_init = function: Integer cdecl; 1567 | 1568 | Tsodium_free = procedure(ptr: Pointer) cdecl; 1569 | 1570 | //libsodium 1.0.6 1571 | Tsodium_compare = function(const b1: PAnsiChar; 1572 | const b2: PAnsiChar; 1573 | const len: dwSIZE_T): Integer cdecl; 1574 | 1575 | Tsodium_increment = procedure(const bin: PAnsiChar; 1576 | const bin_len: dwSIZE_T) cdecl; 1577 | 1578 | Tsodium_runtime_has_ssse3 = function: Integer cdecl; 1579 | 1580 | Tsodium_runtime_has_sse41 = function: Integer cdecl; 1581 | 1582 | Tsodium_runtime_has_avx = function: Integer cdecl; 1583 | 1584 | Tsodium_runtime_has_avx2 = function: Integer cdecl; 1585 | 1586 | Tsodium_runtime_has_avx512 = function: Integer cdecl; 1587 | 1588 | Tsodium_runtime_has_pclmul = function: Integer cdecl; 1589 | 1590 | Tsodium_runtime_has_aesni = function: Integer cdecl; 1591 | 1592 | var 1593 | sodium_init: Tsodium_init; 1594 | crypto_aead_chacha20poly1305_keybytes: Tcrypto_aead_chacha20poly1305_keybytes; 1595 | crypto_aead_chacha20poly1305_nsecbytes: Tcrypto_aead_chacha20poly1305_nsecbytes; 1596 | crypto_aead_chacha20poly1305_npubbytes: Tcrypto_aead_chacha20poly1305_npubbytes; 1597 | crypto_aead_chacha20poly1305_abytes: Tcrypto_aead_chacha20poly1305_abytes; 1598 | crypto_aead_chacha20poly1305_encrypt: Tcrypto_aead_chacha20poly1305_encrypt; 1599 | crypto_aead_chacha20poly1305_decrypt: Tcrypto_aead_chacha20poly1305_decrypt; 1600 | crypto_aead_chacha20poly1305_ietf_npubbytes: Tcrypto_aead_chacha20poly1305_ietf_npubbytes; 1601 | crypto_aead_chacha20poly1305_ietf_encrypt: Tcrypto_aead_chacha20poly1305_ietf_encrypt; 1602 | crypto_aead_chacha20poly1305_ietf_decrypt: Tcrypto_aead_chacha20poly1305_ietf_decrypt; 1603 | crypto_auth_bytes: Tcrypto_auth_bytes; 1604 | crypto_auth_keybytes: Tcrypto_auth_keybytes; 1605 | crypto_auth_primitive: Tcrypto_auth_primitive; 1606 | crypto_auth: Tcrypto_auth; 1607 | crypto_auth_verify: Tcrypto_auth_verify; 1608 | crypto_auth_hmacsha256_bytes: Tcrypto_auth_hmacsha256_bytes; 1609 | crypto_auth_hmacsha256_keybytes: Tcrypto_auth_hmacsha256_keybytes; 1610 | crypto_auth_hmacsha256: Tcrypto_auth_hmacsha256; 1611 | crypto_auth_hmacsha256_verify: Tcrypto_auth_hmacsha256_verify; 1612 | crypto_auth_hmacsha256_statebytes: Tcrypto_auth_hmacsha256_statebytes; 1613 | crypto_auth_hmacsha256_init: Tcrypto_auth_hmacsha256_init; 1614 | crypto_auth_hmacsha256_update: Tcrypto_auth_hmacsha256_update; 1615 | crypto_auth_hmacsha256_final: Tcrypto_auth_hmacsha256_final; 1616 | crypto_auth_hmacsha512_bytes: Tcrypto_auth_hmacsha512_bytes; 1617 | crypto_auth_hmacsha512_keybytes: Tcrypto_auth_hmacsha512_keybytes; 1618 | crypto_auth_hmacsha512: Tcrypto_auth_hmacsha512; 1619 | crypto_auth_hmacsha512_verify: Tcrypto_auth_hmacsha512_verify; 1620 | crypto_auth_hmacsha512_statebytes: Tcrypto_auth_hmacsha512_statebytes; 1621 | crypto_auth_hmacsha512_init: Tcrypto_auth_hmacsha512_init; 1622 | crypto_auth_hmacsha512_update: Tcrypto_auth_hmacsha512_update; 1623 | crypto_auth_hmacsha512_final: Tcrypto_auth_hmacsha512_final; 1624 | crypto_auth_hmacsha512256_bytes: Tcrypto_auth_hmacsha512256_bytes; 1625 | crypto_auth_hmacsha512256_keybytes: Tcrypto_auth_hmacsha512256_keybytes; 1626 | crypto_auth_hmacsha512256: Tcrypto_auth_hmacsha512256; 1627 | crypto_auth_hmacsha512256_verify: Tcrypto_auth_hmacsha512256_verify; 1628 | crypto_auth_hmacsha512256_statebytes: Tcrypto_auth_hmacsha512256_statebytes; 1629 | crypto_auth_hmacsha512256_init: Tcrypto_auth_hmacsha512256_init; 1630 | crypto_auth_hmacsha512256_update: Tcrypto_auth_hmacsha512256_update; 1631 | crypto_auth_hmacsha512256_final: Tcrypto_auth_hmacsha512256_final; 1632 | crypto_box_seedbytes: Tcrypto_box_seedbytes; 1633 | crypto_box_publickeybytes: Tcrypto_box_publickeybytes; 1634 | crypto_box_secretkeybytes: Tcrypto_box_secretkeybytes; 1635 | crypto_box_noncebytes: Tcrypto_box_noncebytes; 1636 | crypto_box_macbytes: Tcrypto_box_macbytes; 1637 | crypto_box_primitive: Tcrypto_box_primitive; 1638 | crypto_box_seed_keypair: Tcrypto_box_seed_keypair; 1639 | crypto_box_keypair: Tcrypto_box_keypair; 1640 | crypto_box_easy: Tcrypto_box_easy; 1641 | crypto_box_open_easy: Tcrypto_box_open_easy; 1642 | crypto_box_detached: Tcrypto_box_detached; 1643 | crypto_box_open_detached: Tcrypto_box_open_detached; 1644 | crypto_box_beforenmbytes: Tcrypto_box_beforenmbytes; 1645 | crypto_box_beforenm: Tcrypto_box_beforenm; 1646 | crypto_box_easy_afternm: Tcrypto_box_easy_afternm; 1647 | crypto_box_open_easy_afternm: Tcrypto_box_open_easy_afternm; 1648 | crypto_box_detached_afternm: Tcrypto_box_detached_afternm; 1649 | crypto_box_open_detached_afternm: Tcrypto_box_open_detached_afternm; 1650 | crypto_box_sealbytes: Tcrypto_box_sealbytes; 1651 | crypto_box_seal: Tcrypto_box_seal; 1652 | crypto_box_seal_open: Tcrypto_box_seal_open; 1653 | crypto_box_zerobytes: Tcrypto_box_zerobytes; 1654 | crypto_box_boxzerobytes: Tcrypto_box_boxzerobytes; 1655 | crypto_box: Tcrypto_box; 1656 | crypto_box_open: Tcrypto_box_open; 1657 | crypto_box_afternm: Tcrypto_box_afternm; 1658 | crypto_box_open_afternm: Tcrypto_box_open_afternm; 1659 | crypto_box_curve25519xsalsa20poly1305_seedbytes: Tcrypto_box_curve25519xsalsa20poly1305_seedbytes; 1660 | crypto_box_curve25519xsalsa20poly1305_publickeybytes: Tcrypto_box_curve25519xsalsa20poly1305_publickeybytes; 1661 | crypto_box_curve25519xsalsa20poly1305_secretkeybytes: Tcrypto_box_curve25519xsalsa20poly1305_secretkeybytes; 1662 | crypto_box_curve25519xsalsa20poly1305_beforenmbytes: Tcrypto_box_curve25519xsalsa20poly1305_beforenmbytes; 1663 | crypto_box_curve25519xsalsa20poly1305_noncebytes: Tcrypto_box_curve25519xsalsa20poly1305_noncebytes; 1664 | crypto_box_curve25519xsalsa20poly1305_zerobytes: Tcrypto_box_curve25519xsalsa20poly1305_zerobytes; 1665 | crypto_box_curve25519xsalsa20poly1305_boxzerobytes: Tcrypto_box_curve25519xsalsa20poly1305_boxzerobytes; 1666 | crypto_box_curve25519xsalsa20poly1305_macbytes: Tcrypto_box_curve25519xsalsa20poly1305_macbytes; 1667 | crypto_box_curve25519xsalsa20poly1305: Tcrypto_box_curve25519xsalsa20poly1305; 1668 | crypto_box_curve25519xsalsa20poly1305_open: Tcrypto_box_curve25519xsalsa20poly1305_open; 1669 | crypto_box_curve25519xsalsa20poly1305_seed_keypair: Tcrypto_box_curve25519xsalsa20poly1305_seed_keypair; 1670 | crypto_box_curve25519xsalsa20poly1305_keypair: Tcrypto_box_curve25519xsalsa20poly1305_keypair; 1671 | crypto_box_curve25519xsalsa20poly1305_beforenm: Tcrypto_box_curve25519xsalsa20poly1305_beforenm; 1672 | crypto_box_curve25519xsalsa20poly1305_afternm: Tcrypto_box_curve25519xsalsa20poly1305_afternm; 1673 | crypto_box_curve25519xsalsa20poly1305_open_afternm: Tcrypto_box_curve25519xsalsa20poly1305_open_afternm; 1674 | crypto_core_hsalsa20_outputbytes: Tcrypto_core_hsalsa20_outputbytes; 1675 | crypto_core_hsalsa20_inputbytes: Tcrypto_core_hsalsa20_inputbytes; 1676 | crypto_core_hsalsa20_keybytes: Tcrypto_core_hsalsa20_keybytes; 1677 | crypto_core_hsalsa20_constbytes: Tcrypto_core_hsalsa20_constbytes; 1678 | crypto_core_hsalsa20: Tcrypto_core_hsalsa20; 1679 | crypto_core_salsa20_outputbytes: Tcrypto_core_salsa20_outputbytes; 1680 | crypto_core_salsa20_inputbytes: Tcrypto_core_salsa20_inputbytes; 1681 | crypto_core_salsa20_keybytes: Tcrypto_core_salsa20_keybytes; 1682 | crypto_core_salsa20_constbytes: Tcrypto_core_salsa20_constbytes; 1683 | crypto_core_salsa20: Tcrypto_core_salsa20; 1684 | crypto_core_salsa2012_outputbytes: Tcrypto_core_salsa2012_outputbytes; 1685 | crypto_core_salsa2012_inputbytes: Tcrypto_core_salsa2012_inputbytes; 1686 | crypto_core_salsa2012_keybytes: Tcrypto_core_salsa2012_keybytes; 1687 | crypto_core_salsa2012_constbytes: Tcrypto_core_salsa2012_constbytes; 1688 | crypto_core_salsa2012: Tcrypto_core_salsa2012; 1689 | crypto_core_salsa208_outputbytes: Tcrypto_core_salsa208_outputbytes; 1690 | crypto_core_salsa208_inputbytes: Tcrypto_core_salsa208_inputbytes; 1691 | crypto_core_salsa208_keybytes: Tcrypto_core_salsa208_keybytes; 1692 | crypto_core_salsa208_constbytes: Tcrypto_core_salsa208_constbytes; 1693 | crypto_core_salsa208: Tcrypto_core_salsa208; 1694 | crypto_generichash_bytes_min: Tcrypto_generichash_bytes_min; 1695 | crypto_generichash_bytes_max: Tcrypto_generichash_bytes_max; 1696 | crypto_generichash_bytes: Tcrypto_generichash_bytes; 1697 | crypto_generichash_keybytes_min: Tcrypto_generichash_keybytes_min; 1698 | crypto_generichash_keybytes_max: Tcrypto_generichash_keybytes_max; 1699 | crypto_generichash_keybytes: Tcrypto_generichash_keybytes; 1700 | crypto_generichash_primitive: Tcrypto_generichash_primitive; 1701 | crypto_generichash_statebytes: Tcrypto_generichash_statebytes; 1702 | crypto_generichash: Tcrypto_generichash; 1703 | crypto_generichash_init: Tcrypto_generichash_init; 1704 | crypto_generichash_update: Tcrypto_generichash_update; 1705 | crypto_generichash_final: Tcrypto_generichash_final; 1706 | crypto_generichash_blake2b_bytes_min: Tcrypto_generichash_blake2b_bytes_min; 1707 | crypto_generichash_blake2b_bytes_max: Tcrypto_generichash_blake2b_bytes_max; 1708 | crypto_generichash_blake2b_bytes: Tcrypto_generichash_blake2b_bytes; 1709 | crypto_generichash_blake2b_keybytes_min: Tcrypto_generichash_blake2b_keybytes_min; 1710 | crypto_generichash_blake2b_keybytes_max: Tcrypto_generichash_blake2b_keybytes_max; 1711 | crypto_generichash_blake2b_keybytes: Tcrypto_generichash_blake2b_keybytes; 1712 | crypto_generichash_blake2b_saltbytes: Tcrypto_generichash_blake2b_saltbytes; 1713 | crypto_generichash_blake2b_personalbytes: Tcrypto_generichash_blake2b_personalbytes; 1714 | crypto_generichash_blake2b: Tcrypto_generichash_blake2b; 1715 | crypto_generichash_blake2b_salt_personal: Tcrypto_generichash_blake2b_salt_personal; 1716 | crypto_generichash_blake2b_init: Tcrypto_generichash_blake2b_init; 1717 | crypto_generichash_blake2b_init_salt_personal: Tcrypto_generichash_blake2b_init_salt_personal; 1718 | crypto_generichash_blake2b_update: Tcrypto_generichash_blake2b_update; 1719 | crypto_generichash_blake2b_final: Tcrypto_generichash_blake2b_final; 1720 | crypto_hash_bytes: Tcrypto_hash_bytes; 1721 | crypto_hash: Tcrypto_hash; 1722 | crypto_hash_primitive: Tcrypto_hash_primitive; 1723 | crypto_hash_sha256_statebytes: Tcrypto_hash_sha256_statebytes; 1724 | crypto_hash_sha256_bytes: Tcrypto_hash_sha256_bytes; 1725 | crypto_hash_sha256: Tcrypto_hash_sha256; 1726 | crypto_hash_sha256_init: Tcrypto_hash_sha256_init; 1727 | crypto_hash_sha256_update: Tcrypto_hash_sha256_update; 1728 | crypto_hash_sha256_final: Tcrypto_hash_sha256_final; 1729 | crypto_hash_sha512_statebytes: Tcrypto_hash_sha512_statebytes; 1730 | crypto_hash_sha512_bytes: Tcrypto_hash_sha512_bytes; 1731 | crypto_hash_sha512: Tcrypto_hash_sha512; 1732 | crypto_hash_sha512_init: Tcrypto_hash_sha512_init; 1733 | crypto_hash_sha512_update: Tcrypto_hash_sha512_update; 1734 | crypto_hash_sha512_final: Tcrypto_hash_sha512_final; 1735 | crypto_onetimeauth_statebytes: Tcrypto_onetimeauth_statebytes; 1736 | crypto_onetimeauth_bytes: Tcrypto_onetimeauth_bytes; 1737 | crypto_onetimeauth_keybytes: Tcrypto_onetimeauth_keybytes; 1738 | crypto_onetimeauth_primitive: Tcrypto_onetimeauth_primitive; 1739 | crypto_onetimeauth: Tcrypto_onetimeauth; 1740 | crypto_onetimeauth_verify: Tcrypto_onetimeauth_verify; 1741 | crypto_onetimeauth_init: Tcrypto_onetimeauth_init; 1742 | crypto_onetimeauth_update: Tcrypto_onetimeauth_update; 1743 | crypto_onetimeauth_final: Tcrypto_onetimeauth_final; 1744 | crypto_onetimeauth_poly1305_bytes: Tcrypto_onetimeauth_poly1305_bytes; 1745 | crypto_onetimeauth_poly1305_keybytes: Tcrypto_onetimeauth_poly1305_keybytes; 1746 | crypto_onetimeauth_poly1305: Tcrypto_onetimeauth_poly1305; 1747 | crypto_onetimeauth_poly1305_verify: Tcrypto_onetimeauth_poly1305_verify; 1748 | crypto_onetimeauth_poly1305_init: Tcrypto_onetimeauth_poly1305_init; 1749 | crypto_onetimeauth_poly1305_update: Tcrypto_onetimeauth_poly1305_update; 1750 | crypto_onetimeauth_poly1305_final: Tcrypto_onetimeauth_poly1305_final; 1751 | crypto_pwhash_scryptsalsa208sha256_saltbytes: Tcrypto_pwhash_scryptsalsa208sha256_saltbytes; 1752 | crypto_pwhash_scryptsalsa208sha256_strbytes: Tcrypto_pwhash_scryptsalsa208sha256_strbytes; 1753 | crypto_pwhash_scryptsalsa208sha256_strprefix: Tcrypto_pwhash_scryptsalsa208sha256_strprefix; 1754 | crypto_pwhash_scryptsalsa208sha256_opslimit_interactive: Tcrypto_pwhash_scryptsalsa208sha256_opslimit_interactive; 1755 | crypto_pwhash_scryptsalsa208sha256_memlimit_interactive: Tcrypto_pwhash_scryptsalsa208sha256_memlimit_interactive; 1756 | crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive: Tcrypto_pwhash_scryptsalsa208sha256_opslimit_sensitive; 1757 | crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive: Tcrypto_pwhash_scryptsalsa208sha256_memlimit_sensitive; 1758 | crypto_pwhash_scryptsalsa208sha256: Tcrypto_pwhash_scryptsalsa208sha256; 1759 | crypto_pwhash_scryptsalsa208sha256_str: Tcrypto_pwhash_scryptsalsa208sha256_str; 1760 | crypto_pwhash_scryptsalsa208sha256_str_verify: Tcrypto_pwhash_scryptsalsa208sha256_str_verify; 1761 | crypto_pwhash_scryptsalsa208sha256_ll: Tcrypto_pwhash_scryptsalsa208sha256_ll; 1762 | crypto_scalarmult_bytes: Tcrypto_scalarmult_bytes; 1763 | crypto_scalarmult_scalarbytes: Tcrypto_scalarmult_scalarbytes; 1764 | crypto_scalarmult_primitive: Tcrypto_scalarmult_primitive; 1765 | crypto_scalarmult_base: Tcrypto_scalarmult_base; 1766 | crypto_scalarmult: Tcrypto_scalarmult; 1767 | crypto_scalarmult_curve25519_bytes: Tcrypto_scalarmult_curve25519_bytes; 1768 | crypto_scalarmult_curve25519_scalarbytes: Tcrypto_scalarmult_curve25519_scalarbytes; 1769 | crypto_scalarmult_curve25519: Tcrypto_scalarmult_curve25519; 1770 | crypto_scalarmult_curve25519_base: Tcrypto_scalarmult_curve25519_base; 1771 | crypto_secretbox_keybytes: Tcrypto_secretbox_keybytes; 1772 | crypto_secretbox_noncebytes: Tcrypto_secretbox_noncebytes; 1773 | crypto_secretbox_macbytes: Tcrypto_secretbox_macbytes; 1774 | crypto_secretbox_primitive: Tcrypto_secretbox_primitive; 1775 | crypto_secretbox_easy: Tcrypto_secretbox_easy; 1776 | crypto_secretbox_open_easy: Tcrypto_secretbox_open_easy; 1777 | crypto_secretbox_detached: Tcrypto_secretbox_detached; 1778 | crypto_secretbox_open_detached: Tcrypto_secretbox_open_detached; 1779 | crypto_secretbox_zerobytes: Tcrypto_secretbox_zerobytes; 1780 | crypto_secretbox_boxzerobytes: Tcrypto_secretbox_boxzerobytes; 1781 | crypto_secretbox: Tcrypto_secretbox; 1782 | crypto_secretbox_open: Tcrypto_secretbox_open; 1783 | crypto_secretbox_xsalsa20poly1305_keybytes: Tcrypto_secretbox_xsalsa20poly1305_keybytes; 1784 | crypto_secretbox_xsalsa20poly1305_noncebytes: Tcrypto_secretbox_xsalsa20poly1305_noncebytes; 1785 | crypto_secretbox_xsalsa20poly1305_zerobytes: Tcrypto_secretbox_xsalsa20poly1305_zerobytes; 1786 | crypto_secretbox_xsalsa20poly1305_boxzerobytes: Tcrypto_secretbox_xsalsa20poly1305_boxzerobytes; 1787 | crypto_secretbox_xsalsa20poly1305_macbytes: Tcrypto_secretbox_xsalsa20poly1305_macbytes; 1788 | crypto_secretbox_xsalsa20poly1305: Tcrypto_secretbox_xsalsa20poly1305; 1789 | crypto_secretbox_xsalsa20poly1305_open: Tcrypto_secretbox_xsalsa20poly1305_open; 1790 | crypto_shorthash_bytes: Tcrypto_shorthash_bytes; 1791 | crypto_shorthash_keybytes: Tcrypto_shorthash_keybytes; 1792 | crypto_shorthash_primitive: Tcrypto_shorthash_primitive; 1793 | crypto_shorthash: Tcrypto_shorthash; 1794 | crypto_shorthash_siphash24_bytes: Tcrypto_shorthash_siphash24_bytes; 1795 | crypto_shorthash_siphash24_keybytes: Tcrypto_shorthash_siphash24_keybytes; 1796 | crypto_shorthash_siphash24: Tcrypto_shorthash_siphash24; 1797 | crypto_sign_bytes: Tcrypto_sign_bytes; 1798 | crypto_sign_seedbytes: Tcrypto_sign_seedbytes; 1799 | crypto_sign_publickeybytes: Tcrypto_sign_publickeybytes; 1800 | crypto_sign_secretkeybytes: Tcrypto_sign_secretkeybytes; 1801 | crypto_sign_primitive: Tcrypto_sign_primitive; 1802 | crypto_sign_seed_keypair: Tcrypto_sign_seed_keypair; 1803 | crypto_sign_keypair: Tcrypto_sign_keypair; 1804 | crypto_sign: Tcrypto_sign; 1805 | crypto_sign_open: Tcrypto_sign_open; 1806 | crypto_sign_detached: Tcrypto_sign_detached; 1807 | crypto_sign_verify_detached: Tcrypto_sign_verify_detached; 1808 | crypto_sign_ed25519_bytes: Tcrypto_sign_ed25519_bytes; 1809 | crypto_sign_ed25519_seedbytes: Tcrypto_sign_ed25519_seedbytes; 1810 | crypto_sign_ed25519_publickeybytes: Tcrypto_sign_ed25519_publickeybytes; 1811 | crypto_sign_ed25519_secretkeybytes: Tcrypto_sign_ed25519_secretkeybytes; 1812 | crypto_sign_ed25519: Tcrypto_sign_ed25519; 1813 | crypto_sign_ed25519_open: Tcrypto_sign_ed25519_open; 1814 | crypto_sign_ed25519_detached: Tcrypto_sign_ed25519_detached; 1815 | crypto_sign_ed25519_verify_detached: Tcrypto_sign_ed25519_verify_detached; 1816 | crypto_sign_ed25519_keypair: Tcrypto_sign_ed25519_keypair; 1817 | crypto_sign_ed25519_seed_keypair: Tcrypto_sign_ed25519_seed_keypair; 1818 | crypto_sign_ed25519_pk_to_curve25519: Tcrypto_sign_ed25519_pk_to_curve25519; 1819 | crypto_sign_ed25519_sk_to_curve25519: Tcrypto_sign_ed25519_sk_to_curve25519; 1820 | crypto_sign_ed25519_sk_to_seed: Tcrypto_sign_ed25519_sk_to_seed; 1821 | crypto_sign_ed25519_sk_to_pk: Tcrypto_sign_ed25519_sk_to_pk; 1822 | crypto_sign_edwards25519sha512batch_bytes: Tcrypto_sign_edwards25519sha512batch_bytes; 1823 | crypto_sign_edwards25519sha512batch_publickeybytes: Tcrypto_sign_edwards25519sha512batch_publickeybytes; 1824 | crypto_sign_edwards25519sha512batch_secretkeybytes: Tcrypto_sign_edwards25519sha512batch_secretkeybytes; 1825 | crypto_sign_edwards25519sha512batch: Tcrypto_sign_edwards25519sha512batch; 1826 | crypto_sign_edwards25519sha512batch_open: Tcrypto_sign_edwards25519sha512batch_open; 1827 | crypto_sign_edwards25519sha512batch_keypair: Tcrypto_sign_edwards25519sha512batch_keypair; 1828 | crypto_stream_keybytes: Tcrypto_stream_keybytes; 1829 | crypto_stream_noncebytes: Tcrypto_stream_noncebytes; 1830 | crypto_stream_primitive: Tcrypto_stream_primitive; 1831 | crypto_stream: Tcrypto_stream; 1832 | crypto_stream_xor: Tcrypto_stream_xor; 1833 | crypto_secretstream_xchacha20poly1305_abytes: Tcrypto_secretstream_xchacha20poly1305_abytes; 1834 | crypto_secretstream_xchacha20poly1305_headerbytes: Tcrypto_secretstream_xchacha20poly1305_headerbytes; 1835 | crypto_secretstream_xchacha20poly1305_keybytes: Tcrypto_secretstream_xchacha20poly1305_keybytes; 1836 | crypto_secretstream_xchacha20poly1305_messagebytes_max: Tcrypto_secretstream_xchacha20poly1305_messagebytes_max; 1837 | crypto_secretstream_xchacha20poly1305_tag_message: Tcrypto_secretstream_xchacha20poly1305_tag_message; 1838 | crypto_secretstream_xchacha20poly1305_tag_push: Tcrypto_secretstream_xchacha20poly1305_tag_push; 1839 | crypto_secretstream_xchacha20poly1305_tag_rekey: Tcrypto_secretstream_xchacha20poly1305_tag_rekey; 1840 | crypto_secretstream_xchacha20poly1305_tag_final: Tcrypto_secretstream_xchacha20poly1305_tag_final; 1841 | crypto_secretstream_xchacha20poly1305_statebytes: Tcrypto_secretstream_xchacha20poly1305_statebytes; 1842 | crypto_secretstream_xchacha20poly1305_keygen: Tcrypto_secretstream_xchacha20poly1305_keygen; 1843 | crypto_secretstream_xchacha20poly1305_init_push: Tcrypto_secretstream_xchacha20poly1305_init_push; 1844 | crypto_secretstream_xchacha20poly1305_push: Tcrypto_secretstream_xchacha20poly1305_push; 1845 | crypto_secretstream_xchacha20poly1305_init_pull: Tcrypto_secretstream_xchacha20poly1305_init_pull; 1846 | crypto_secretstream_xchacha20poly1305_pull: Tcrypto_secretstream_xchacha20poly1305_pull; 1847 | crypto_secretstream_xchacha20poly1305_rekey: Tcrypto_secretstream_xchacha20poly1305_rekey; 1848 | crypto_stream_chacha20_keybytes: Tcrypto_stream_chacha20_keybytes; 1849 | crypto_stream_chacha20_noncebytes: Tcrypto_stream_chacha20_noncebytes; 1850 | crypto_stream_chacha20: Tcrypto_stream_chacha20; 1851 | crypto_stream_chacha20_xor: Tcrypto_stream_chacha20_xor; 1852 | crypto_stream_chacha20_xor_ic: Tcrypto_stream_chacha20_xor_ic; 1853 | crypto_stream_chacha20_ietf_noncebytes: Tcrypto_stream_chacha20_ietf_noncebytes; 1854 | crypto_stream_chacha20_ietf: Tcrypto_stream_chacha20_ietf; 1855 | crypto_stream_chacha20_ietf_xor: Tcrypto_stream_chacha20_ietf_xor; 1856 | crypto_stream_chacha20_ietf_xor_ic: Tcrypto_stream_chacha20_ietf_xor_ic; 1857 | crypto_stream_salsa20_keybytes: Tcrypto_stream_salsa20_keybytes; 1858 | crypto_stream_salsa20_noncebytes: Tcrypto_stream_salsa20_noncebytes; 1859 | crypto_stream_salsa20: Tcrypto_stream_salsa20; 1860 | crypto_stream_salsa20_xor: Tcrypto_stream_salsa20_xor; 1861 | crypto_stream_salsa20_xor_ic: Tcrypto_stream_salsa20_xor_ic; 1862 | crypto_stream_salsa2012_keybytes: Tcrypto_stream_salsa2012_keybytes; 1863 | crypto_stream_salsa2012_noncebytes: Tcrypto_stream_salsa2012_noncebytes; 1864 | crypto_stream_salsa2012: Tcrypto_stream_salsa2012; 1865 | crypto_stream_salsa2012_xor: Tcrypto_stream_salsa2012_xor; 1866 | crypto_stream_xsalsa20_keybytes: Tcrypto_stream_xsalsa20_keybytes; 1867 | crypto_stream_xsalsa20_noncebytes: Tcrypto_stream_xsalsa20_noncebytes; 1868 | crypto_stream_xsalsa20: Tcrypto_stream_xsalsa20; 1869 | crypto_stream_xsalsa20_xor: Tcrypto_stream_xsalsa20_xor; 1870 | crypto_stream_xsalsa20_xor_ic: Tcrypto_stream_xsalsa20_xor_ic; 1871 | crypto_verify_16_bytes: Tcrypto_verify_16_bytes; 1872 | crypto_verify_16: Tcrypto_verify_16; 1873 | crypto_verify_32_bytes: Tcrypto_verify_32_bytes; 1874 | crypto_verify_32: Tcrypto_verify_32; 1875 | crypto_verify_64_bytes: Tcrypto_verify_64_bytes; 1876 | crypto_verify_64: Tcrypto_verify_64; 1877 | randombytes_buf: Trandombytes_buf; 1878 | randombytes_buf_deterministic: Trandombytes_buf_deterministic; 1879 | randombytes_random: Trandombytes_random; 1880 | randombytes_uniform: Trandombytes_uniform; 1881 | randombytes_stir: Trandombytes_stir; 1882 | randombytes_close: Trandombytes_close; 1883 | randombytes_set_implementation: Trandombytes_set_implementation; 1884 | randombytes_implementation_name: Trandombytes_implementation_name; 1885 | randombytes: Trandombytes; 1886 | randombytes_salsa20_implementation_name: Trandombytes_salsa20_implementation_name; 1887 | randombytes_salsa20_random: Trandombytes_salsa20_random; 1888 | randombytes_salsa20_random_stir: Trandombytes_salsa20_random_stir; 1889 | randombytes_salsa20_random_uniform: Trandombytes_salsa20_random_uniform; 1890 | randombytes_salsa20_random_buf: Trandombytes_salsa20_random_buf; 1891 | randombytes_salsa20_random_close: Trandombytes_salsa20_random_close; 1892 | randombytes_sysrandom_implementation_name: Trandombytes_sysrandom_implementation_name; 1893 | randombytes_sysrandom: Trandombytes_sysrandom; 1894 | randombytes_sysrandom_stir: Trandombytes_sysrandom_stir; 1895 | randombytes_sysrandom_uniform: Trandombytes_sysrandom_uniform; 1896 | randombytes_sysrandom_buf: Trandombytes_sysrandom_buf; 1897 | randombytes_sysrandom_close: Trandombytes_sysrandom_close; 1898 | sodium_runtime_has_neon: Tsodium_runtime_has_neon; 1899 | sodium_runtime_has_sse2: Tsodium_runtime_has_sse2; 1900 | sodium_runtime_has_sse3: Tsodium_runtime_has_sse3; 1901 | sodium_memzero: Tsodium_memzero; 1902 | sodium_memcmp: Tsodium_memcmp; 1903 | sodium_bin2hex: Tsodium_bin2hex; 1904 | sodium_hex2bin: Tsodium_hex2bin; 1905 | sodium_bin2base64: Tsodium_bin2base64; 1906 | sodium_base642bin: Tsodium_base642bin; 1907 | sodium_mlock: Tsodium_mlock; 1908 | sodium_munlock: Tsodium_munlock; 1909 | sodium_malloc: Tsodium_malloc; 1910 | sodium_free: Tsodium_free; 1911 | sodium_allocarray: Tsodium_allocarray; 1912 | sodium_mprotect_noaccess: Tsodium_mprotect_noaccess; 1913 | sodium_mprotect_readonly: Tsodium_mprotect_readonly; 1914 | sodium_mprotect_readwrite: Tsodium_mprotect_readwrite; 1915 | sodium_pad: Tsodium_pad; 1916 | sodium_unpad: Tsodium_unpad; 1917 | _sodium_alloc_init: T_sodium_alloc_init; 1918 | sodium_version_string: Tsodium_version_string; 1919 | sodium_library_version_major: Tsodium_library_version_major; 1920 | sodium_library_version_minor: Tsodium_library_version_minor; 1921 | 1922 | //libsodium 1.0.6 1923 | sodium_compare: Tsodium_compare; 1924 | sodium_increment: Tsodium_increment; 1925 | sodium_runtime_has_ssse3: Tsodium_runtime_has_ssse3; 1926 | sodium_runtime_has_sse41: Tsodium_runtime_has_sse41; 1927 | sodium_runtime_has_avx: Tsodium_runtime_has_avx; 1928 | sodium_runtime_has_avx2: Tsodium_runtime_has_avx2; 1929 | sodium_runtime_has_avx512: Tsodium_runtime_has_avx512; 1930 | sodium_runtime_has_pclmul: Tsodium_runtime_has_pclmul; 1931 | sodium_runtime_has_aesni: Tsodium_runtime_has_aesni; 1932 | 1933 | 1934 | var 1935 | sodium_dllLoaded: Boolean = False; { is DLL (dynamically) loaded already? } 1936 | sodium_dllFileName: AnsiString = 'libsodium.dll'; 1937 | 1938 | 1939 | implementation 1940 | 1941 | 1942 | var 1943 | SaveExit: pointer; 1944 | DLLHandle: THandle; 1945 | {$IFNDEF MSDOS} 1946 | ErrorMode: Integer; 1947 | {$ENDIF} 1948 | 1949 | procedure NewExit; far; 1950 | begin 1951 | ExitProc := SaveExit; 1952 | FreeLibrary(DLLHandle) 1953 | end {NewExit}; 1954 | 1955 | procedure LoadDLL; 1956 | begin 1957 | if sodium_dllLoaded then Exit; 1958 | {$IFNDEF MSDOS} 1959 | ErrorMode := SetErrorMode($8000{SEM_NoOpenFileErrorBox}); 1960 | {$ENDIF} 1961 | {$IFDEF WIN64} 1962 | if FileExists('libsodium64.dll') then sodium_dllFileName := 'libsodium64.dll'; 1963 | {$ENDIF} 1964 | {$IF CompilerVersion >= 20.0} { Delphi 2009 unicode } 1965 | DLLHandle := LoadLibrary(PWideChar(WideString(sodium_dllFileName))); 1966 | {$ELSE} 1967 | DLLHandle := LoadLibrary(PAnsiChar(sodium_dllFileName)); 1968 | {$IFEND} 1969 | if DLLHandle >= 32 then 1970 | begin 1971 | sodium_dllLoaded := True; 1972 | SaveExit := ExitProc; 1973 | ExitProc := @NewExit; 1974 | @sodium_init := GetProcAddress(DLLHandle,'sodium_init'); 1975 | {$IFDEF WIN32} 1976 | Assert(@sodium_init <> nil); 1977 | {$ENDIF} 1978 | @crypto_aead_chacha20poly1305_keybytes := GetProcAddress(DLLHandle,'crypto_aead_chacha20poly1305_keybytes'); 1979 | {$IFDEF WIN32} 1980 | Assert(@crypto_aead_chacha20poly1305_keybytes <> nil); 1981 | {$ENDIF} 1982 | @crypto_aead_chacha20poly1305_nsecbytes := GetProcAddress(DLLHandle,'crypto_aead_chacha20poly1305_nsecbytes'); 1983 | {$IFDEF WIN32} 1984 | Assert(@crypto_aead_chacha20poly1305_nsecbytes <> nil); 1985 | {$ENDIF} 1986 | @crypto_aead_chacha20poly1305_npubbytes := GetProcAddress(DLLHandle,'crypto_aead_chacha20poly1305_npubbytes'); 1987 | {$IFDEF WIN32} 1988 | Assert(@crypto_aead_chacha20poly1305_npubbytes <> nil); 1989 | {$ENDIF} 1990 | @crypto_aead_chacha20poly1305_abytes := GetProcAddress(DLLHandle,'crypto_aead_chacha20poly1305_abytes'); 1991 | {$IFDEF WIN32} 1992 | Assert(@crypto_aead_chacha20poly1305_abytes <> nil); 1993 | {$ENDIF} 1994 | @crypto_aead_chacha20poly1305_encrypt := GetProcAddress(DLLHandle,'crypto_aead_chacha20poly1305_encrypt'); 1995 | {$IFDEF WIN32} 1996 | Assert(@crypto_aead_chacha20poly1305_encrypt <> nil); 1997 | {$ENDIF} 1998 | @crypto_aead_chacha20poly1305_decrypt := GetProcAddress(DLLHandle,'crypto_aead_chacha20poly1305_decrypt'); 1999 | {$IFDEF WIN32} 2000 | Assert(@crypto_aead_chacha20poly1305_decrypt <> nil); 2001 | {$ENDIF} 2002 | @crypto_auth_bytes := GetProcAddress(DLLHandle,'crypto_auth_bytes'); 2003 | {$IFDEF WIN32} 2004 | Assert(@crypto_auth_bytes <> nil); 2005 | {$ENDIF} 2006 | @crypto_auth_keybytes := GetProcAddress(DLLHandle,'crypto_auth_keybytes'); 2007 | {$IFDEF WIN32} 2008 | Assert(@crypto_auth_keybytes <> nil); 2009 | {$ENDIF} 2010 | @crypto_auth_primitive := GetProcAddress(DLLHandle,'crypto_auth_primitive'); 2011 | {$IFDEF WIN32} 2012 | Assert(@crypto_auth_primitive <> nil); 2013 | {$ENDIF} 2014 | @crypto_auth := GetProcAddress(DLLHandle,'crypto_auth'); 2015 | {$IFDEF WIN32} 2016 | Assert(@crypto_auth <> nil); 2017 | {$ENDIF} 2018 | @crypto_auth_verify := GetProcAddress(DLLHandle,'crypto_auth_verify'); 2019 | {$IFDEF WIN32} 2020 | Assert(@crypto_auth_verify <> nil); 2021 | {$ENDIF} 2022 | @crypto_auth_hmacsha256_bytes := GetProcAddress(DLLHandle,'crypto_auth_hmacsha256_bytes'); 2023 | {$IFDEF WIN32} 2024 | Assert(@crypto_auth_hmacsha256_bytes <> nil); 2025 | {$ENDIF} 2026 | @crypto_auth_hmacsha256_keybytes := GetProcAddress(DLLHandle,'crypto_auth_hmacsha256_keybytes'); 2027 | {$IFDEF WIN32} 2028 | Assert(@crypto_auth_hmacsha256_keybytes <> nil); 2029 | {$ENDIF} 2030 | @crypto_auth_hmacsha256 := GetProcAddress(DLLHandle,'crypto_auth_hmacsha256'); 2031 | {$IFDEF WIN32} 2032 | Assert(@crypto_auth_hmacsha256 <> nil); 2033 | {$ENDIF} 2034 | @crypto_auth_hmacsha256_verify := GetProcAddress(DLLHandle,'crypto_auth_hmacsha256_verify'); 2035 | {$IFDEF WIN32} 2036 | Assert(@crypto_auth_hmacsha256_verify <> nil); 2037 | {$ENDIF} 2038 | @crypto_auth_hmacsha256_statebytes := GetProcAddress(DLLHandle,'crypto_auth_hmacsha256_statebytes'); 2039 | {$IFDEF WIN32} 2040 | Assert(@crypto_auth_hmacsha256_statebytes <> nil); 2041 | {$ENDIF} 2042 | @crypto_auth_hmacsha256_init := GetProcAddress(DLLHandle,'crypto_auth_hmacsha256_init'); 2043 | {$IFDEF WIN32} 2044 | Assert(@crypto_auth_hmacsha256_init <> nil); 2045 | {$ENDIF} 2046 | @crypto_auth_hmacsha256_update := GetProcAddress(DLLHandle,'crypto_auth_hmacsha256_update'); 2047 | {$IFDEF WIN32} 2048 | Assert(@crypto_auth_hmacsha256_update <> nil); 2049 | {$ENDIF} 2050 | @crypto_auth_hmacsha256_final := GetProcAddress(DLLHandle,'crypto_auth_hmacsha256_final'); 2051 | {$IFDEF WIN32} 2052 | Assert(@crypto_auth_hmacsha256_final <> nil); 2053 | {$ENDIF} 2054 | @crypto_auth_hmacsha512_bytes := GetProcAddress(DLLHandle,'crypto_auth_hmacsha512_bytes'); 2055 | {$IFDEF WIN32} 2056 | Assert(@crypto_auth_hmacsha512_bytes <> nil); 2057 | {$ENDIF} 2058 | @crypto_auth_hmacsha512_keybytes := GetProcAddress(DLLHandle,'crypto_auth_hmacsha512_keybytes'); 2059 | {$IFDEF WIN32} 2060 | Assert(@crypto_auth_hmacsha512_keybytes <> nil); 2061 | {$ENDIF} 2062 | @crypto_auth_hmacsha512 := GetProcAddress(DLLHandle,'crypto_auth_hmacsha512'); 2063 | {$IFDEF WIN32} 2064 | Assert(@crypto_auth_hmacsha512 <> nil); 2065 | {$ENDIF} 2066 | @crypto_auth_hmacsha512_verify := GetProcAddress(DLLHandle,'crypto_auth_hmacsha512_verify'); 2067 | {$IFDEF WIN32} 2068 | Assert(@crypto_auth_hmacsha512_verify <> nil); 2069 | {$ENDIF} 2070 | @crypto_auth_hmacsha512_statebytes := GetProcAddress(DLLHandle,'crypto_auth_hmacsha512_statebytes'); 2071 | {$IFDEF WIN32} 2072 | Assert(@crypto_auth_hmacsha512_statebytes <> nil); 2073 | {$ENDIF} 2074 | @crypto_auth_hmacsha512_init := GetProcAddress(DLLHandle,'crypto_auth_hmacsha512_init'); 2075 | {$IFDEF WIN32} 2076 | Assert(@crypto_auth_hmacsha512_init <> nil); 2077 | {$ENDIF} 2078 | @crypto_auth_hmacsha512_update := GetProcAddress(DLLHandle,'crypto_auth_hmacsha512_update'); 2079 | {$IFDEF WIN32} 2080 | Assert(@crypto_auth_hmacsha512_update <> nil); 2081 | {$ENDIF} 2082 | @crypto_auth_hmacsha512_final := GetProcAddress(DLLHandle,'crypto_auth_hmacsha512_final'); 2083 | {$IFDEF WIN32} 2084 | Assert(@crypto_auth_hmacsha512_final <> nil); 2085 | {$ENDIF} 2086 | @crypto_auth_hmacsha512256_bytes := GetProcAddress(DLLHandle,'crypto_auth_hmacsha512256_bytes'); 2087 | {$IFDEF WIN32} 2088 | Assert(@crypto_auth_hmacsha512256_bytes <> nil); 2089 | {$ENDIF} 2090 | @crypto_auth_hmacsha512256_keybytes := GetProcAddress(DLLHandle,'crypto_auth_hmacsha512256_keybytes'); 2091 | {$IFDEF WIN32} 2092 | Assert(@crypto_auth_hmacsha512256_keybytes <> nil); 2093 | {$ENDIF} 2094 | @crypto_auth_hmacsha512256 := GetProcAddress(DLLHandle,'crypto_auth_hmacsha512256'); 2095 | {$IFDEF WIN32} 2096 | Assert(@crypto_auth_hmacsha512256 <> nil); 2097 | {$ENDIF} 2098 | @crypto_auth_hmacsha512256_verify := GetProcAddress(DLLHandle,'crypto_auth_hmacsha512256_verify'); 2099 | {$IFDEF WIN32} 2100 | Assert(@crypto_auth_hmacsha512256_verify <> nil); 2101 | {$ENDIF} 2102 | @crypto_auth_hmacsha512256_statebytes := GetProcAddress(DLLHandle,'crypto_auth_hmacsha512256_statebytes'); 2103 | {$IFDEF WIN32} 2104 | Assert(@crypto_auth_hmacsha512256_statebytes <> nil); 2105 | {$ENDIF} 2106 | @crypto_auth_hmacsha512256_init := GetProcAddress(DLLHandle,'crypto_auth_hmacsha512256_init'); 2107 | {$IFDEF WIN32} 2108 | Assert(@crypto_auth_hmacsha512256_init <> nil); 2109 | {$ENDIF} 2110 | @crypto_auth_hmacsha512256_update := GetProcAddress(DLLHandle,'crypto_auth_hmacsha512256_update'); 2111 | {$IFDEF WIN32} 2112 | Assert(@crypto_auth_hmacsha512256_update <> nil); 2113 | {$ENDIF} 2114 | @crypto_auth_hmacsha512256_final := GetProcAddress(DLLHandle,'crypto_auth_hmacsha512256_final'); 2115 | {$IFDEF WIN32} 2116 | Assert(@crypto_auth_hmacsha512256_final <> nil); 2117 | {$ENDIF} 2118 | @crypto_box_seedbytes := GetProcAddress(DLLHandle,'crypto_box_seedbytes'); 2119 | {$IFDEF WIN32} 2120 | Assert(@crypto_box_seedbytes <> nil); 2121 | {$ENDIF} 2122 | @crypto_box_publickeybytes := GetProcAddress(DLLHandle,'crypto_box_publickeybytes'); 2123 | {$IFDEF WIN32} 2124 | Assert(@crypto_box_publickeybytes <> nil); 2125 | {$ENDIF} 2126 | @crypto_box_secretkeybytes := GetProcAddress(DLLHandle,'crypto_box_secretkeybytes'); 2127 | {$IFDEF WIN32} 2128 | Assert(@crypto_box_secretkeybytes <> nil); 2129 | {$ENDIF} 2130 | @crypto_box_noncebytes := GetProcAddress(DLLHandle,'crypto_box_noncebytes'); 2131 | {$IFDEF WIN32} 2132 | Assert(@crypto_box_noncebytes <> nil); 2133 | {$ENDIF} 2134 | @crypto_box_macbytes := GetProcAddress(DLLHandle,'crypto_box_macbytes'); 2135 | {$IFDEF WIN32} 2136 | Assert(@crypto_box_macbytes <> nil); 2137 | {$ENDIF} 2138 | @crypto_box_primitive := GetProcAddress(DLLHandle,'crypto_box_primitive'); 2139 | {$IFDEF WIN32} 2140 | Assert(@crypto_box_primitive <> nil); 2141 | {$ENDIF} 2142 | @crypto_box_seed_keypair := GetProcAddress(DLLHandle,'crypto_box_seed_keypair'); 2143 | {$IFDEF WIN32} 2144 | Assert(@crypto_box_seed_keypair <> nil); 2145 | {$ENDIF} 2146 | @crypto_box_keypair := GetProcAddress(DLLHandle,'crypto_box_keypair'); 2147 | {$IFDEF WIN32} 2148 | Assert(@crypto_box_keypair <> nil); 2149 | {$ENDIF} 2150 | @crypto_box_easy := GetProcAddress(DLLHandle,'crypto_box_easy'); 2151 | {$IFDEF WIN32} 2152 | Assert(@crypto_box_easy <> nil); 2153 | {$ENDIF} 2154 | @crypto_box_open_easy := GetProcAddress(DLLHandle,'crypto_box_open_easy'); 2155 | {$IFDEF WIN32} 2156 | Assert(@crypto_box_open_easy <> nil); 2157 | {$ENDIF} 2158 | @crypto_box_detached := GetProcAddress(DLLHandle,'crypto_box_detached'); 2159 | {$IFDEF WIN32} 2160 | Assert(@crypto_box_detached <> nil); 2161 | {$ENDIF} 2162 | @crypto_box_open_detached := GetProcAddress(DLLHandle,'crypto_box_open_detached'); 2163 | {$IFDEF WIN32} 2164 | Assert(@crypto_box_open_detached <> nil); 2165 | {$ENDIF} 2166 | @crypto_box_beforenmbytes := GetProcAddress(DLLHandle,'crypto_box_beforenmbytes'); 2167 | {$IFDEF WIN32} 2168 | Assert(@crypto_box_beforenmbytes <> nil); 2169 | {$ENDIF} 2170 | @crypto_box_beforenm := GetProcAddress(DLLHandle,'crypto_box_beforenm'); 2171 | {$IFDEF WIN32} 2172 | Assert(@crypto_box_beforenm <> nil); 2173 | {$ENDIF} 2174 | @crypto_box_easy_afternm := GetProcAddress(DLLHandle,'crypto_box_easy_afternm'); 2175 | {$IFDEF WIN32} 2176 | Assert(@crypto_box_easy_afternm <> nil); 2177 | {$ENDIF} 2178 | @crypto_box_open_easy_afternm := GetProcAddress(DLLHandle,'crypto_box_open_easy_afternm'); 2179 | {$IFDEF WIN32} 2180 | Assert(@crypto_box_open_easy_afternm <> nil); 2181 | {$ENDIF} 2182 | @crypto_box_detached_afternm := GetProcAddress(DLLHandle,'crypto_box_detached_afternm'); 2183 | {$IFDEF WIN32} 2184 | Assert(@crypto_box_detached_afternm <> nil); 2185 | {$ENDIF} 2186 | @crypto_box_open_detached_afternm := GetProcAddress(DLLHandle,'crypto_box_open_detached_afternm'); 2187 | {$IFDEF WIN32} 2188 | Assert(@crypto_box_open_detached_afternm <> nil); 2189 | {$ENDIF} 2190 | @crypto_box_sealbytes := GetProcAddress(DLLHandle,'crypto_box_sealbytes'); 2191 | {$IFDEF WIN32} 2192 | Assert(@crypto_box_sealbytes <> nil); 2193 | {$ENDIF} 2194 | @crypto_box_seal := GetProcAddress(DLLHandle,'crypto_box_seal'); 2195 | {$IFDEF WIN32} 2196 | Assert(@crypto_box_seal <> nil); 2197 | {$ENDIF} 2198 | @crypto_box_seal_open := GetProcAddress(DLLHandle,'crypto_box_seal_open'); 2199 | {$IFDEF WIN32} 2200 | Assert(@crypto_box_seal_open <> nil); 2201 | {$ENDIF} 2202 | @crypto_box_zerobytes := GetProcAddress(DLLHandle,'crypto_box_zerobytes'); 2203 | {$IFDEF WIN32} 2204 | Assert(@crypto_box_zerobytes <> nil); 2205 | {$ENDIF} 2206 | @crypto_box_boxzerobytes := GetProcAddress(DLLHandle,'crypto_box_boxzerobytes'); 2207 | {$IFDEF WIN32} 2208 | Assert(@crypto_box_boxzerobytes <> nil); 2209 | {$ENDIF} 2210 | @crypto_box := GetProcAddress(DLLHandle,'crypto_box'); 2211 | {$IFDEF WIN32} 2212 | Assert(@crypto_box <> nil); 2213 | {$ENDIF} 2214 | @crypto_box_open := GetProcAddress(DLLHandle,'crypto_box_open'); 2215 | {$IFDEF WIN32} 2216 | Assert(@crypto_box_open <> nil); 2217 | {$ENDIF} 2218 | @crypto_box_afternm := GetProcAddress(DLLHandle,'crypto_box_afternm'); 2219 | {$IFDEF WIN32} 2220 | Assert(@crypto_box_afternm <> nil); 2221 | {$ENDIF} 2222 | @crypto_box_open_afternm := GetProcAddress(DLLHandle,'crypto_box_open_afternm'); 2223 | {$IFDEF WIN32} 2224 | Assert(@crypto_box_open_afternm <> nil); 2225 | {$ENDIF} 2226 | @crypto_box_curve25519xsalsa20poly1305_seedbytes := GetProcAddress(DLLHandle,'crypto_box_curve25519xsalsa20poly1305_seedbytes'); 2227 | {$IFDEF WIN32} 2228 | Assert(@crypto_box_curve25519xsalsa20poly1305_seedbytes <> nil); 2229 | {$ENDIF} 2230 | @crypto_box_curve25519xsalsa20poly1305_publickeybytes := GetProcAddress(DLLHandle,'crypto_box_curve25519xsalsa20poly1305_publickeybytes'); 2231 | {$IFDEF WIN32} 2232 | Assert(@crypto_box_curve25519xsalsa20poly1305_publickeybytes <> nil); 2233 | {$ENDIF} 2234 | @crypto_box_curve25519xsalsa20poly1305_secretkeybytes := GetProcAddress(DLLHandle,'crypto_box_curve25519xsalsa20poly1305_secretkeybytes'); 2235 | {$IFDEF WIN32} 2236 | Assert(@crypto_box_curve25519xsalsa20poly1305_secretkeybytes <> nil); 2237 | {$ENDIF} 2238 | @crypto_box_curve25519xsalsa20poly1305_beforenmbytes := GetProcAddress(DLLHandle,'crypto_box_curve25519xsalsa20poly1305_beforenmbytes'); 2239 | {$IFDEF WIN32} 2240 | Assert(@crypto_box_curve25519xsalsa20poly1305_beforenmbytes <> nil); 2241 | {$ENDIF} 2242 | @crypto_box_curve25519xsalsa20poly1305_noncebytes := GetProcAddress(DLLHandle,'crypto_box_curve25519xsalsa20poly1305_noncebytes'); 2243 | {$IFDEF WIN32} 2244 | Assert(@crypto_box_curve25519xsalsa20poly1305_noncebytes <> nil); 2245 | {$ENDIF} 2246 | @crypto_box_curve25519xsalsa20poly1305_zerobytes := GetProcAddress(DLLHandle,'crypto_box_curve25519xsalsa20poly1305_zerobytes'); 2247 | {$IFDEF WIN32} 2248 | Assert(@crypto_box_curve25519xsalsa20poly1305_zerobytes <> nil); 2249 | {$ENDIF} 2250 | @crypto_box_curve25519xsalsa20poly1305_boxzerobytes := GetProcAddress(DLLHandle,'crypto_box_curve25519xsalsa20poly1305_boxzerobytes'); 2251 | {$IFDEF WIN32} 2252 | Assert(@crypto_box_curve25519xsalsa20poly1305_boxzerobytes <> nil); 2253 | {$ENDIF} 2254 | @crypto_box_curve25519xsalsa20poly1305_macbytes := GetProcAddress(DLLHandle,'crypto_box_curve25519xsalsa20poly1305_macbytes'); 2255 | {$IFDEF WIN32} 2256 | Assert(@crypto_box_curve25519xsalsa20poly1305_macbytes <> nil); 2257 | {$ENDIF} 2258 | @crypto_box_curve25519xsalsa20poly1305 := GetProcAddress(DLLHandle,'crypto_box_curve25519xsalsa20poly1305'); 2259 | {$IFDEF WIN32} 2260 | Assert(@crypto_box_curve25519xsalsa20poly1305 <> nil); 2261 | {$ENDIF} 2262 | @crypto_box_curve25519xsalsa20poly1305_open := GetProcAddress(DLLHandle,'crypto_box_curve25519xsalsa20poly1305_open'); 2263 | {$IFDEF WIN32} 2264 | Assert(@crypto_box_curve25519xsalsa20poly1305_open <> nil); 2265 | {$ENDIF} 2266 | @crypto_box_curve25519xsalsa20poly1305_seed_keypair := GetProcAddress(DLLHandle,'crypto_box_curve25519xsalsa20poly1305_seed_keypair'); 2267 | {$IFDEF WIN32} 2268 | Assert(@crypto_box_curve25519xsalsa20poly1305_seed_keypair <> nil); 2269 | {$ENDIF} 2270 | @crypto_box_curve25519xsalsa20poly1305_keypair := GetProcAddress(DLLHandle,'crypto_box_curve25519xsalsa20poly1305_keypair'); 2271 | {$IFDEF WIN32} 2272 | Assert(@crypto_box_curve25519xsalsa20poly1305_keypair <> nil); 2273 | {$ENDIF} 2274 | @crypto_box_curve25519xsalsa20poly1305_beforenm := GetProcAddress(DLLHandle,'crypto_box_curve25519xsalsa20poly1305_beforenm'); 2275 | {$IFDEF WIN32} 2276 | Assert(@crypto_box_curve25519xsalsa20poly1305_beforenm <> nil); 2277 | {$ENDIF} 2278 | @crypto_box_curve25519xsalsa20poly1305_afternm := GetProcAddress(DLLHandle,'crypto_box_curve25519xsalsa20poly1305_afternm'); 2279 | {$IFDEF WIN32} 2280 | Assert(@crypto_box_curve25519xsalsa20poly1305_afternm <> nil); 2281 | {$ENDIF} 2282 | @crypto_box_curve25519xsalsa20poly1305_open_afternm := GetProcAddress(DLLHandle,'crypto_box_curve25519xsalsa20poly1305_open_afternm'); 2283 | {$IFDEF WIN32} 2284 | Assert(@crypto_box_curve25519xsalsa20poly1305_open_afternm <> nil); 2285 | {$ENDIF} 2286 | @crypto_core_hsalsa20_outputbytes := GetProcAddress(DLLHandle,'crypto_core_hsalsa20_outputbytes'); 2287 | {$IFDEF WIN32} 2288 | Assert(@crypto_core_hsalsa20_outputbytes <> nil); 2289 | {$ENDIF} 2290 | @crypto_core_hsalsa20_inputbytes := GetProcAddress(DLLHandle,'crypto_core_hsalsa20_inputbytes'); 2291 | {$IFDEF WIN32} 2292 | Assert(@crypto_core_hsalsa20_inputbytes <> nil); 2293 | {$ENDIF} 2294 | @crypto_core_hsalsa20_keybytes := GetProcAddress(DLLHandle,'crypto_core_hsalsa20_keybytes'); 2295 | {$IFDEF WIN32} 2296 | Assert(@crypto_core_hsalsa20_keybytes <> nil); 2297 | {$ENDIF} 2298 | @crypto_core_hsalsa20_constbytes := GetProcAddress(DLLHandle,'crypto_core_hsalsa20_constbytes'); 2299 | {$IFDEF WIN32} 2300 | Assert(@crypto_core_hsalsa20_constbytes <> nil); 2301 | {$ENDIF} 2302 | @crypto_core_hsalsa20 := GetProcAddress(DLLHandle,'crypto_core_hsalsa20'); 2303 | {$IFDEF WIN32} 2304 | Assert(@crypto_core_hsalsa20 <> nil); 2305 | {$ENDIF} 2306 | @crypto_core_salsa20_outputbytes := GetProcAddress(DLLHandle,'crypto_core_salsa20_outputbytes'); 2307 | {$IFDEF WIN32} 2308 | Assert(@crypto_core_salsa20_outputbytes <> nil); 2309 | {$ENDIF} 2310 | @crypto_core_salsa20_inputbytes := GetProcAddress(DLLHandle,'crypto_core_salsa20_inputbytes'); 2311 | {$IFDEF WIN32} 2312 | Assert(@crypto_core_salsa20_inputbytes <> nil); 2313 | {$ENDIF} 2314 | @crypto_core_salsa20_keybytes := GetProcAddress(DLLHandle,'crypto_core_salsa20_keybytes'); 2315 | {$IFDEF WIN32} 2316 | Assert(@crypto_core_salsa20_keybytes <> nil); 2317 | {$ENDIF} 2318 | @crypto_core_salsa20_constbytes := GetProcAddress(DLLHandle,'crypto_core_salsa20_constbytes'); 2319 | {$IFDEF WIN32} 2320 | Assert(@crypto_core_salsa20_constbytes <> nil); 2321 | {$ENDIF} 2322 | @crypto_core_salsa20 := GetProcAddress(DLLHandle,'crypto_core_salsa20'); 2323 | {$IFDEF WIN32} 2324 | Assert(@crypto_core_salsa20 <> nil); 2325 | {$ENDIF} 2326 | @crypto_core_salsa2012_outputbytes := GetProcAddress(DLLHandle,'crypto_core_salsa2012_outputbytes'); 2327 | {$IFDEF WIN32} 2328 | Assert(@crypto_core_salsa2012_outputbytes <> nil); 2329 | {$ENDIF} 2330 | @crypto_core_salsa2012_inputbytes := GetProcAddress(DLLHandle,'crypto_core_salsa2012_inputbytes'); 2331 | {$IFDEF WIN32} 2332 | Assert(@crypto_core_salsa2012_inputbytes <> nil); 2333 | {$ENDIF} 2334 | @crypto_core_salsa2012_keybytes := GetProcAddress(DLLHandle,'crypto_core_salsa2012_keybytes'); 2335 | {$IFDEF WIN32} 2336 | Assert(@crypto_core_salsa2012_keybytes <> nil); 2337 | {$ENDIF} 2338 | @crypto_core_salsa2012_constbytes := GetProcAddress(DLLHandle,'crypto_core_salsa2012_constbytes'); 2339 | {$IFDEF WIN32} 2340 | Assert(@crypto_core_salsa2012_constbytes <> nil); 2341 | {$ENDIF} 2342 | @crypto_core_salsa2012 := GetProcAddress(DLLHandle,'crypto_core_salsa2012'); 2343 | {$IFDEF WIN32} 2344 | Assert(@crypto_core_salsa2012 <> nil); 2345 | {$ENDIF} 2346 | @crypto_core_salsa208_outputbytes := GetProcAddress(DLLHandle,'crypto_core_salsa208_outputbytes'); 2347 | {$IFDEF WIN32} 2348 | Assert(@crypto_core_salsa208_outputbytes <> nil); 2349 | {$ENDIF} 2350 | @crypto_core_salsa208_inputbytes := GetProcAddress(DLLHandle,'crypto_core_salsa208_inputbytes'); 2351 | {$IFDEF WIN32} 2352 | Assert(@crypto_core_salsa208_inputbytes <> nil); 2353 | {$ENDIF} 2354 | @crypto_core_salsa208_keybytes := GetProcAddress(DLLHandle,'crypto_core_salsa208_keybytes'); 2355 | {$IFDEF WIN32} 2356 | Assert(@crypto_core_salsa208_keybytes <> nil); 2357 | {$ENDIF} 2358 | @crypto_core_salsa208_constbytes := GetProcAddress(DLLHandle,'crypto_core_salsa208_constbytes'); 2359 | {$IFDEF WIN32} 2360 | Assert(@crypto_core_salsa208_constbytes <> nil); 2361 | {$ENDIF} 2362 | @crypto_core_salsa208 := GetProcAddress(DLLHandle,'crypto_core_salsa208'); 2363 | {$IFDEF WIN32} 2364 | Assert(@crypto_core_salsa208 <> nil); 2365 | {$ENDIF} 2366 | @crypto_generichash_bytes_min := GetProcAddress(DLLHandle,'crypto_generichash_bytes_min'); 2367 | {$IFDEF WIN32} 2368 | Assert(@crypto_generichash_bytes_min <> nil); 2369 | {$ENDIF} 2370 | @crypto_generichash_bytes_max := GetProcAddress(DLLHandle,'crypto_generichash_bytes_max'); 2371 | {$IFDEF WIN32} 2372 | Assert(@crypto_generichash_bytes_max <> nil); 2373 | {$ENDIF} 2374 | @crypto_generichash_bytes := GetProcAddress(DLLHandle,'crypto_generichash_bytes'); 2375 | {$IFDEF WIN32} 2376 | Assert(@crypto_generichash_bytes <> nil); 2377 | {$ENDIF} 2378 | @crypto_generichash_keybytes_min := GetProcAddress(DLLHandle,'crypto_generichash_keybytes_min'); 2379 | {$IFDEF WIN32} 2380 | Assert(@crypto_generichash_keybytes_min <> nil); 2381 | {$ENDIF} 2382 | @crypto_generichash_keybytes_max := GetProcAddress(DLLHandle,'crypto_generichash_keybytes_max'); 2383 | {$IFDEF WIN32} 2384 | Assert(@crypto_generichash_keybytes_max <> nil); 2385 | {$ENDIF} 2386 | @crypto_generichash_keybytes := GetProcAddress(DLLHandle,'crypto_generichash_keybytes'); 2387 | {$IFDEF WIN32} 2388 | Assert(@crypto_generichash_keybytes <> nil); 2389 | {$ENDIF} 2390 | @crypto_generichash_primitive := GetProcAddress(DLLHandle,'crypto_generichash_primitive'); 2391 | {$IFDEF WIN32} 2392 | Assert(@crypto_generichash_primitive <> nil); 2393 | {$ENDIF} 2394 | @crypto_generichash_statebytes := GetProcAddress(DLLHandle,'crypto_generichash_statebytes'); 2395 | {$IFDEF WIN32} 2396 | Assert(@crypto_generichash_statebytes <> nil); 2397 | {$ENDIF} 2398 | @crypto_generichash := GetProcAddress(DLLHandle,'crypto_generichash'); 2399 | {$IFDEF WIN32} 2400 | Assert(@crypto_generichash <> nil); 2401 | {$ENDIF} 2402 | @crypto_generichash_init := GetProcAddress(DLLHandle,'crypto_generichash_init'); 2403 | {$IFDEF WIN32} 2404 | Assert(@crypto_generichash_init <> nil); 2405 | {$ENDIF} 2406 | @crypto_generichash_update := GetProcAddress(DLLHandle,'crypto_generichash_update'); 2407 | {$IFDEF WIN32} 2408 | Assert(@crypto_generichash_update <> nil); 2409 | {$ENDIF} 2410 | @crypto_generichash_final := GetProcAddress(DLLHandle,'crypto_generichash_final'); 2411 | {$IFDEF WIN32} 2412 | Assert(@crypto_generichash_final <> nil); 2413 | {$ENDIF} 2414 | @crypto_generichash_blake2b_bytes_min := GetProcAddress(DLLHandle,'crypto_generichash_blake2b_bytes_min'); 2415 | {$IFDEF WIN32} 2416 | Assert(@crypto_generichash_blake2b_bytes_min <> nil); 2417 | {$ENDIF} 2418 | @crypto_generichash_blake2b_bytes_max := GetProcAddress(DLLHandle,'crypto_generichash_blake2b_bytes_max'); 2419 | {$IFDEF WIN32} 2420 | Assert(@crypto_generichash_blake2b_bytes_max <> nil); 2421 | {$ENDIF} 2422 | @crypto_generichash_blake2b_bytes := GetProcAddress(DLLHandle,'crypto_generichash_blake2b_bytes'); 2423 | {$IFDEF WIN32} 2424 | Assert(@crypto_generichash_blake2b_bytes <> nil); 2425 | {$ENDIF} 2426 | @crypto_generichash_blake2b_keybytes_min := GetProcAddress(DLLHandle,'crypto_generichash_blake2b_keybytes_min'); 2427 | {$IFDEF WIN32} 2428 | Assert(@crypto_generichash_blake2b_keybytes_min <> nil); 2429 | {$ENDIF} 2430 | @crypto_generichash_blake2b_keybytes_max := GetProcAddress(DLLHandle,'crypto_generichash_blake2b_keybytes_max'); 2431 | {$IFDEF WIN32} 2432 | Assert(@crypto_generichash_blake2b_keybytes_max <> nil); 2433 | {$ENDIF} 2434 | @crypto_generichash_blake2b_keybytes := GetProcAddress(DLLHandle,'crypto_generichash_blake2b_keybytes'); 2435 | {$IFDEF WIN32} 2436 | Assert(@crypto_generichash_blake2b_keybytes <> nil); 2437 | {$ENDIF} 2438 | @crypto_generichash_blake2b_saltbytes := GetProcAddress(DLLHandle,'crypto_generichash_blake2b_saltbytes'); 2439 | {$IFDEF WIN32} 2440 | Assert(@crypto_generichash_blake2b_saltbytes <> nil); 2441 | {$ENDIF} 2442 | @crypto_generichash_blake2b_personalbytes := GetProcAddress(DLLHandle,'crypto_generichash_blake2b_personalbytes'); 2443 | {$IFDEF WIN32} 2444 | Assert(@crypto_generichash_blake2b_personalbytes <> nil); 2445 | {$ENDIF} 2446 | @crypto_generichash_blake2b := GetProcAddress(DLLHandle,'crypto_generichash_blake2b'); 2447 | {$IFDEF WIN32} 2448 | Assert(@crypto_generichash_blake2b <> nil); 2449 | {$ENDIF} 2450 | @crypto_generichash_blake2b_salt_personal := GetProcAddress(DLLHandle,'crypto_generichash_blake2b_salt_personal'); 2451 | {$IFDEF WIN32} 2452 | Assert(@crypto_generichash_blake2b_salt_personal <> nil); 2453 | {$ENDIF} 2454 | @crypto_generichash_blake2b_init := GetProcAddress(DLLHandle,'crypto_generichash_blake2b_init'); 2455 | {$IFDEF WIN32} 2456 | Assert(@crypto_generichash_blake2b_init <> nil); 2457 | {$ENDIF} 2458 | @crypto_generichash_blake2b_init_salt_personal := GetProcAddress(DLLHandle,'crypto_generichash_blake2b_init_salt_personal'); 2459 | {$IFDEF WIN32} 2460 | Assert(@crypto_generichash_blake2b_init_salt_personal <> nil); 2461 | {$ENDIF} 2462 | @crypto_generichash_blake2b_update := GetProcAddress(DLLHandle,'crypto_generichash_blake2b_update'); 2463 | {$IFDEF WIN32} 2464 | Assert(@crypto_generichash_blake2b_update <> nil); 2465 | {$ENDIF} 2466 | @crypto_generichash_blake2b_final := GetProcAddress(DLLHandle,'crypto_generichash_blake2b_final'); 2467 | {$IFDEF WIN32} 2468 | Assert(@crypto_generichash_blake2b_final <> nil); 2469 | {$ENDIF} 2470 | @crypto_hash_bytes := GetProcAddress(DLLHandle,'crypto_hash_bytes'); 2471 | {$IFDEF WIN32} 2472 | Assert(@crypto_hash_bytes <> nil); 2473 | {$ENDIF} 2474 | @crypto_hash := GetProcAddress(DLLHandle,'crypto_hash'); 2475 | {$IFDEF WIN32} 2476 | Assert(@crypto_hash <> nil); 2477 | {$ENDIF} 2478 | @crypto_hash_primitive := GetProcAddress(DLLHandle,'crypto_hash_primitive'); 2479 | {$IFDEF WIN32} 2480 | Assert(@crypto_hash_primitive <> nil); 2481 | {$ENDIF} 2482 | @crypto_hash_sha256_statebytes := GetProcAddress(DLLHandle,'crypto_hash_sha256_statebytes'); 2483 | {$IFDEF WIN32} 2484 | Assert(@crypto_hash_sha256_statebytes <> nil); 2485 | {$ENDIF} 2486 | @crypto_hash_sha256_bytes := GetProcAddress(DLLHandle,'crypto_hash_sha256_bytes'); 2487 | {$IFDEF WIN32} 2488 | Assert(@crypto_hash_sha256_bytes <> nil); 2489 | {$ENDIF} 2490 | @crypto_hash_sha256 := GetProcAddress(DLLHandle,'crypto_hash_sha256'); 2491 | {$IFDEF WIN32} 2492 | Assert(@crypto_hash_sha256 <> nil); 2493 | {$ENDIF} 2494 | @crypto_hash_sha256_init := GetProcAddress(DLLHandle,'crypto_hash_sha256_init'); 2495 | {$IFDEF WIN32} 2496 | Assert(@crypto_hash_sha256_init <> nil); 2497 | {$ENDIF} 2498 | @crypto_hash_sha256_update := GetProcAddress(DLLHandle,'crypto_hash_sha256_update'); 2499 | {$IFDEF WIN32} 2500 | Assert(@crypto_hash_sha256_update <> nil); 2501 | {$ENDIF} 2502 | @crypto_hash_sha256_final := GetProcAddress(DLLHandle,'crypto_hash_sha256_final'); 2503 | {$IFDEF WIN32} 2504 | Assert(@crypto_hash_sha256_final <> nil); 2505 | {$ENDIF} 2506 | @crypto_hash_sha512_statebytes := GetProcAddress(DLLHandle,'crypto_hash_sha512_statebytes'); 2507 | {$IFDEF WIN32} 2508 | Assert(@crypto_hash_sha512_statebytes <> nil); 2509 | {$ENDIF} 2510 | @crypto_hash_sha512_bytes := GetProcAddress(DLLHandle,'crypto_hash_sha512_bytes'); 2511 | {$IFDEF WIN32} 2512 | Assert(@crypto_hash_sha512_bytes <> nil); 2513 | {$ENDIF} 2514 | @crypto_hash_sha512 := GetProcAddress(DLLHandle,'crypto_hash_sha512'); 2515 | {$IFDEF WIN32} 2516 | Assert(@crypto_hash_sha512 <> nil); 2517 | {$ENDIF} 2518 | @crypto_hash_sha512_init := GetProcAddress(DLLHandle,'crypto_hash_sha512_init'); 2519 | {$IFDEF WIN32} 2520 | Assert(@crypto_hash_sha512_init <> nil); 2521 | {$ENDIF} 2522 | @crypto_hash_sha512_update := GetProcAddress(DLLHandle,'crypto_hash_sha512_update'); 2523 | {$IFDEF WIN32} 2524 | Assert(@crypto_hash_sha512_update <> nil); 2525 | {$ENDIF} 2526 | @crypto_hash_sha512_final := GetProcAddress(DLLHandle,'crypto_hash_sha512_final'); 2527 | {$IFDEF WIN32} 2528 | Assert(@crypto_hash_sha512_final <> nil); 2529 | {$ENDIF} 2530 | @crypto_onetimeauth_statebytes := GetProcAddress(DLLHandle,'crypto_onetimeauth_statebytes'); 2531 | {$IFDEF WIN32} 2532 | Assert(@crypto_onetimeauth_statebytes <> nil); 2533 | {$ENDIF} 2534 | @crypto_onetimeauth_bytes := GetProcAddress(DLLHandle,'crypto_onetimeauth_bytes'); 2535 | {$IFDEF WIN32} 2536 | Assert(@crypto_onetimeauth_bytes <> nil); 2537 | {$ENDIF} 2538 | @crypto_onetimeauth_keybytes := GetProcAddress(DLLHandle,'crypto_onetimeauth_keybytes'); 2539 | {$IFDEF WIN32} 2540 | Assert(@crypto_onetimeauth_keybytes <> nil); 2541 | {$ENDIF} 2542 | @crypto_onetimeauth_primitive := GetProcAddress(DLLHandle,'crypto_onetimeauth_primitive'); 2543 | {$IFDEF WIN32} 2544 | Assert(@crypto_onetimeauth_primitive <> nil); 2545 | {$ENDIF} 2546 | @crypto_onetimeauth := GetProcAddress(DLLHandle,'crypto_onetimeauth'); 2547 | {$IFDEF WIN32} 2548 | Assert(@crypto_onetimeauth <> nil); 2549 | {$ENDIF} 2550 | @crypto_onetimeauth_verify := GetProcAddress(DLLHandle,'crypto_onetimeauth_verify'); 2551 | {$IFDEF WIN32} 2552 | Assert(@crypto_onetimeauth_verify <> nil); 2553 | {$ENDIF} 2554 | @crypto_onetimeauth_init := GetProcAddress(DLLHandle,'crypto_onetimeauth_init'); 2555 | {$IFDEF WIN32} 2556 | Assert(@crypto_onetimeauth_init <> nil); 2557 | {$ENDIF} 2558 | @crypto_onetimeauth_update := GetProcAddress(DLLHandle,'crypto_onetimeauth_update'); 2559 | {$IFDEF WIN32} 2560 | Assert(@crypto_onetimeauth_update <> nil); 2561 | {$ENDIF} 2562 | @crypto_onetimeauth_final := GetProcAddress(DLLHandle,'crypto_onetimeauth_final'); 2563 | {$IFDEF WIN32} 2564 | Assert(@crypto_onetimeauth_final <> nil); 2565 | {$ENDIF} 2566 | @crypto_onetimeauth_poly1305_bytes := GetProcAddress(DLLHandle,'crypto_onetimeauth_poly1305_bytes'); 2567 | {$IFDEF WIN32} 2568 | Assert(@crypto_onetimeauth_poly1305_bytes <> nil); 2569 | {$ENDIF} 2570 | @crypto_onetimeauth_poly1305_keybytes := GetProcAddress(DLLHandle,'crypto_onetimeauth_poly1305_keybytes'); 2571 | {$IFDEF WIN32} 2572 | Assert(@crypto_onetimeauth_poly1305_keybytes <> nil); 2573 | {$ENDIF} 2574 | @crypto_onetimeauth_poly1305 := GetProcAddress(DLLHandle,'crypto_onetimeauth_poly1305'); 2575 | {$IFDEF WIN32} 2576 | Assert(@crypto_onetimeauth_poly1305 <> nil); 2577 | {$ENDIF} 2578 | @crypto_onetimeauth_poly1305_verify := GetProcAddress(DLLHandle,'crypto_onetimeauth_poly1305_verify'); 2579 | {$IFDEF WIN32} 2580 | Assert(@crypto_onetimeauth_poly1305_verify <> nil); 2581 | {$ENDIF} 2582 | @crypto_onetimeauth_poly1305_init := GetProcAddress(DLLHandle,'crypto_onetimeauth_poly1305_init'); 2583 | {$IFDEF WIN32} 2584 | Assert(@crypto_onetimeauth_poly1305_init <> nil); 2585 | {$ENDIF} 2586 | @crypto_onetimeauth_poly1305_update := GetProcAddress(DLLHandle,'crypto_onetimeauth_poly1305_update'); 2587 | {$IFDEF WIN32} 2588 | Assert(@crypto_onetimeauth_poly1305_update <> nil); 2589 | {$ENDIF} 2590 | @crypto_onetimeauth_poly1305_final := GetProcAddress(DLLHandle,'crypto_onetimeauth_poly1305_final'); 2591 | {$IFDEF WIN32} 2592 | Assert(@crypto_onetimeauth_poly1305_final <> nil); 2593 | {$ENDIF} 2594 | @crypto_pwhash_scryptsalsa208sha256_saltbytes := GetProcAddress(DLLHandle,'crypto_pwhash_scryptsalsa208sha256_saltbytes'); 2595 | {$IFDEF WIN32} 2596 | Assert(@crypto_pwhash_scryptsalsa208sha256_saltbytes <> nil); 2597 | {$ENDIF} 2598 | @crypto_pwhash_scryptsalsa208sha256_strbytes := GetProcAddress(DLLHandle,'crypto_pwhash_scryptsalsa208sha256_strbytes'); 2599 | {$IFDEF WIN32} 2600 | Assert(@crypto_pwhash_scryptsalsa208sha256_strbytes <> nil); 2601 | {$ENDIF} 2602 | @crypto_pwhash_scryptsalsa208sha256_strprefix := GetProcAddress(DLLHandle,'crypto_pwhash_scryptsalsa208sha256_strprefix'); 2603 | {$IFDEF WIN32} 2604 | Assert(@crypto_pwhash_scryptsalsa208sha256_strprefix <> nil); 2605 | {$ENDIF} 2606 | @crypto_pwhash_scryptsalsa208sha256_opslimit_interactive := GetProcAddress(DLLHandle,'crypto_pwhash_scryptsalsa208sha256_opslimit_interactive'); 2607 | {$IFDEF WIN32} 2608 | Assert(@crypto_pwhash_scryptsalsa208sha256_opslimit_interactive <> nil); 2609 | {$ENDIF} 2610 | @crypto_pwhash_scryptsalsa208sha256_memlimit_interactive := GetProcAddress(DLLHandle,'crypto_pwhash_scryptsalsa208sha256_memlimit_interactive'); 2611 | {$IFDEF WIN32} 2612 | Assert(@crypto_pwhash_scryptsalsa208sha256_memlimit_interactive <> nil); 2613 | {$ENDIF} 2614 | @crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive := GetProcAddress(DLLHandle,'crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive'); 2615 | {$IFDEF WIN32} 2616 | Assert(@crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive <> nil); 2617 | {$ENDIF} 2618 | @crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive := GetProcAddress(DLLHandle,'crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive'); 2619 | {$IFDEF WIN32} 2620 | Assert(@crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive <> nil); 2621 | {$ENDIF} 2622 | @crypto_pwhash_scryptsalsa208sha256 := GetProcAddress(DLLHandle,'crypto_pwhash_scryptsalsa208sha256'); 2623 | {$IFDEF WIN32} 2624 | Assert(@crypto_pwhash_scryptsalsa208sha256 <> nil); 2625 | {$ENDIF} 2626 | @crypto_pwhash_scryptsalsa208sha256_str := GetProcAddress(DLLHandle,'crypto_pwhash_scryptsalsa208sha256_str'); 2627 | {$IFDEF WIN32} 2628 | Assert(@crypto_pwhash_scryptsalsa208sha256_str <> nil); 2629 | {$ENDIF} 2630 | @crypto_pwhash_scryptsalsa208sha256_str_verify := GetProcAddress(DLLHandle,'crypto_pwhash_scryptsalsa208sha256_str_verify'); 2631 | {$IFDEF WIN32} 2632 | Assert(@crypto_pwhash_scryptsalsa208sha256_str_verify <> nil); 2633 | {$ENDIF} 2634 | @crypto_pwhash_scryptsalsa208sha256_ll := GetProcAddress(DLLHandle,'crypto_pwhash_scryptsalsa208sha256_ll'); 2635 | {$IFDEF WIN32} 2636 | Assert(@crypto_pwhash_scryptsalsa208sha256_ll <> nil); 2637 | {$ENDIF} 2638 | @crypto_scalarmult_bytes := GetProcAddress(DLLHandle,'crypto_scalarmult_bytes'); 2639 | {$IFDEF WIN32} 2640 | Assert(@crypto_scalarmult_bytes <> nil); 2641 | {$ENDIF} 2642 | @crypto_scalarmult_scalarbytes := GetProcAddress(DLLHandle,'crypto_scalarmult_scalarbytes'); 2643 | {$IFDEF WIN32} 2644 | Assert(@crypto_scalarmult_scalarbytes <> nil); 2645 | {$ENDIF} 2646 | @crypto_scalarmult_primitive := GetProcAddress(DLLHandle,'crypto_scalarmult_primitive'); 2647 | {$IFDEF WIN32} 2648 | Assert(@crypto_scalarmult_primitive <> nil); 2649 | {$ENDIF} 2650 | @crypto_scalarmult_base := GetProcAddress(DLLHandle,'crypto_scalarmult_base'); 2651 | {$IFDEF WIN32} 2652 | Assert(@crypto_scalarmult_base <> nil); 2653 | {$ENDIF} 2654 | @crypto_scalarmult := GetProcAddress(DLLHandle,'crypto_scalarmult'); 2655 | {$IFDEF WIN32} 2656 | Assert(@crypto_scalarmult <> nil); 2657 | {$ENDIF} 2658 | @crypto_scalarmult_curve25519_bytes := GetProcAddress(DLLHandle,'crypto_scalarmult_curve25519_bytes'); 2659 | {$IFDEF WIN32} 2660 | Assert(@crypto_scalarmult_curve25519_bytes <> nil); 2661 | {$ENDIF} 2662 | @crypto_scalarmult_curve25519_scalarbytes := GetProcAddress(DLLHandle,'crypto_scalarmult_curve25519_scalarbytes'); 2663 | {$IFDEF WIN32} 2664 | Assert(@crypto_scalarmult_curve25519_scalarbytes <> nil); 2665 | {$ENDIF} 2666 | @crypto_scalarmult_curve25519 := GetProcAddress(DLLHandle,'crypto_scalarmult_curve25519'); 2667 | {$IFDEF WIN32} 2668 | Assert(@crypto_scalarmult_curve25519 <> nil); 2669 | {$ENDIF} 2670 | @crypto_scalarmult_curve25519_base := GetProcAddress(DLLHandle,'crypto_scalarmult_curve25519_base'); 2671 | {$IFDEF WIN32} 2672 | Assert(@crypto_scalarmult_curve25519_base <> nil); 2673 | {$ENDIF} 2674 | @crypto_secretbox_keybytes := GetProcAddress(DLLHandle,'crypto_secretbox_keybytes'); 2675 | {$IFDEF WIN32} 2676 | Assert(@crypto_secretbox_keybytes <> nil); 2677 | {$ENDIF} 2678 | @crypto_secretbox_noncebytes := GetProcAddress(DLLHandle,'crypto_secretbox_noncebytes'); 2679 | {$IFDEF WIN32} 2680 | Assert(@crypto_secretbox_noncebytes <> nil); 2681 | {$ENDIF} 2682 | @crypto_secretbox_macbytes := GetProcAddress(DLLHandle,'crypto_secretbox_macbytes'); 2683 | {$IFDEF WIN32} 2684 | Assert(@crypto_secretbox_macbytes <> nil); 2685 | {$ENDIF} 2686 | @crypto_secretbox_primitive := GetProcAddress(DLLHandle,'crypto_secretbox_primitive'); 2687 | {$IFDEF WIN32} 2688 | Assert(@crypto_secretbox_primitive <> nil); 2689 | {$ENDIF} 2690 | @crypto_secretbox_easy := GetProcAddress(DLLHandle,'crypto_secretbox_easy'); 2691 | {$IFDEF WIN32} 2692 | Assert(@crypto_secretbox_easy <> nil); 2693 | {$ENDIF} 2694 | @crypto_secretbox_open_easy := GetProcAddress(DLLHandle,'crypto_secretbox_open_easy'); 2695 | {$IFDEF WIN32} 2696 | Assert(@crypto_secretbox_open_easy <> nil); 2697 | {$ENDIF} 2698 | @crypto_secretbox_detached := GetProcAddress(DLLHandle,'crypto_secretbox_detached'); 2699 | {$IFDEF WIN32} 2700 | Assert(@crypto_secretbox_detached <> nil); 2701 | {$ENDIF} 2702 | @crypto_secretbox_open_detached := GetProcAddress(DLLHandle,'crypto_secretbox_open_detached'); 2703 | {$IFDEF WIN32} 2704 | Assert(@crypto_secretbox_open_detached <> nil); 2705 | {$ENDIF} 2706 | @crypto_secretbox_zerobytes := GetProcAddress(DLLHandle,'crypto_secretbox_zerobytes'); 2707 | {$IFDEF WIN32} 2708 | Assert(@crypto_secretbox_zerobytes <> nil); 2709 | {$ENDIF} 2710 | @crypto_secretbox_boxzerobytes := GetProcAddress(DLLHandle,'crypto_secretbox_boxzerobytes'); 2711 | {$IFDEF WIN32} 2712 | Assert(@crypto_secretbox_boxzerobytes <> nil); 2713 | {$ENDIF} 2714 | @crypto_secretbox := GetProcAddress(DLLHandle,'crypto_secretbox'); 2715 | {$IFDEF WIN32} 2716 | Assert(@crypto_secretbox <> nil); 2717 | {$ENDIF} 2718 | @crypto_secretbox_open := GetProcAddress(DLLHandle,'crypto_secretbox_open'); 2719 | {$IFDEF WIN32} 2720 | Assert(@crypto_secretbox_open <> nil); 2721 | {$ENDIF} 2722 | @crypto_secretbox_xsalsa20poly1305_keybytes := GetProcAddress(DLLHandle,'crypto_secretbox_xsalsa20poly1305_keybytes'); 2723 | {$IFDEF WIN32} 2724 | Assert(@crypto_secretbox_xsalsa20poly1305_keybytes <> nil); 2725 | {$ENDIF} 2726 | @crypto_secretbox_xsalsa20poly1305_noncebytes := GetProcAddress(DLLHandle,'crypto_secretbox_xsalsa20poly1305_noncebytes'); 2727 | {$IFDEF WIN32} 2728 | Assert(@crypto_secretbox_xsalsa20poly1305_noncebytes <> nil); 2729 | {$ENDIF} 2730 | @crypto_secretbox_xsalsa20poly1305_zerobytes := GetProcAddress(DLLHandle,'crypto_secretbox_xsalsa20poly1305_zerobytes'); 2731 | {$IFDEF WIN32} 2732 | Assert(@crypto_secretbox_xsalsa20poly1305_zerobytes <> nil); 2733 | {$ENDIF} 2734 | @crypto_secretbox_xsalsa20poly1305_boxzerobytes := GetProcAddress(DLLHandle,'crypto_secretbox_xsalsa20poly1305_boxzerobytes'); 2735 | {$IFDEF WIN32} 2736 | Assert(@crypto_secretbox_xsalsa20poly1305_boxzerobytes <> nil); 2737 | {$ENDIF} 2738 | @crypto_secretbox_xsalsa20poly1305_macbytes := GetProcAddress(DLLHandle,'crypto_secretbox_xsalsa20poly1305_macbytes'); 2739 | {$IFDEF WIN32} 2740 | Assert(@crypto_secretbox_xsalsa20poly1305_macbytes <> nil); 2741 | {$ENDIF} 2742 | @crypto_secretbox_xsalsa20poly1305 := GetProcAddress(DLLHandle,'crypto_secretbox_xsalsa20poly1305'); 2743 | {$IFDEF WIN32} 2744 | Assert(@crypto_secretbox_xsalsa20poly1305 <> nil); 2745 | {$ENDIF} 2746 | @crypto_secretbox_xsalsa20poly1305_open := GetProcAddress(DLLHandle,'crypto_secretbox_xsalsa20poly1305_open'); 2747 | {$IFDEF WIN32} 2748 | Assert(@crypto_secretbox_xsalsa20poly1305_open <> nil); 2749 | {$ENDIF} 2750 | @crypto_shorthash_bytes := GetProcAddress(DLLHandle,'crypto_shorthash_bytes'); 2751 | {$IFDEF WIN32} 2752 | Assert(@crypto_shorthash_bytes <> nil); 2753 | {$ENDIF} 2754 | @crypto_shorthash_keybytes := GetProcAddress(DLLHandle,'crypto_shorthash_keybytes'); 2755 | {$IFDEF WIN32} 2756 | Assert(@crypto_shorthash_keybytes <> nil); 2757 | {$ENDIF} 2758 | @crypto_shorthash_primitive := GetProcAddress(DLLHandle,'crypto_shorthash_primitive'); 2759 | {$IFDEF WIN32} 2760 | Assert(@crypto_shorthash_primitive <> nil); 2761 | {$ENDIF} 2762 | @crypto_shorthash := GetProcAddress(DLLHandle,'crypto_shorthash'); 2763 | {$IFDEF WIN32} 2764 | Assert(@crypto_shorthash <> nil); 2765 | {$ENDIF} 2766 | @crypto_shorthash_siphash24_bytes := GetProcAddress(DLLHandle,'crypto_shorthash_siphash24_bytes'); 2767 | {$IFDEF WIN32} 2768 | Assert(@crypto_shorthash_siphash24_bytes <> nil); 2769 | {$ENDIF} 2770 | @crypto_shorthash_siphash24_keybytes := GetProcAddress(DLLHandle,'crypto_shorthash_siphash24_keybytes'); 2771 | {$IFDEF WIN32} 2772 | Assert(@crypto_shorthash_siphash24_keybytes <> nil); 2773 | {$ENDIF} 2774 | @crypto_shorthash_siphash24 := GetProcAddress(DLLHandle,'crypto_shorthash_siphash24'); 2775 | {$IFDEF WIN32} 2776 | Assert(@crypto_shorthash_siphash24 <> nil); 2777 | {$ENDIF} 2778 | @crypto_sign_bytes := GetProcAddress(DLLHandle,'crypto_sign_bytes'); 2779 | {$IFDEF WIN32} 2780 | Assert(@crypto_sign_bytes <> nil); 2781 | {$ENDIF} 2782 | @crypto_sign_seedbytes := GetProcAddress(DLLHandle,'crypto_sign_seedbytes'); 2783 | {$IFDEF WIN32} 2784 | Assert(@crypto_sign_seedbytes <> nil); 2785 | {$ENDIF} 2786 | @crypto_sign_publickeybytes := GetProcAddress(DLLHandle,'crypto_sign_publickeybytes'); 2787 | {$IFDEF WIN32} 2788 | Assert(@crypto_sign_publickeybytes <> nil); 2789 | {$ENDIF} 2790 | @crypto_sign_secretkeybytes := GetProcAddress(DLLHandle,'crypto_sign_secretkeybytes'); 2791 | {$IFDEF WIN32} 2792 | Assert(@crypto_sign_secretkeybytes <> nil); 2793 | {$ENDIF} 2794 | @crypto_sign_primitive := GetProcAddress(DLLHandle,'crypto_sign_primitive'); 2795 | {$IFDEF WIN32} 2796 | Assert(@crypto_sign_primitive <> nil); 2797 | {$ENDIF} 2798 | @crypto_sign_seed_keypair := GetProcAddress(DLLHandle,'crypto_sign_seed_keypair'); 2799 | {$IFDEF WIN32} 2800 | Assert(@crypto_sign_seed_keypair <> nil); 2801 | {$ENDIF} 2802 | @crypto_sign_keypair := GetProcAddress(DLLHandle,'crypto_sign_keypair'); 2803 | {$IFDEF WIN32} 2804 | Assert(@crypto_sign_keypair <> nil); 2805 | {$ENDIF} 2806 | @crypto_sign := GetProcAddress(DLLHandle,'crypto_sign'); 2807 | {$IFDEF WIN32} 2808 | Assert(@crypto_sign <> nil); 2809 | {$ENDIF} 2810 | @crypto_sign_open := GetProcAddress(DLLHandle,'crypto_sign_open'); 2811 | {$IFDEF WIN32} 2812 | Assert(@crypto_sign_open <> nil); 2813 | {$ENDIF} 2814 | @crypto_sign_detached := GetProcAddress(DLLHandle,'crypto_sign_detached'); 2815 | {$IFDEF WIN32} 2816 | Assert(@crypto_sign_detached <> nil); 2817 | {$ENDIF} 2818 | @crypto_sign_verify_detached := GetProcAddress(DLLHandle,'crypto_sign_verify_detached'); 2819 | {$IFDEF WIN32} 2820 | Assert(@crypto_sign_verify_detached <> nil); 2821 | {$ENDIF} 2822 | @crypto_sign_ed25519_bytes := GetProcAddress(DLLHandle,'crypto_sign_ed25519_bytes'); 2823 | {$IFDEF WIN32} 2824 | Assert(@crypto_sign_ed25519_bytes <> nil); 2825 | {$ENDIF} 2826 | @crypto_sign_ed25519_seedbytes := GetProcAddress(DLLHandle,'crypto_sign_ed25519_seedbytes'); 2827 | {$IFDEF WIN32} 2828 | Assert(@crypto_sign_ed25519_seedbytes <> nil); 2829 | {$ENDIF} 2830 | @crypto_sign_ed25519_publickeybytes := GetProcAddress(DLLHandle,'crypto_sign_ed25519_publickeybytes'); 2831 | {$IFDEF WIN32} 2832 | Assert(@crypto_sign_ed25519_publickeybytes <> nil); 2833 | {$ENDIF} 2834 | @crypto_sign_ed25519_secretkeybytes := GetProcAddress(DLLHandle,'crypto_sign_ed25519_secretkeybytes'); 2835 | {$IFDEF WIN32} 2836 | Assert(@crypto_sign_ed25519_secretkeybytes <> nil); 2837 | {$ENDIF} 2838 | @crypto_sign_ed25519 := GetProcAddress(DLLHandle,'crypto_sign_ed25519'); 2839 | {$IFDEF WIN32} 2840 | Assert(@crypto_sign_ed25519 <> nil); 2841 | {$ENDIF} 2842 | @crypto_sign_ed25519_open := GetProcAddress(DLLHandle,'crypto_sign_ed25519_open'); 2843 | {$IFDEF WIN32} 2844 | Assert(@crypto_sign_ed25519_open <> nil); 2845 | {$ENDIF} 2846 | @crypto_sign_ed25519_detached := GetProcAddress(DLLHandle,'crypto_sign_ed25519_detached'); 2847 | {$IFDEF WIN32} 2848 | Assert(@crypto_sign_ed25519_detached <> nil); 2849 | {$ENDIF} 2850 | @crypto_sign_ed25519_verify_detached := GetProcAddress(DLLHandle,'crypto_sign_ed25519_verify_detached'); 2851 | {$IFDEF WIN32} 2852 | Assert(@crypto_sign_ed25519_verify_detached <> nil); 2853 | {$ENDIF} 2854 | @crypto_sign_ed25519_keypair := GetProcAddress(DLLHandle,'crypto_sign_ed25519_keypair'); 2855 | {$IFDEF WIN32} 2856 | Assert(@crypto_sign_ed25519_keypair <> nil); 2857 | {$ENDIF} 2858 | @crypto_sign_ed25519_seed_keypair := GetProcAddress(DLLHandle,'crypto_sign_ed25519_seed_keypair'); 2859 | {$IFDEF WIN32} 2860 | Assert(@crypto_sign_ed25519_seed_keypair <> nil); 2861 | {$ENDIF} 2862 | @crypto_sign_ed25519_pk_to_curve25519 := GetProcAddress(DLLHandle,'crypto_sign_ed25519_pk_to_curve25519'); 2863 | {$IFDEF WIN32} 2864 | Assert(@crypto_sign_ed25519_pk_to_curve25519 <> nil); 2865 | {$ENDIF} 2866 | @crypto_sign_ed25519_sk_to_curve25519 := GetProcAddress(DLLHandle,'crypto_sign_ed25519_sk_to_curve25519'); 2867 | {$IFDEF WIN32} 2868 | Assert(@crypto_sign_ed25519_sk_to_curve25519 <> nil); 2869 | {$ENDIF} 2870 | @crypto_sign_ed25519_sk_to_seed := GetProcAddress(DLLHandle,'crypto_sign_ed25519_sk_to_seed'); 2871 | {$IFDEF WIN32} 2872 | Assert(@crypto_sign_ed25519_sk_to_seed <> nil); 2873 | {$ENDIF} 2874 | @crypto_sign_ed25519_sk_to_pk := GetProcAddress(DLLHandle,'crypto_sign_ed25519_sk_to_pk'); 2875 | {$IFDEF WIN32} 2876 | Assert(@crypto_sign_ed25519_sk_to_pk <> nil); 2877 | {$ENDIF} 2878 | @crypto_sign_edwards25519sha512batch := GetProcAddress(DLLHandle,'crypto_sign_edwards25519sha512batch'); 2879 | {$IFDEF WIN32} 2880 | Assert(@crypto_sign_edwards25519sha512batch <> nil); 2881 | {$ENDIF} 2882 | @crypto_sign_edwards25519sha512batch_open := GetProcAddress(DLLHandle,'crypto_sign_edwards25519sha512batch_open'); 2883 | {$IFDEF WIN32} 2884 | Assert(@crypto_sign_edwards25519sha512batch_open <> nil); 2885 | {$ENDIF} 2886 | @crypto_sign_edwards25519sha512batch_keypair := GetProcAddress(DLLHandle,'crypto_sign_edwards25519sha512batch_keypair'); 2887 | {$IFDEF WIN32} 2888 | Assert(@crypto_sign_edwards25519sha512batch_keypair <> nil); 2889 | {$ENDIF} 2890 | @crypto_stream_keybytes := GetProcAddress(DLLHandle,'crypto_stream_keybytes'); 2891 | {$IFDEF WIN32} 2892 | Assert(@crypto_stream_keybytes <> nil); 2893 | {$ENDIF} 2894 | @crypto_stream_noncebytes := GetProcAddress(DLLHandle,'crypto_stream_noncebytes'); 2895 | {$IFDEF WIN32} 2896 | Assert(@crypto_stream_noncebytes <> nil); 2897 | {$ENDIF} 2898 | @crypto_stream_primitive := GetProcAddress(DLLHandle,'crypto_stream_primitive'); 2899 | {$IFDEF WIN32} 2900 | Assert(@crypto_stream_primitive <> nil); 2901 | {$ENDIF} 2902 | @crypto_stream := GetProcAddress(DLLHandle,'crypto_stream'); 2903 | {$IFDEF WIN32} 2904 | Assert(@crypto_stream <> nil); 2905 | {$ENDIF} 2906 | @crypto_stream_xor := GetProcAddress(DLLHandle,'crypto_stream_xor'); 2907 | {$IFDEF WIN32} 2908 | Assert(@crypto_stream_xor <> nil); 2909 | {$ENDIF} 2910 | @crypto_stream_chacha20_keybytes := GetProcAddress(DLLHandle,'crypto_stream_chacha20_keybytes'); 2911 | {$IFDEF WIN32} 2912 | Assert(@crypto_stream_chacha20_keybytes <> nil); 2913 | {$ENDIF} 2914 | @crypto_stream_chacha20_noncebytes := GetProcAddress(DLLHandle,'crypto_stream_chacha20_noncebytes'); 2915 | {$IFDEF WIN32} 2916 | Assert(@crypto_stream_chacha20_noncebytes <> nil); 2917 | {$ENDIF} 2918 | @crypto_stream_chacha20 := GetProcAddress(DLLHandle,'crypto_stream_chacha20'); 2919 | {$IFDEF WIN32} 2920 | Assert(@crypto_stream_chacha20 <> nil); 2921 | {$ENDIF} 2922 | @crypto_stream_chacha20_xor := GetProcAddress(DLLHandle,'crypto_stream_chacha20_xor'); 2923 | {$IFDEF WIN32} 2924 | Assert(@crypto_stream_chacha20_xor <> nil); 2925 | {$ENDIF} 2926 | @crypto_stream_chacha20_xor_ic := GetProcAddress(DLLHandle,'crypto_stream_chacha20_xor_ic'); 2927 | {$IFDEF WIN32} 2928 | Assert(@crypto_stream_chacha20_xor_ic <> nil); 2929 | {$ENDIF} 2930 | @crypto_stream_salsa20_keybytes := GetProcAddress(DLLHandle,'crypto_stream_salsa20_keybytes'); 2931 | {$IFDEF WIN32} 2932 | Assert(@crypto_stream_salsa20_keybytes <> nil); 2933 | {$ENDIF} 2934 | @crypto_stream_salsa20_noncebytes := GetProcAddress(DLLHandle,'crypto_stream_salsa20_noncebytes'); 2935 | {$IFDEF WIN32} 2936 | Assert(@crypto_stream_salsa20_noncebytes <> nil); 2937 | {$ENDIF} 2938 | @crypto_stream_salsa20 := GetProcAddress(DLLHandle,'crypto_stream_salsa20'); 2939 | {$IFDEF WIN32} 2940 | Assert(@crypto_stream_salsa20 <> nil); 2941 | {$ENDIF} 2942 | @crypto_stream_salsa20_xor := GetProcAddress(DLLHandle,'crypto_stream_salsa20_xor'); 2943 | {$IFDEF WIN32} 2944 | Assert(@crypto_stream_salsa20_xor <> nil); 2945 | {$ENDIF} 2946 | @crypto_stream_salsa20_xor_ic := GetProcAddress(DLLHandle,'crypto_stream_salsa20_xor_ic'); 2947 | {$IFDEF WIN32} 2948 | Assert(@crypto_stream_salsa20_xor_ic <> nil); 2949 | {$ENDIF} 2950 | @crypto_stream_salsa2012_keybytes := GetProcAddress(DLLHandle,'crypto_stream_salsa2012_keybytes'); 2951 | {$IFDEF WIN32} 2952 | Assert(@crypto_stream_salsa2012_keybytes <> nil); 2953 | {$ENDIF} 2954 | @crypto_stream_salsa2012_noncebytes := GetProcAddress(DLLHandle,'crypto_stream_salsa2012_noncebytes'); 2955 | {$IFDEF WIN32} 2956 | Assert(@crypto_stream_salsa2012_noncebytes <> nil); 2957 | {$ENDIF} 2958 | @crypto_stream_salsa2012 := GetProcAddress(DLLHandle,'crypto_stream_salsa2012'); 2959 | {$IFDEF WIN32} 2960 | Assert(@crypto_stream_salsa2012 <> nil); 2961 | {$ENDIF} 2962 | @crypto_stream_salsa2012_xor := GetProcAddress(DLLHandle,'crypto_stream_salsa2012_xor'); 2963 | {$IFDEF WIN32} 2964 | Assert(@crypto_stream_salsa2012_xor <> nil); 2965 | {$ENDIF} 2966 | @crypto_stream_xsalsa20_keybytes := GetProcAddress(DLLHandle,'crypto_stream_xsalsa20_keybytes'); 2967 | {$IFDEF WIN32} 2968 | Assert(@crypto_stream_xsalsa20_keybytes <> nil); 2969 | {$ENDIF} 2970 | @crypto_stream_xsalsa20_noncebytes := GetProcAddress(DLLHandle,'crypto_stream_xsalsa20_noncebytes'); 2971 | {$IFDEF WIN32} 2972 | Assert(@crypto_stream_xsalsa20_noncebytes <> nil); 2973 | {$ENDIF} 2974 | @crypto_stream_xsalsa20 := GetProcAddress(DLLHandle,'crypto_stream_xsalsa20'); 2975 | {$IFDEF WIN32} 2976 | Assert(@crypto_stream_xsalsa20 <> nil); 2977 | {$ENDIF} 2978 | @crypto_stream_xsalsa20_xor := GetProcAddress(DLLHandle,'crypto_stream_xsalsa20_xor'); 2979 | {$IFDEF WIN32} 2980 | Assert(@crypto_stream_xsalsa20_xor <> nil); 2981 | {$ENDIF} 2982 | @crypto_stream_xsalsa20_xor_ic := GetProcAddress(DLLHandle,'crypto_stream_xsalsa20_xor_ic'); 2983 | {$IFDEF WIN32} 2984 | Assert(@crypto_stream_xsalsa20_xor_ic <> nil); 2985 | {$ENDIF} 2986 | @crypto_verify_16_bytes := GetProcAddress(DLLHandle,'crypto_verify_16_bytes'); 2987 | {$IFDEF WIN32} 2988 | Assert(@crypto_verify_16_bytes <> nil); 2989 | {$ENDIF} 2990 | @crypto_verify_16 := GetProcAddress(DLLHandle,'crypto_verify_16'); 2991 | {$IFDEF WIN32} 2992 | Assert(@crypto_verify_16 <> nil); 2993 | {$ENDIF} 2994 | @crypto_verify_32_bytes := GetProcAddress(DLLHandle,'crypto_verify_32_bytes'); 2995 | {$IFDEF WIN32} 2996 | Assert(@crypto_verify_32_bytes <> nil); 2997 | {$ENDIF} 2998 | @crypto_verify_32 := GetProcAddress(DLLHandle,'crypto_verify_32'); 2999 | {$IFDEF WIN32} 3000 | Assert(@crypto_verify_32 <> nil); 3001 | {$ENDIF} 3002 | @crypto_verify_64_bytes := GetProcAddress(DLLHandle,'crypto_verify_64_bytes'); 3003 | {$IFDEF WIN32} 3004 | Assert(@crypto_verify_64_bytes <> nil); 3005 | {$ENDIF} 3006 | @crypto_verify_64 := GetProcAddress(DLLHandle,'crypto_verify_64'); 3007 | {$IFDEF WIN32} 3008 | Assert(@crypto_verify_64 <> nil); 3009 | {$ENDIF} 3010 | @randombytes_buf := GetProcAddress(DLLHandle,'randombytes_buf'); 3011 | {$IFDEF WIN32} 3012 | Assert(@randombytes_buf <> nil); 3013 | {$ENDIF} 3014 | @randombytes_random := GetProcAddress(DLLHandle,'randombytes_random'); 3015 | {$IFDEF WIN32} 3016 | Assert(@randombytes_random <> nil); 3017 | {$ENDIF} 3018 | @randombytes_uniform := GetProcAddress(DLLHandle,'randombytes_uniform'); 3019 | {$IFDEF WIN32} 3020 | Assert(@randombytes_uniform <> nil); 3021 | {$ENDIF} 3022 | @randombytes_stir := GetProcAddress(DLLHandle,'randombytes_stir'); 3023 | {$IFDEF WIN32} 3024 | Assert(@randombytes_stir <> nil); 3025 | {$ENDIF} 3026 | @randombytes_close := GetProcAddress(DLLHandle,'randombytes_close'); 3027 | {$IFDEF WIN32} 3028 | Assert(@randombytes_close <> nil); 3029 | {$ENDIF} 3030 | @randombytes_set_implementation := GetProcAddress(DLLHandle,'randombytes_set_implementation'); 3031 | {$IFDEF WIN32} 3032 | Assert(@randombytes_set_implementation <> nil); 3033 | {$ENDIF} 3034 | @randombytes_implementation_name := GetProcAddress(DLLHandle,'randombytes_implementation_name'); 3035 | {$IFDEF WIN32} 3036 | Assert(@randombytes_implementation_name <> nil); 3037 | {$ENDIF} 3038 | @randombytes := GetProcAddress(DLLHandle,'randombytes'); 3039 | {$IFDEF WIN32} 3040 | Assert(@randombytes <> nil); 3041 | {$ENDIF} 3042 | @sodium_runtime_has_neon := GetProcAddress(DLLHandle,'sodium_runtime_has_neon'); 3043 | {$IFDEF WIN32} 3044 | Assert(@sodium_runtime_has_neon <> nil); 3045 | {$ENDIF} 3046 | @sodium_runtime_has_sse2 := GetProcAddress(DLLHandle,'sodium_runtime_has_sse2'); 3047 | {$IFDEF WIN32} 3048 | Assert(@sodium_runtime_has_sse2 <> nil); 3049 | {$ENDIF} 3050 | @sodium_runtime_has_sse3 := GetProcAddress(DLLHandle,'sodium_runtime_has_sse3'); 3051 | {$IFDEF WIN32} 3052 | Assert(@sodium_runtime_has_sse3 <> nil); 3053 | {$ENDIF} 3054 | @sodium_memzero := GetProcAddress(DLLHandle,'sodium_memzero'); 3055 | {$IFDEF WIN32} 3056 | Assert(@sodium_memzero <> nil); 3057 | {$ENDIF} 3058 | @sodium_memcmp := GetProcAddress(DLLHandle,'sodium_memcmp'); 3059 | {$IFDEF WIN32} 3060 | Assert(@sodium_memcmp <> nil); 3061 | {$ENDIF} 3062 | @sodium_bin2hex := GetProcAddress(DLLHandle,'sodium_bin2hex'); 3063 | {$IFDEF WIN32} 3064 | Assert(@sodium_bin2hex <> nil); 3065 | {$ENDIF} 3066 | @sodium_hex2bin := GetProcAddress(DLLHandle,'sodium_hex2bin'); 3067 | {$IFDEF WIN32} 3068 | Assert(@sodium_hex2bin <> nil); 3069 | {$ENDIF} 3070 | @sodium_mlock := GetProcAddress(DLLHandle,'sodium_mlock'); 3071 | {$IFDEF WIN32} 3072 | Assert(@sodium_mlock <> nil); 3073 | {$ENDIF} 3074 | @sodium_munlock := GetProcAddress(DLLHandle,'sodium_munlock'); 3075 | {$IFDEF WIN32} 3076 | Assert(@sodium_munlock <> nil); 3077 | {$ENDIF} 3078 | @sodium_malloc := GetProcAddress(DLLHandle,'sodium_malloc'); 3079 | {$IFDEF WIN32} 3080 | Assert(@sodium_malloc <> nil); 3081 | {$ENDIF} 3082 | @sodium_allocarray := GetProcAddress(DLLHandle,'sodium_allocarray'); 3083 | {$IFDEF WIN32} 3084 | Assert(@sodium_allocarray <> nil); 3085 | {$ENDIF} 3086 | @sodium_free := GetProcAddress(DLLHandle,'sodium_free'); 3087 | {$IFDEF WIN32} 3088 | Assert(@sodium_free <> nil); 3089 | {$ENDIF} 3090 | @sodium_mprotect_noaccess := GetProcAddress(DLLHandle,'sodium_mprotect_noaccess'); 3091 | {$IFDEF WIN32} 3092 | Assert(@sodium_mprotect_noaccess <> nil); 3093 | {$ENDIF} 3094 | @sodium_mprotect_readonly := GetProcAddress(DLLHandle,'sodium_mprotect_readonly'); 3095 | {$IFDEF WIN32} 3096 | Assert(@sodium_mprotect_readonly <> nil); 3097 | {$ENDIF} 3098 | @sodium_mprotect_readwrite := GetProcAddress(DLLHandle,'sodium_mprotect_readwrite'); 3099 | {$IFDEF WIN32} 3100 | Assert(@sodium_mprotect_readwrite <> nil); 3101 | {$ENDIF} 3102 | // @_sodium_alloc_init := GetProcAddress(DLLHandle,'_sodium_alloc_init'); 3103 | //{$IFDEF WIN32} 3104 | // Assert(@_sodium_alloc_init <> nil); 3105 | //{$ENDIF} 3106 | @sodium_version_string := GetProcAddress(DLLHandle,'sodium_version_string'); 3107 | {$IFDEF WIN32} 3108 | Assert(@sodium_version_string <> nil); 3109 | {$ENDIF} 3110 | @sodium_library_version_major := GetProcAddress(DLLHandle,'sodium_library_version_major'); 3111 | {$IFDEF WIN32} 3112 | Assert(@sodium_library_version_major <> nil); 3113 | {$ENDIF} 3114 | @sodium_library_version_minor := GetProcAddress(DLLHandle,'sodium_library_version_minor'); 3115 | {$IFDEF WIN32} 3116 | Assert(@sodium_library_version_minor <> nil); 3117 | {$ENDIF} 3118 | // libsodium 1.0.4 3119 | @sodium_compare := GetProcAddress(DLLHandle,'sodium_compare'); 3120 | @sodium_increment := GetProcAddress(DLLHandle,'sodium_increment'); 3121 | 3122 | @crypto_stream_chacha20_ietf_noncebytes := GetProcAddress(DLLHandle,'crypto_stream_chacha20_ietf_noncebytes'); 3123 | @crypto_stream_chacha20_ietf := GetProcAddress(DLLHandle,'crypto_stream_chacha20_ietf'); 3124 | @crypto_stream_chacha20_ietf_xor := GetProcAddress(DLLHandle,'crypto_stream_chacha20_ietf_xor'); 3125 | @crypto_stream_chacha20_ietf_xor_ic := GetProcAddress(DLLHandle,'crypto_stream_chacha20_ietf_xor_ic'); 3126 | 3127 | @crypto_aead_chacha20poly1305_ietf_npubbytes := GetProcAddress(DLLHandle,'crypto_aead_chacha20poly1305_ietf_npubbytes'); 3128 | @crypto_aead_chacha20poly1305_ietf_encrypt := GetProcAddress(DLLHandle,'crypto_aead_chacha20poly1305_ietf_encrypt'); 3129 | @crypto_aead_chacha20poly1305_ietf_decrypt := GetProcAddress(DLLHandle,'crypto_aead_chacha20poly1305_ietf_decrypt'); 3130 | 3131 | // libsodium 1.0.6 3132 | @sodium_runtime_has_ssse3 := GetProcAddress(DLLHandle,'sodium_runtime_has_ssse3'); 3133 | @sodium_runtime_has_sse41 := GetProcAddress(DLLHandle,'sodium_runtime_has_sse41'); 3134 | 3135 | // libsodium 1.0.12 3136 | @randombytes_buf_deterministic := GetProcAddress(DLLHandle,'randombytes_buf_deterministic'); 3137 | 3138 | // libsodium 1.0.14 3139 | @sodium_runtime_has_avx := GetProcAddress(DLLHandle,'sodium_runtime_has_avx'); 3140 | @sodium_runtime_has_avx2 := GetProcAddress(DLLHandle,'sodium_runtime_has_avx2'); 3141 | @sodium_runtime_has_avx512 := GetProcAddress(DLLHandle,'sodium_runtime_has_avx512'); 3142 | @sodium_runtime_has_pclmul := GetProcAddress(DLLHandle,'sodium_runtime_has_pclmul'); 3143 | @sodium_runtime_has_aesni := GetProcAddress(DLLHandle,'sodium_runtime_has_aesni'); 3144 | @sodium_bin2base64 := GetProcAddress(DLLHandle,'sodium_bin2base64'); 3145 | @sodium_base642bin := GetProcAddress(DLLHandle,'sodium_base642bin'); 3146 | @sodium_pad := GetProcAddress(DLLHandle,'sodium_pad'); 3147 | @sodium_unpad := GetProcAddress(DLLHandle,'sodium_unpad'); 3148 | 3149 | @crypto_secretstream_xchacha20poly1305_abytes := GetProcAddress(DLLHandle,'crypto_secretstream_xchacha20poly1305_abytes'); 3150 | @crypto_secretstream_xchacha20poly1305_headerbytes := GetProcAddress(DLLHandle,'crypto_secretstream_xchacha20poly1305_headerbytes'); 3151 | @crypto_secretstream_xchacha20poly1305_keybytes := GetProcAddress(DLLHandle,'crypto_secretstream_xchacha20poly1305_keybytes'); 3152 | @crypto_secretstream_xchacha20poly1305_messagebytes_max := GetProcAddress(DLLHandle,'crypto_secretstream_xchacha20poly1305_messagebytes_max'); 3153 | @crypto_secretstream_xchacha20poly1305_tag_message := GetProcAddress(DLLHandle,'crypto_secretstream_xchacha20poly1305_tag_message'); 3154 | @crypto_secretstream_xchacha20poly1305_tag_push := GetProcAddress(DLLHandle,'crypto_secretstream_xchacha20poly1305_tag_push'); 3155 | @crypto_secretstream_xchacha20poly1305_tag_rekey := GetProcAddress(DLLHandle,'crypto_secretstream_xchacha20poly1305_tag_rekey'); 3156 | @crypto_secretstream_xchacha20poly1305_tag_final := GetProcAddress(DLLHandle,'crypto_secretstream_xchacha20poly1305_tag_final'); 3157 | @crypto_secretstream_xchacha20poly1305_statebytes := GetProcAddress(DLLHandle,'crypto_secretstream_xchacha20poly1305_statebytes'); 3158 | @crypto_secretstream_xchacha20poly1305_keygen := GetProcAddress(DLLHandle,'crypto_secretstream_xchacha20poly1305_keygen'); 3159 | @crypto_secretstream_xchacha20poly1305_init_push := GetProcAddress(DLLHandle,'crypto_secretstream_xchacha20poly1305_init_push'); 3160 | @crypto_secretstream_xchacha20poly1305_push := GetProcAddress(DLLHandle,'crypto_secretstream_xchacha20poly1305_push'); 3161 | @crypto_secretstream_xchacha20poly1305_init_pull := GetProcAddress(DLLHandle,'crypto_secretstream_xchacha20poly1305_init_pull'); 3162 | @crypto_secretstream_xchacha20poly1305_pull := GetProcAddress(DLLHandle,'crypto_secretstream_xchacha20poly1305_pull'); 3163 | @crypto_secretstream_xchacha20poly1305_rekey := GetProcAddress(DLLHandle,'crypto_secretstream_xchacha20poly1305_rekey'); 3164 | 3165 | end 3166 | else 3167 | begin 3168 | sodium_dllLoaded := False; 3169 | // Error: LIBSODIUM.DLL could not be loaded! 3170 | // make sure appropriate runtime libraries are available! 3171 | // ie. MSVC v100 libsodium.dll requires mfc100.dll, msvcp100.dll, and msvcr100.dll 3172 | end; 3173 | {$IFNDEF MSDOS} 3174 | SetErrorMode(ErrorMode) 3175 | {$ENDIF} 3176 | end {LoadDLL}; 3177 | 3178 | begin 3179 | LoadDLL; 3180 | end. 3181 | 3182 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # libsodium-delphi [![License](http://img.shields.io/badge/license-MIT-green.svg)](https://github.com/alexpmorris/libsodium-delphi/blob/master/license) 2 | 3 | libsodium-delphi, or [libsodium](https://github.com/jedisct1/libsodium) for Delphi, is a Delphi/FreePascal wrapper around libsodium. libsodium is a portable and relatively easy to use implementation of [Daniel Bernstein's](http://cr.yp.to/djb.html) fantastic [NaCl](http://nacl.cr.yp.to/) library. 4 | 5 | ## Why 6 | 7 | NaCl is a great encryption, hashing, and authentication library that is designed to make proper implementation easy and straight-forward. By using it (or a wrapper), many of the finer details (including speed-optimization) are abstracted away so the programmer doesn't need to worry about them. NaCl itself is less than portable C, only targeted for *nix systems. libsodium makes the library portable, and adds additional conveniences to make the library easily standardized across multiple platforms, operating systems, and languages. 8 | 9 | Crypto is very tricky to implement correctly. With this library, you are much more likely to get it correct out of the box, by implementing solid encryption standards and practices without materially effecting performance. 10 | 11 | ## Installation 12 | 13 | **Windows**: For Windows, the `libsodium` library is included in the [release](https://github.com/alexpmorris/libsodium-delphi/releases) packages, along with an executable demo. 14 | 15 | ## Documentation 16 | 17 | Between the Delphi demo application, and the [original libsodium documentation library](http://doc.libsodium.org/) written by Frank Denis ([@jedisct1](https://github.com/jedisct1)), you should have all you need to get going. 18 | 19 | ## Requirements & Versions 20 | 21 | libsodium-delphi works with either the 32-bit or 64-bit libsodium.dll library version 1.0.14 (recent previous releases should work as well). [Click here for precompiled libsodium DLLs.](https://download.libsodium.org/libsodium/releases/) 22 | 23 | ## License 24 | 25 | NaCl has been released to the public domain to avoid copyright issues. libsodium is subject to the [ISC license](https://en.wikipedia.org/wiki/ISC_license), and this software is subject to the MIT license (see [license](https://github.com/alexpmorris/libsodium-delphi/blob/master/license)). 26 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 @alexpmorris and contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /lsDemo.cfg: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J+ 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W+ 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 29 | -H- 30 | -W- 31 | -M 32 | -$M16384,1048576 33 | -K$00400000 34 | -LE"c:\delphi7\Projects\Bpl" 35 | -LN"c:\delphi7\Projects\Bpl" 36 | -U"c:\delphi7\ics\delphi\vc32;c:\delphi7\emagic\unit\d5\gui;c:\delphi7\emagic\source\package;c:\delphi7\iabsocket\API_all_env;c:\delphi7\fastcode" 37 | -O"c:\delphi7\ics\delphi\vc32;c:\delphi7\emagic\unit\d5\gui;c:\delphi7\emagic\source\package;c:\delphi7\iabsocket\API_all_env;c:\delphi7\fastcode" 38 | -I"c:\delphi7\ics\delphi\vc32;c:\delphi7\emagic\unit\d5\gui;c:\delphi7\emagic\source\package;c:\delphi7\iabsocket\API_all_env;c:\delphi7\fastcode" 39 | -R"c:\delphi7\ics\delphi\vc32;c:\delphi7\emagic\unit\d5\gui;c:\delphi7\emagic\source\package;c:\delphi7\iabsocket\API_all_env;c:\delphi7\fastcode" 40 | -------------------------------------------------------------------------------- /lsDemo.dof: -------------------------------------------------------------------------------- 1 | [FileVersion] 2 | Version=7.0 3 | [Compiler] 4 | A=8 5 | B=0 6 | C=1 7 | D=1 8 | E=0 9 | F=0 10 | G=1 11 | H=1 12 | I=1 13 | J=1 14 | K=0 15 | L=1 16 | M=0 17 | N=1 18 | O=1 19 | P=1 20 | Q=0 21 | R=0 22 | S=0 23 | T=0 24 | U=0 25 | V=1 26 | W=1 27 | X=1 28 | Y=1 29 | Z=1 30 | ShowHints=0 31 | ShowWarnings=0 32 | UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 33 | NamespacePrefix= 34 | SymbolDeprecated=1 35 | SymbolLibrary=1 36 | SymbolPlatform=1 37 | UnitLibrary=1 38 | UnitPlatform=1 39 | UnitDeprecated=1 40 | HResultCompat=1 41 | HidingMember=1 42 | HiddenVirtual=1 43 | Garbage=1 44 | BoundsError=1 45 | ZeroNilCompat=1 46 | StringConstTruncated=1 47 | ForLoopVarVarPar=1 48 | TypedConstVarPar=1 49 | AsgToTypedConst=1 50 | CaseLabelRange=1 51 | ForVariable=1 52 | ConstructingAbstract=1 53 | ComparisonFalse=1 54 | ComparisonTrue=1 55 | ComparingSignedUnsigned=1 56 | CombiningSignedUnsigned=1 57 | UnsupportedConstruct=1 58 | FileOpen=1 59 | FileOpenUnitSrc=1 60 | BadGlobalSymbol=1 61 | DuplicateConstructorDestructor=1 62 | InvalidDirective=1 63 | PackageNoLink=1 64 | PackageThreadVar=1 65 | ImplicitImport=1 66 | HPPEMITIgnored=1 67 | NoRetVal=1 68 | UseBeforeDef=1 69 | ForLoopVarUndef=1 70 | UnitNameMismatch=1 71 | NoCFGFileFound=1 72 | MessageDirective=1 73 | ImplicitVariants=1 74 | UnicodeToLocale=1 75 | LocaleToUnicode=1 76 | ImagebaseMultiple=1 77 | SuspiciousTypecast=1 78 | PrivatePropAccessor=1 79 | UnsafeType=1 80 | UnsafeCode=1 81 | UnsafeCast=1 82 | [Linker] 83 | MapFile=0 84 | OutputObjs=0 85 | ConsoleApp=1 86 | DebugInfo=0 87 | RemoteSymbols=0 88 | MinStackSize=16384 89 | MaxStackSize=1048576 90 | ImageBase=4194304 91 | ExeDescription= 92 | [Directories] 93 | OutputDir= 94 | UnitOutputDir= 95 | PackageDLLOutputDir= 96 | PackageDCPOutputDir= 97 | SearchPath=$(DELPHI)\ics\delphi\vc32;$(DELPHI)\emagic\unit\d5\gui;$(DELPHI)\emagic\source\package;c:\delphi7\iabsocket\API_all_env;c:\delphi7\fastcode 98 | Packages=Vcl40;Vclx40;Vcldb40;vcldbx40;ibevnt40;NMFast40;Vclmid40;Inet40;Inetdb40;WinshoesPkgD4;VclSmp40;Qrpt40;TeeUI40;teedb40;tee40;Dss40;Icsdel40 99 | Conditionals= 100 | DebugSourceDirs= 101 | UsePackages=0 102 | [Parameters] 103 | RunParams=7100 104 | HostApplication= 105 | Launcher= 106 | UseLauncher=0 107 | DebugCWD= 108 | [Language] 109 | ActiveLang= 110 | ProjectLang= 111 | RootDir=C:\Delphi7\Bin\ 112 | [Version Info] 113 | IncludeVerInfo=0 114 | AutoIncBuild=0 115 | MajorVer=1 116 | MinorVer=0 117 | Release=0 118 | Build=0 119 | Debug=0 120 | PreRelease=0 121 | Special=0 122 | Private=0 123 | DLL=0 124 | Locale=1033 125 | CodePage=1252 126 | [Version Info Keys] 127 | CompanyName= 128 | FileDescription= 129 | FileVersion=1.0.0.0 130 | InternalName= 131 | LegalCopyright= 132 | LegalTrademarks= 133 | OriginalFilename= 134 | ProductName= 135 | ProductVersion=1.0.0.0 136 | Comments= 137 | [Excluded Packages] 138 | c:\delphi7\Projects\Bpl\DCPdelphi6.bpl=DCPcrypt cryptographic component library v2 BETA 3 139 | c:\delphi7\Projects\Bpl\curlpkg.bpl=(untitled) 140 | -------------------------------------------------------------------------------- /lsDemo.dpr: -------------------------------------------------------------------------------- 1 | program lsDemo; 2 | {$apptype console} 3 | 4 | // 5 | // by Alexander Paul Morris, 2015-08-08 6 | // 7 | // demos for Delphi wrapper to 32-bit and 64-bit libsodium.dll crypto library 8 | // 9 | // 10 | 11 | uses SysUtils, Classes, WinTypes, LibSodium; 12 | 13 | 14 | //http://doc.libsodium.org/advanced/sha-2_hash_function.html 15 | //http://doc.libsodium.org/advanced/hmac-sha2.html 16 | procedure LibSodiumHmacSha2AuthDemo; 17 | var testMessage,hexHash: AnsiString; 18 | sha2Hash: array [0..ls_crypto_hash_sha256_BYTES-1] of byte; 19 | hmacHash: array [0..ls_crypto_auth_hmacsha256_BYTES-1] of byte; 20 | key: array [0..ls_crypto_auth_hmacsha256_KEYBYTES-1] of byte; 21 | begin 22 | testMessage := 'my test message'; 23 | 24 | crypto_hash_sha256(@sha2Hash, @testMessage[1], length(testMessage)); 25 | SetLength(hexHash,ls_crypto_hash_sha256_BYTES*2+1); 26 | sodium_bin2hex(@hexHash[1],length(hexHash),@sha2Hash,ls_crypto_hash_sha256_BYTES); 27 | writeln('Sha2 Hash = ',hexHash); 28 | 29 | randombytes_buf(@key, sizeof(key)); 30 | crypto_auth_hmacsha256(@hmacHash, @testMessage[1], length(testMessage), @key); 31 | SetLength(hexHash,ls_crypto_auth_hmacsha256_BYTES*2+1); 32 | sodium_bin2hex(@hexHash[1],length(hexHash),@hmacHash,ls_crypto_auth_hmacsha256_BYTES); 33 | writeln('HmacSha256 Hash = ',hexHash); 34 | 35 | end; 36 | 37 | 38 | //http://doc.libsodium.org/password_hashing/index.html 39 | procedure LibSodiumSalsa208sha256PasswordHashingDemo; 40 | var password,hexHash: AnsiString; 41 | key: array [0..ls_crypto_box_SEEDBYTES-1] of byte; 42 | salt: array [0..ls_crypto_pwhash_scryptsalsa208sha256_SALTBYTES-1] of byte; 43 | hashed_password: array [0..ls_crypto_pwhash_scryptsalsa208sha256_STRBYTES-1] of byte; 44 | begin 45 | // key derivation 46 | randombytes_buf(@salt, sizeof(salt)); 47 | password := 'myPassword'; 48 | if (crypto_pwhash_scryptsalsa208sha256(@key, sizeof(key), @password[1], length(password), @salt, 49 | ls_crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE, 50 | ls_crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE) <> 0) then begin 51 | Writeln('Salsa208sha256: Something went wrong... [Out of Memory?]'); 52 | end else begin 53 | SetLength(hexHash,ls_crypto_box_SEEDBYTES*2+1); 54 | sodium_bin2hex(@hexHash[1],length(hexHash),@key,ls_crypto_box_SEEDBYTES); 55 | Writeln('Salsa208sha256 Password Key = ',hexHash); 56 | end; 57 | 58 | // password storage - for very sensitive passwords, you can use _SENSITIVE instead of _INTERACTIVE, 59 | // but be warned, deriving a key will take about 2 seconds on a 2.8 Ghz Core i7 CPU and requires 60 | // up to 1 gigabyte of dedicated RAM. 61 | password := 'myPassword'; 62 | if (crypto_pwhash_scryptsalsa208sha256_str(@hashed_password, @password[1], length(password), 63 | crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE, 64 | crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE) <> 0) then begin 65 | Writeln('Salsa208sha256: Something went wrong... [Out of Memory?]'); 66 | end; 67 | if (crypto_pwhash_scryptsalsa208sha256_str_verify(@hashed_password, @password[1], length(password)) <> 0) then 68 | Writeln('Salsa208sha256: Password and Hash MISMATCH! ['+password+']') else 69 | Writeln('Salsa208sha256: Password and Hash Match! ['+password+']'); 70 | password := 'MyPassword'; 71 | if (crypto_pwhash_scryptsalsa208sha256_str_verify(@hashed_password, @password[1], length(password)) <> 0) then 72 | Writeln('Salsa208sha256: Password and Hash MISMATCH! ['+password+']') else 73 | Writeln('Salsa208sha256: Password and Hash Match! ['+password+']'); 74 | 75 | end; 76 | 77 | 78 | //https://blake2.net/ - BLAKE2 — fast secure hashing 79 | // improved version of the SHA-3 finalist BLAKE. Like SHA-3, BLAKE2 offers the highest security, 80 | // yet is fast as MD5 on 64-bit platforms and requires at least 33% less RAM than SHA-2 or SHA-3 81 | // on low-end systems. The core algorithm of BLAKE2 is derived from ChaCha, a stream cipher designed 82 | // by Daniel J. Bernstein that has been proposed as a standard cipher for TLS. 83 | //http://doc.libsodium.org/hashing/generic_hashing.html 84 | procedure LibSodiumBlake2HashDemo; 85 | var testMessage,hexHash: AnsiString; 86 | hash: array [0..ls_crypto_generichash_BYTES-1] of byte; 87 | key: array [0..ls_crypto_generichash_KEYBYTES-1] of byte; 88 | state: crypto_generichash_state; 89 | begin 90 | randombytes_buf(@key,ls_crypto_aead_chacha20poly1305_KEYBYTES); 91 | testMessage := 'my very important message'; 92 | crypto_generichash(@hash, sizeof(hash), @testMessage[1], Length(testMessage), @key, length(key)); 93 | 94 | SetLength(hexHash,ls_crypto_generichash_BYTES*2+1); 95 | sodium_bin2hex(@hexHash[1],length(hexHash),@hash,ls_crypto_generichash_BYTES); 96 | writeln('Blake2 Hash = ',hexHash); 97 | 98 | crypto_generichash_init(state, @key, sizeof(key), sizeof(hash)); 99 | testMessage := 'my very '; 100 | crypto_generichash_update(state, @testMessage[1], Length(testMessage)); 101 | testMessage := 'important message'; 102 | crypto_generichash_update(state, @testMessage[1], Length(testMessage)); 103 | crypto_generichash_final(state, @hash, sizeof(hash)); 104 | 105 | SetLength(hexHash,ls_crypto_generichash_BYTES*2+1); 106 | sodium_bin2hex(@hexHash[1],length(hexHash),@hash,ls_crypto_generichash_BYTES); 107 | writeln('Multi-part Blake2 Hash = ',hexHash); 108 | 109 | end; 110 | 111 | 112 | //NOTE: cryptBuf and testMessage can overlap, making in-place encryption possible (no need for 2 buffers). 113 | // However do not forget that ls_crypto_aead_chacha20poly1305_ABYTES extra bytes are required 114 | // to prepend the tag. 115 | //http://doc.libsodium.org/secret-key_cryptography/aead.html 116 | procedure LibSodiumAeadChacha20poly1305Demo; 117 | var testMessage,cryptBuf,additionalData: AnsiString; 118 | nonce: array [0..ls_crypto_aead_chacha20poly1305_NPUBBYTES-1] of byte; 119 | key: array [0..ls_crypto_aead_chacha20poly1305_KEYBYTES-1] of byte; 120 | cryptLen,decryptLen: UINT64; 121 | begin 122 | randombytes_buf(@nonce,ls_crypto_aead_chacha20poly1305_NPUBBYTES); 123 | randombytes_buf(@key,ls_crypto_aead_chacha20poly1305_KEYBYTES); 124 | testMessage := 'my secret message'; 125 | additionalData := 'lsAead'; 126 | 127 | SetLength(cryptBuf,length(testMessage)+ls_crypto_aead_chacha20poly1305_ABYTES); 128 | 129 | crypto_aead_chacha20poly1305_encrypt(@cryptBuf[1], cryptLen, @testMessage[1], length(testMessage), 130 | @additionalData, length(additionalData), nil, @nonce, @key); 131 | 132 | FillChar(testMessage[1],length(testMessage),0); 133 | SetLength(testMessage,cryptLen-ls_crypto_aead_chacha20poly1305_ABYTES); 134 | 135 | //missing additionalData 136 | if (crypto_aead_chacha20poly1305_decrypt(@testMessage[1], decryptLen, nil, @cryptBuf[1], length(cryptBuf), 137 | nil, 0, @nonce, @key) = 0) then begin 138 | writeln('chacha20poly1305 decrypted message = "',testMessage,'"'); 139 | end else writeln('chacha20poly1305 decryption/authentication failed! [correct: missing additionalData]'); 140 | 141 | if (crypto_aead_chacha20poly1305_decrypt(@testMessage[1], decryptLen, nil, @cryptBuf[1], length(cryptBuf), 142 | @additionalData, length(additionalData), @nonce, @key) = 0) then begin 143 | writeln('chacha20poly1305 decrypted message = "',testMessage,'"'); 144 | end else writeln('chacha20poly1305 decryption/authentication failed!'); 145 | 146 | end; 147 | 148 | 149 | //NOTE: cryptBuf and testMessage can overlap, making in-place encryption possible (no need for 2 buffers). 150 | // However do not forget that ls_crypto_secretbox_MACBYTES extra bytes are required 151 | // to prepend the tag. 152 | //http://doc.libsodium.org/secret-key_cryptography/authenticated_encryption.html 153 | procedure LibSodiumCryptoSecretBoxDemo; 154 | var testMessage,cryptBuf: AnsiString; 155 | nonce: array [0..ls_crypto_secretbox_NONCEBYTES-1] of byte; 156 | key: array [0..ls_crypto_secretbox_KEYBYTES-1] of byte; 157 | cryptLen: UINT64; 158 | intNonce: UINT64 absolute nonce; //nonce is 8 bytes, so can be directly mapped to a UINT64 159 | begin 160 | randombytes_buf(@nonce,ls_crypto_secretbox_NONCEBYTES); 161 | randombytes_buf(@key,ls_crypto_secretbox_KEYBYTES); 162 | testMessage := 'my secret message'; 163 | 164 | cryptLen := length(testMessage)+ls_crypto_secretbox_MACBYTES; 165 | SetLength(cryptBuf,cryptLen); 166 | 167 | crypto_secretbox_easy(@cryptBuf[1], @testMessage[1], length(testMessage), @nonce, @key); 168 | 169 | FillChar(testMessage[1],length(testMessage),0); 170 | SetLength(testMessage,cryptLen-ls_crypto_secretbox_MACBYTES); 171 | 172 | intNonce := intNonce + 1; 173 | 174 | if (crypto_secretbox_open_easy(@testMessage[1], @cryptBuf[1], length(cryptBuf), @nonce, @key) = 0) then begin 175 | writeln('secretbox decrypted message = "',testMessage,'"'); 176 | end else writeln('secretbox decryption/authentication failed! [correct: wrong nonce]'); 177 | 178 | intNonce := intNonce - 1; 179 | 180 | if (crypto_secretbox_open_easy(@testMessage[1], @cryptBuf[1], length(cryptBuf), @nonce, @key) = 0) then begin 181 | writeln('secretbox decrypted message = "',testMessage,'"'); 182 | end else writeln('secretbox decryption/authentication failed!'); 183 | 184 | end; 185 | 186 | 187 | //http://doc.libsodium.org/secret-key_cryptography/secret-key_authentication.html 188 | procedure LibSodiumCryptoAuthDemo; 189 | var testMessage,cryptBuf,hexMac: AnsiString; 190 | mac: array [0..ls_crypto_auth_BYTES-1] of byte; 191 | key: array [0..ls_crypto_auth_KEYBYTES-1] of byte; 192 | binLen: DWORD{dwSIZE_T}; 193 | begin 194 | randombytes_buf(@mac,ls_crypto_auth_BYTES); 195 | randombytes_buf(@key,ls_crypto_auth_KEYBYTES); 196 | testMessage := 'my authenticated message'; 197 | 198 | crypto_auth(@mac, @testMessage[1], length(testMessage), @key); 199 | 200 | //http://doc.libsodium.org/helpers/index.html 201 | SetLength(hexMac,ls_crypto_auth_BYTES*2+1); 202 | sodium_bin2hex(@hexMac[1],length(hexMac),@mac,ls_crypto_auth_BYTES); 203 | 204 | writeln('auth macHex = ',hexMac); 205 | 206 | FillChar(mac,sizeof(mac),0); 207 | sodium_hex2bin(@mac,ls_crypto_auth_BYTES,@hexMac[1],length(hexMac),nil,binLen,nil); 208 | 209 | if (crypto_auth_verify(@mac, @testMessage[1], length(testMessage), @key) = 0) then begin 210 | writeln('auth authenticated message = "',testMessage,'"'); 211 | end else writeln('auth authentication failed!'); 212 | 213 | end; 214 | 215 | 216 | //http://doc.libsodium.org/advanced/scalar_multiplication.html 217 | //Curve25519, a state-of-the-art Diffie-Hellman function suitable for a wide variety of applications 218 | procedure LibSodiumCryptoDHCurve25519Demo; 219 | var client_publickey,server_publickey: array [0..ls_crypto_box_PUBLICKEYBYTES-1] of byte; 220 | client_secretkey,server_secretkey: array [0..ls_crypto_box_SECRETKEYBYTES-1] of byte; 221 | scalarmult_q_by_client,scalarmult_q_by_server: array [0..ls_crypto_scalarmult_BYTES-1] of byte; 222 | sharedkey_by_client,sharedkey_by_server: array [0..ls_crypto_generichash_BYTES-1] of byte; 223 | h: crypto_generichash_state; 224 | hexBuf: AnsiString; 225 | begin 226 | // Create client's secret and public keys 227 | randombytes(@client_secretkey, sizeof(client_secretkey)); 228 | crypto_scalarmult_base(@client_publickey, @client_secretkey); 229 | 230 | // Create server's secret and public keys 231 | randombytes(@server_secretkey, sizeof(server_secretkey)); 232 | crypto_scalarmult_base(@server_publickey, @server_secretkey); 233 | 234 | SetLength(hexBuf,ls_crypto_box_PUBLICKEYBYTES*2+1); 235 | sodium_bin2hex(@hexBuf[1],length(hexBuf),@server_publickey,ls_crypto_box_PUBLICKEYBYTES); 236 | writeln('Curve25519: server_publickey = ',hexBuf); 237 | 238 | sodium_bin2hex(@hexBuf[1],length(hexBuf),@client_publickey,ls_crypto_box_PUBLICKEYBYTES); 239 | writeln('Curve25519: client_publickey = ',hexBuf); 240 | 241 | // The client derives a shared key from its secret key and the server's public key 242 | // shared key = h(q || client_publickey || server_publickey) 243 | crypto_scalarmult(@scalarmult_q_by_client, @client_secretkey, @server_publickey); 244 | crypto_generichash_init(h, nil, 0, ls_crypto_generichash_BYTES); 245 | crypto_generichash_update(h, @scalarmult_q_by_client, sizeof(scalarmult_q_by_client)); 246 | crypto_generichash_update(h, @client_publickey, sizeof(client_publickey)); 247 | crypto_generichash_update(h, @server_publickey, sizeof(server_publickey)); 248 | crypto_generichash_final(h, @sharedkey_by_client, sizeof(sharedkey_by_client)); 249 | 250 | // The server derives a shared key from its secret key and the client's public key 251 | // shared key = h(q || client_publickey || server_publickey) 252 | crypto_scalarmult(@scalarmult_q_by_server, @server_secretkey, @client_publickey); 253 | crypto_generichash_init(h, nil, 0, ls_crypto_generichash_BYTES); 254 | crypto_generichash_update(h, @scalarmult_q_by_server, sizeof(scalarmult_q_by_server)); 255 | crypto_generichash_update(h, @client_publickey, sizeof(client_publickey)); 256 | crypto_generichash_update(h, @server_publickey, sizeof(server_publickey)); 257 | crypto_generichash_final(h, @sharedkey_by_server, sizeof(sharedkey_by_server)); 258 | 259 | // sharedkey_by_client and sharedkey_by_server are identical 260 | 261 | if (sodium_memcmp(@sharedkey_by_client,@sharedkey_by_server,ls_crypto_generichash_BYTES) = 0) then begin 262 | SetLength(hexBuf,ls_crypto_generichash_BYTES*2+1); 263 | sodium_bin2hex(@hexBuf[1],length(hexBuf),@sharedkey_by_client,ls_crypto_box_PUBLICKEYBYTES); 264 | writeln('Curve25519: SUCCESS :: sharedPrivateKey = ',hexBuf); 265 | end else writeln('Curve25519: FAILED :: Shared Key Mismatch'); 266 | 267 | end; 268 | 269 | 270 | procedure LibSodiumRandomDemo; 271 | var buf: array[0..7] of byte; 272 | i: integer; 273 | begin 274 | 275 | write('randombytes_buf(8) = '); 276 | randombytes_buf(@buf,8); 277 | for i:= 0 to 7 do write(buf[i],' '); writeln; 278 | 279 | write('randombytes_buf(8) = '); 280 | randombytes_buf(@buf,8); 281 | for i:= 0 to 7 do write(buf[i],' '); writeln; 282 | 283 | writeln('randombytes_uniform(0..1000) = ',randombytes_uniform(1000)); 284 | writeln('randombytes_uniform(0..1000000) = ',randombytes_uniform(1000000)); 285 | writeln('randombytes_uniform(0..1000000000) = ',randombytes_uniform(1000000000)); 286 | end; 287 | 288 | 289 | procedure TestLibSodium; 290 | var rb: randombytes_implementation; 291 | buf: array[0..7] of byte; 292 | i: integer; 293 | begin 294 | if (not sodium_dllLoaded) then begin 295 | writeln('Fatal Error: could not load "'+sodium_dllFileName+'"! Missing a Dependency?'); 296 | writeln('ie. MSVC v100 runtime requires mfc100.dll, msvcp100.dll, and msvcr100.dll'); 297 | halt; 298 | end; 299 | 300 | sodium_init; 301 | 302 | writeln('delphi wrapper/bridge to '+sodium_dllFileName+' version = ',sodium_version_string); 303 | writeln; 304 | 305 | LibSodiumRandomDemo; 306 | writeln; 307 | 308 | LibSodiumHmacSha2AuthDemo; 309 | writeln; 310 | 311 | LibSodiumAeadChacha20poly1305Demo; 312 | writeln; 313 | 314 | LibSodiumCryptoSecretBoxDemo; 315 | writeln; 316 | 317 | LibSodiumCryptoAuthDemo; 318 | writeln; 319 | 320 | LibSodiumCryptoDHCurve25519Demo; 321 | writeln; 322 | 323 | LibSodiumBlake2HashDemo; 324 | writeln; 325 | 326 | LibSodiumSalsa208sha256PasswordHashingDemo; 327 | writeln; 328 | 329 | end; 330 | 331 | 332 | //main 333 | begin 334 | TestLibSodium; 335 | end. 336 | 337 | -------------------------------------------------------------------------------- /lsDemo.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {D348FA24-1A2D-40D8-9E51-8FD1F3FF3558} 4 | lsDemo.dpr 5 | True 6 | Debug 7 | 3 8 | Console 9 | None 10 | 16.1 11 | Win32 12 | DCC32 13 | 14 | 15 | true 16 | 17 | 18 | true 19 | Base 20 | true 21 | 22 | 23 | true 24 | Base 25 | true 26 | 27 | 28 | true 29 | Base 30 | true 31 | 32 | 33 | lsDemo.exe 34 | false 35 | lsDemo 36 | false 37 | 00400000 38 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) 39 | CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName= 40 | 1033 41 | false 42 | false 43 | false 44 | 45 | 46 | CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= 47 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) 48 | 49 | 50 | false 51 | 0 52 | 0 53 | RELEASE;$(DCC_Define) 54 | 55 | 56 | true 57 | DEBUG;$(DCC_Define) 58 | false 59 | 60 | 61 | 62 | MainSource 63 | 64 | 65 | Cfg_2 66 | Base 67 | 68 | 69 | Base 70 | 71 | 72 | Cfg_1 73 | Base 74 | 75 | 76 | 77 | 78 | Delphi.Personality.12 79 | 80 | 81 | 82 | 83 | lsDemo.dpr 84 | 85 | 86 | False 87 | True 88 | False 89 | 90 | 91 | False 92 | False 93 | 1 94 | 0 95 | 0 96 | 0 97 | False 98 | False 99 | False 100 | False 101 | False 102 | 1033 103 | 1252 104 | 105 | 106 | 107 | 108 | 1.0.0.0 109 | 110 | 111 | 112 | 113 | 114 | 1.0.0.0 115 | 116 | 117 | 118 | 119 | False 120 | True 121 | True 122 | 123 | 124 | 12 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /lsDemo.drc: -------------------------------------------------------------------------------- 1 | /* VER150 2 | Generated by the Borland Delphi Pascal Compiler 3 | because -GD or --drc was supplied to the compiler. 4 | 5 | This file contains compiler-generated resources that 6 | were bound to the executable. 7 | If this file is empty, then no compiler-generated 8 | resources were bound to the produced executable. 9 | */ 10 | 11 | #define RTLConsts_SListCountError 65424 12 | #define RTLConsts_SListIndexError 65425 13 | #define RTLConsts_SReadError 65426 14 | #define RTLConsts_SSeekNotImplemented 65427 15 | #define RTLConsts_SSortedListError 65428 16 | #define RTLConsts_SWriteError 65429 17 | #define SysConst_SShortDayNameThu 65440 18 | #define SysConst_SShortDayNameFri 65441 19 | #define SysConst_SShortDayNameSat 65442 20 | #define SysConst_SLongDayNameSun 65443 21 | #define SysConst_SLongDayNameMon 65444 22 | #define SysConst_SLongDayNameTue 65445 23 | #define SysConst_SLongDayNameWed 65446 24 | #define SysConst_SLongDayNameThu 65447 25 | #define SysConst_SLongDayNameFri 65448 26 | #define SysConst_SLongDayNameSat 65449 27 | #define RTLConsts_SAssignError 65450 28 | #define RTLConsts_SDuplicateString 65451 29 | #define RTLConsts_SFCreateErrorEx 65452 30 | #define RTLConsts_SFOpenErrorEx 65453 31 | #define RTLConsts_SInvalidPropertyValue 65454 32 | #define RTLConsts_SListCapacityError 65455 33 | #define SysConst_SLongMonthNameJan 65456 34 | #define SysConst_SLongMonthNameFeb 65457 35 | #define SysConst_SLongMonthNameMar 65458 36 | #define SysConst_SLongMonthNameApr 65459 37 | #define SysConst_SLongMonthNameMay 65460 38 | #define SysConst_SLongMonthNameJun 65461 39 | #define SysConst_SLongMonthNameJul 65462 40 | #define SysConst_SLongMonthNameAug 65463 41 | #define SysConst_SLongMonthNameSep 65464 42 | #define SysConst_SLongMonthNameOct 65465 43 | #define SysConst_SLongMonthNameNov 65466 44 | #define SysConst_SLongMonthNameDec 65467 45 | #define SysConst_SShortDayNameSun 65468 46 | #define SysConst_SShortDayNameMon 65469 47 | #define SysConst_SShortDayNameTue 65470 48 | #define SysConst_SShortDayNameWed 65471 49 | #define SysConst_SAbstractError 65472 50 | #define SysConst_SModuleAccessViolation 65473 51 | #define SysConst_SOSError 65474 52 | #define SysConst_SUnkOSError 65475 53 | #define SysConst_SShortMonthNameJan 65476 54 | #define SysConst_SShortMonthNameFeb 65477 55 | #define SysConst_SShortMonthNameMar 65478 56 | #define SysConst_SShortMonthNameApr 65479 57 | #define SysConst_SShortMonthNameMay 65480 58 | #define SysConst_SShortMonthNameJun 65481 59 | #define SysConst_SShortMonthNameJul 65482 60 | #define SysConst_SShortMonthNameAug 65483 61 | #define SysConst_SShortMonthNameSep 65484 62 | #define SysConst_SShortMonthNameOct 65485 63 | #define SysConst_SShortMonthNameNov 65486 64 | #define SysConst_SShortMonthNameDec 65487 65 | #define SysConst_SVarArrayLocked 65488 66 | #define SysConst_SInvalidVarCast 65489 67 | #define SysConst_SInvalidVarOp 65490 68 | #define SysConst_SInvalidVarOpWithHResultWithPrefix 65491 69 | #define SysConst_SVarTypeCouldNotConvert 65492 70 | #define SysConst_SVarTypeConvertOverflow 65493 71 | #define SysConst_SVarOverflow 65494 72 | #define SysConst_SVarInvalid 65495 73 | #define SysConst_SVarBadType 65496 74 | #define SysConst_SVarNotImplemented 65497 75 | #define SysConst_SVarUnexpected 65498 76 | #define SysConst_SExternalException 65499 77 | #define SysConst_SAssertionFailed 65500 78 | #define SysConst_SIntfCastError 65501 79 | #define SysConst_SSafecallException 65502 80 | #define SysConst_SAssertError 65503 81 | #define SysConst_SInvalidPointer 65504 82 | #define SysConst_SInvalidCast 65505 83 | #define SysConst_SAccessViolationArg3 65506 84 | #define SysConst_SAccessViolationNoArg 65507 85 | #define SysConst_SStackOverflow 65508 86 | #define SysConst_SControlC 65509 87 | #define SysConst_SPrivilege 65510 88 | #define SysConst_SException 65511 89 | #define SysConst_SExceptTitle 65512 90 | #define SysConst_SInvalidFormat 65513 91 | #define SysConst_SArgumentMissing 65514 92 | #define SysConst_SDispatchError 65515 93 | #define SysConst_SReadAccess 65516 94 | #define SysConst_SWriteAccess 65517 95 | #define SysConst_SVarArrayCreate 65518 96 | #define SysConst_SVarArrayBounds 65519 97 | #define SysConst_SOutOfMemory 65520 98 | #define SysConst_SInOutError 65521 99 | #define SysConst_SFileNotFound 65522 100 | #define SysConst_SInvalidFilename 65523 101 | #define SysConst_STooManyOpenFiles 65524 102 | #define SysConst_SAccessDenied 65525 103 | #define SysConst_SEndOfFile 65526 104 | #define SysConst_SDiskFull 65527 105 | #define SysConst_SInvalidInput 65528 106 | #define SysConst_SDivByZero 65529 107 | #define SysConst_SRangeError 65530 108 | #define SysConst_SIntOverflow 65531 109 | #define SysConst_SInvalidOp 65532 110 | #define SysConst_SZeroDivide 65533 111 | #define SysConst_SOverflow 65534 112 | #define SysConst_SUnderflow 65535 113 | STRINGTABLE 114 | BEGIN 115 | RTLConsts_SListCountError, "List count out of bounds (%d)" 116 | RTLConsts_SListIndexError, "List index out of bounds (%d)" 117 | RTLConsts_SReadError, "Stream read error" 118 | RTLConsts_SSeekNotImplemented, "%s.Seek not implemented" 119 | RTLConsts_SSortedListError, "Operation not allowed on sorted list" 120 | RTLConsts_SWriteError, "Stream write error" 121 | SysConst_SShortDayNameThu, "Thu" 122 | SysConst_SShortDayNameFri, "Fri" 123 | SysConst_SShortDayNameSat, "Sat" 124 | SysConst_SLongDayNameSun, "Sunday" 125 | SysConst_SLongDayNameMon, "Monday" 126 | SysConst_SLongDayNameTue, "Tuesday" 127 | SysConst_SLongDayNameWed, "Wednesday" 128 | SysConst_SLongDayNameThu, "Thursday" 129 | SysConst_SLongDayNameFri, "Friday" 130 | SysConst_SLongDayNameSat, "Saturday" 131 | RTLConsts_SAssignError, "Cannot assign a %s to a %s" 132 | RTLConsts_SDuplicateString, "String list does not allow duplicates" 133 | RTLConsts_SFCreateErrorEx, "Cannot create file \"%s\". %s" 134 | RTLConsts_SFOpenErrorEx, "Cannot open file \"%s\". %s" 135 | RTLConsts_SInvalidPropertyValue, "Invalid property value" 136 | RTLConsts_SListCapacityError, "List capacity out of bounds (%d)" 137 | SysConst_SLongMonthNameJan, "January" 138 | SysConst_SLongMonthNameFeb, "February" 139 | SysConst_SLongMonthNameMar, "March" 140 | SysConst_SLongMonthNameApr, "April" 141 | SysConst_SLongMonthNameMay, "May" 142 | SysConst_SLongMonthNameJun, "June" 143 | SysConst_SLongMonthNameJul, "July" 144 | SysConst_SLongMonthNameAug, "August" 145 | SysConst_SLongMonthNameSep, "September" 146 | SysConst_SLongMonthNameOct, "October" 147 | SysConst_SLongMonthNameNov, "November" 148 | SysConst_SLongMonthNameDec, "December" 149 | SysConst_SShortDayNameSun, "Sun" 150 | SysConst_SShortDayNameMon, "Mon" 151 | SysConst_SShortDayNameTue, "Tue" 152 | SysConst_SShortDayNameWed, "Wed" 153 | SysConst_SAbstractError, "Abstract Error" 154 | SysConst_SModuleAccessViolation, "Access violation at address %p in module '%s'. %s of address %p" 155 | SysConst_SOSError, "System Error. Code: %d.\r\n%s" 156 | SysConst_SUnkOSError, "A call to an OS function failed" 157 | SysConst_SShortMonthNameJan, "Jan" 158 | SysConst_SShortMonthNameFeb, "Feb" 159 | SysConst_SShortMonthNameMar, "Mar" 160 | SysConst_SShortMonthNameApr, "Apr" 161 | SysConst_SShortMonthNameMay, "May" 162 | SysConst_SShortMonthNameJun, "Jun" 163 | SysConst_SShortMonthNameJul, "Jul" 164 | SysConst_SShortMonthNameAug, "Aug" 165 | SysConst_SShortMonthNameSep, "Sep" 166 | SysConst_SShortMonthNameOct, "Oct" 167 | SysConst_SShortMonthNameNov, "Nov" 168 | SysConst_SShortMonthNameDec, "Dec" 169 | SysConst_SVarArrayLocked, "Variant or safe array is locked" 170 | SysConst_SInvalidVarCast, "Invalid variant type conversion" 171 | SysConst_SInvalidVarOp, "Invalid variant operation" 172 | SysConst_SInvalidVarOpWithHResultWithPrefix, "Invalid variant operation (%s%.8x)\n%s" 173 | SysConst_SVarTypeCouldNotConvert, "Could not convert variant of type (%s) into type (%s)" 174 | SysConst_SVarTypeConvertOverflow, "Overflow while converting variant of type (%s) into type (%s)" 175 | SysConst_SVarOverflow, "Variant overflow" 176 | SysConst_SVarInvalid, "Invalid argument" 177 | SysConst_SVarBadType, "Invalid variant type" 178 | SysConst_SVarNotImplemented, "Operation not supported" 179 | SysConst_SVarUnexpected, "Unexpected variant error" 180 | SysConst_SExternalException, "External exception %x" 181 | SysConst_SAssertionFailed, "Assertion failed" 182 | SysConst_SIntfCastError, "Interface not supported" 183 | SysConst_SSafecallException, "Exception in safecall method" 184 | SysConst_SAssertError, "%s (%s, line %d)" 185 | SysConst_SInvalidPointer, "Invalid pointer operation" 186 | SysConst_SInvalidCast, "Invalid class typecast" 187 | SysConst_SAccessViolationArg3, "Access violation at address %p. %s of address %p" 188 | SysConst_SAccessViolationNoArg, "Access violation" 189 | SysConst_SStackOverflow, "Stack overflow" 190 | SysConst_SControlC, "Control-C hit" 191 | SysConst_SPrivilege, "Privileged instruction" 192 | SysConst_SException, "Exception %s in module %s at %p.\r\n%s%s\r\n" 193 | SysConst_SExceptTitle, "Application Error" 194 | SysConst_SInvalidFormat, "Format '%s' invalid or incompatible with argument" 195 | SysConst_SArgumentMissing, "No argument for format '%s'" 196 | SysConst_SDispatchError, "Variant method calls not supported" 197 | SysConst_SReadAccess, "Read" 198 | SysConst_SWriteAccess, "Write" 199 | SysConst_SVarArrayCreate, "Error creating variant or safe array" 200 | SysConst_SVarArrayBounds, "Variant or safe array index out of bounds" 201 | SysConst_SOutOfMemory, "Out of memory" 202 | SysConst_SInOutError, "I/O error %d" 203 | SysConst_SFileNotFound, "File not found" 204 | SysConst_SInvalidFilename, "Invalid filename" 205 | SysConst_STooManyOpenFiles, "Too many open files" 206 | SysConst_SAccessDenied, "File access denied" 207 | SysConst_SEndOfFile, "Read beyond end of file" 208 | SysConst_SDiskFull, "Disk full" 209 | SysConst_SInvalidInput, "Invalid numeric input" 210 | SysConst_SDivByZero, "Division by zero" 211 | SysConst_SRangeError, "Range check error" 212 | SysConst_SIntOverflow, "Integer overflow" 213 | SysConst_SInvalidOp, "Invalid floating point operation" 214 | SysConst_SZeroDivide, "Floating point division by zero" 215 | SysConst_SOverflow, "Floating point overflow" 216 | SysConst_SUnderflow, "Floating point underflow" 217 | END 218 | 219 | -------------------------------------------------------------------------------- /lsDemo.dsk: -------------------------------------------------------------------------------- 1 | [Closed Files] 2 | File_0=SourceModule,'C:\Delphi7\TYM\test\WebSocketCrypt.pas',0,1,1,35,7,0,0 3 | File_1=SourceModule,'C:\Delphi7\TYM\test\crandom.pas',0,1,113,1,113,0,0 4 | File_2=SourceModule,'C:\Delphi7\TYM\test\WebSocketUpgrade.pas',0,1,146,41,178,0,0 5 | File_3=SourceModule,'C:\Delphi7\TYM\test\DCPauth.pas',0,1,1,1,1,0,0 6 | File_4=SourceModule,'C:\Delphi7\ws\websocket2.pas',0,1,877,33,883,0,0 7 | File_5=SourceModule,'c:\delphi7\delphizlib\ZLibExApi.pas',0,1,70,35,87,0,0 8 | File_6=SourceModule,'C:\Delphi7\DelphiZLib\ZLibEx.pas',0,1,764,1,781,0,0 9 | File_7=SourceModule,'C:\Delphi7\TYM\test\tserv1.pas',0,1,523,1,545,1,0 10 | File_8=SourceModule,'C:\Delphi7\TYM\test\LFSRrand.pas',0,1,21,3,23,0,0 11 | File_9=SourceModule,'c:\delphi7\tntunicode\TntForms.pas',0,1,751,1,778,0,0 12 | 13 | [Modules] 14 | Module0=Q:\Workspace\libsodium-delphi\lsDemo.dpr 15 | Module1=Q:\Workspace\libsodium-delphi\LibSodium.pas 16 | Count=2 17 | EditWindowCount=1 18 | 19 | [Q:\Workspace\libsodium-delphi\lsDemo.dpr] 20 | ModuleType=SourceModule 21 | FormState=0 22 | FormOnTop=0 23 | 24 | [Q:\Workspace\libsodium-delphi\LibSodium.pas] 25 | ModuleType=SourceModule 26 | FormState=0 27 | FormOnTop=0 28 | 29 | [C:\Delphi7\Projects\ProjectGroup1.bpg] 30 | FormState=0 31 | FormOnTop=0 32 | 33 | [EditWindow0] 34 | ViewCount=2 35 | CurrentView=0 36 | View0=0 37 | View1=1 38 | CodeExplorer=CodeExplorer@EditWindow0 39 | MessageView=MessageView@EditWindow0 40 | Create=1 41 | Visible=1 42 | State=0 43 | Left=242 44 | Top=122 45 | Width=1085 46 | Height=758 47 | MaxLeft=-1 48 | MaxTop=-1 49 | ClientWidth=1077 50 | ClientHeight=731 51 | LeftPanelSize=140 52 | LeftPanelClients=CodeExplorer@EditWindow0 53 | LeftPanelData=000004000000000000000000000000000000000000000000000100000000000000000C000000436F64654578706C6F726572FFFFFFFF 54 | RightPanelSize=0 55 | BottomPanelSize=0 56 | BottomPanelClients=MessageView@EditWindow0 57 | BottomPanelData=00000400010000000B0000004D657373616765566965773504000000000000025500000000000000010000000000000000000000000100000000350400000B0000004D65737361676556696577FFFFFFFF 58 | 59 | [View0] 60 | Module=Q:\Workspace\libsodium-delphi\lsDemo.dpr 61 | CursorX=1 62 | CursorY=1 63 | TopLine=1 64 | LeftCol=1 65 | 66 | [View1] 67 | Module=Q:\Workspace\libsodium-delphi\LibSodium.pas 68 | CursorX=41 69 | CursorY=5 70 | TopLine=1 71 | LeftCol=1 72 | 73 | [Watches] 74 | Count=0 75 | 76 | [WatchWindow] 77 | WatchColumnWidth=123 78 | WatchShowColumnHeaders=1 79 | Create=1 80 | Visible=0 81 | State=0 82 | Left=185 83 | Top=882 84 | Width=539 85 | Height=187 86 | MaxLeft=-1 87 | MaxTop=-1 88 | ClientWidth=531 89 | ClientHeight=161 90 | TBDockHeight=149 91 | LRDockWidth=531 92 | Dockable=1 93 | 94 | [Breakpoints] 95 | Count=0 96 | 97 | [AddressBreakpoints] 98 | Count=0 99 | 100 | [Main Window] 101 | Create=1 102 | Visible=1 103 | State=2 104 | Left=0 105 | Top=0 106 | Width=1600 107 | Height=105 108 | MaxLeft=-1 109 | MaxTop=-1 110 | MaxWidth=1608 111 | MaxHeight=105 112 | ClientWidth=1600 113 | ClientHeight=78 114 | 115 | [ProjectManager] 116 | Create=1 117 | Visible=0 118 | State=0 119 | Left=369 120 | Top=372 121 | Width=537 122 | Height=370 123 | MaxLeft=-1 124 | MaxTop=-1 125 | ClientWidth=529 126 | ClientHeight=344 127 | TBDockHeight=370 128 | LRDockWidth=537 129 | Dockable=1 130 | 131 | [Components] 132 | Left=240 133 | Top=237 134 | Width=183 135 | Height=235 136 | Create=1 137 | Visible=0 138 | State=0 139 | MaxLeft=-1 140 | MaxTop=-1 141 | ClientWidth=175 142 | ClientHeight=209 143 | TBDockHeight=235 144 | LRDockWidth=183 145 | Dockable=1 146 | 147 | [CPUWindow] 148 | Create=1 149 | Visible=0 150 | State=0 151 | Left=533 152 | Top=424 153 | Width=530 154 | Height=352 155 | MaxLeft=-1 156 | MaxTop=-1 157 | ClientWidth=522 158 | ClientHeight=325 159 | DumpPane=101 160 | DisassemblyPane=240 161 | RegisterPane=297 162 | FlagPane=82 163 | 164 | [AlignmentPalette] 165 | Create=1 166 | Visible=0 167 | State=0 168 | Left=200 169 | Top=116 170 | Width=156 171 | Height=84 172 | MaxLeft=-1 173 | MaxTop=-1 174 | ClientWidth=150 175 | ClientHeight=60 176 | 177 | [PropertyInspector] 178 | Create=1 179 | Visible=1 180 | State=0 181 | Left=0 182 | Top=111 183 | Width=232 184 | Height=935 185 | MaxLeft=-1 186 | MaxTop=-1 187 | ClientWidth=224 188 | ClientHeight=909 189 | TBDockHeight=772 190 | LRDockWidth=232 191 | Dockable=1 192 | SplitPos=105 193 | ArrangeBy=Name 194 | SelectedItem= 195 | ExpandedItems= 196 | HiddenCategories=Legacy 197 | 198 | [BreakpointWindow] 199 | Create=1 200 | Visible=0 201 | State=0 202 | Left=431 203 | Top=501 204 | Width=737 205 | Height=197 206 | MaxLeft=-1 207 | MaxTop=-1 208 | ClientWidth=729 209 | ClientHeight=171 210 | TBDockHeight=197 211 | LRDockWidth=737 212 | Dockable=1 213 | Column0Width=123 214 | Column1Width=92 215 | Column2Width=246 216 | Column3Width=246 217 | Column4Width=92 218 | Column5Width=92 219 | 220 | [CallStackWindow] 221 | Create=1 222 | Visible=1 223 | State=0 224 | Left=34 225 | Top=843 226 | Width=294 227 | Height=161 228 | MaxLeft=-1 229 | MaxTop=-1 230 | ClientWidth=286 231 | ClientHeight=135 232 | TBDockHeight=161 233 | LRDockWidth=294 234 | Dockable=1 235 | 236 | [ThreadStatusWindow] 237 | Create=1 238 | Visible=0 239 | State=0 240 | Left=193 241 | Top=107 242 | Width=624 243 | Height=152 244 | MaxLeft=-1 245 | MaxTop=-1 246 | ClientWidth=616 247 | ClientHeight=126 248 | TBDockHeight=152 249 | LRDockWidth=624 250 | Dockable=1 251 | Column0Width=178 252 | Column1Width=123 253 | Column2Width=142 254 | Column3Width=308 255 | 256 | [ObjectTree] 257 | Create=1 258 | Visible=0 259 | State=0 260 | Left=0 261 | Top=122 262 | Width=190 263 | Height=418 264 | MaxLeft=-1 265 | MaxTop=-1 266 | ClientWidth=182 267 | ClientHeight=392 268 | TBDockHeight=418 269 | LRDockWidth=190 270 | Dockable=1 271 | 272 | [DebugLogView] 273 | Create=1 274 | Visible=0 275 | State=0 276 | Left=591 277 | Top=454 278 | Width=417 279 | Height=291 280 | MaxLeft=-1 281 | MaxTop=-1 282 | ClientWidth=409 283 | ClientHeight=265 284 | TBDockHeight=291 285 | LRDockWidth=417 286 | Dockable=1 287 | 288 | [LocalVarsWindow] 289 | Create=1 290 | Visible=0 291 | State=0 292 | Left=273 293 | Top=197 294 | Width=421 295 | Height=192 296 | MaxLeft=-1 297 | MaxTop=-1 298 | ClientWidth=413 299 | ClientHeight=166 300 | TBDockHeight=192 301 | LRDockWidth=421 302 | Dockable=1 303 | 304 | [ToDo List] 305 | Create=1 306 | Visible=0 307 | State=0 308 | Left=341 309 | Top=307 310 | Width=470 311 | Height=250 312 | MaxLeft=-1 313 | MaxTop=-1 314 | ClientWidth=462 315 | ClientHeight=224 316 | TBDockHeight=250 317 | LRDockWidth=470 318 | Dockable=0 319 | Column0Width=200 320 | Column1Width=30 321 | Column2Width=100 322 | Column3Width=70 323 | Column4Width=70 324 | SortOrder=4 325 | ShowHints=1 326 | ShowChecked=1 327 | 328 | [FPUWindow] 329 | Create=1 330 | Visible=0 331 | State=0 332 | Left=271 333 | Top=248 334 | Width=457 335 | Height=250 336 | MaxLeft=-1 337 | MaxTop=-1 338 | ClientWidth=449 339 | ClientHeight=223 340 | RegisterPane=147 341 | FlagPane=72 342 | 343 | [ModuleWindow] 344 | Create=1 345 | Visible=0 346 | State=0 347 | Left=197 348 | Top=130 349 | Width=638 350 | Height=355 351 | MaxLeft=-1 352 | MaxTop=-1 353 | ClientWidth=630 354 | ClientHeight=329 355 | TBDockHeight=355 356 | LRDockWidth=638 357 | Dockable=1 358 | Column0Width=125 359 | Column1Width=100 360 | Column2Width=155 361 | EntryPointPane=225 362 | CompUnitPane=104 363 | 364 | [MessageHintFrm] 365 | Create=1 366 | Visible=0 367 | State=0 368 | Left=268 369 | Top=963 370 | Width=383 371 | Height=195 372 | MaxLeft=-1 373 | MaxTop=-1 374 | ClientWidth=375 375 | ClientHeight=169 376 | TBDockHeight=195 377 | LRDockWidth=383 378 | Dockable=1 379 | 380 | [CnAsciiForm] 381 | Create=1 382 | Visible=0 383 | State=0 384 | Left=504 385 | Top=457 386 | Width=220 387 | Height=417 388 | MaxLeft=-1 389 | MaxTop=-1 390 | ClientWidth=212 391 | ClientHeight=391 392 | TBDockHeight=417 393 | LRDockWidth=220 394 | Dockable=1 395 | 396 | [CodeExplorer@EditWindow0] 397 | Create=1 398 | Visible=1 399 | State=0 400 | Left=0 401 | Top=12 402 | Width=140 403 | Height=719 404 | MaxLeft=-1 405 | MaxTop=-1 406 | ClientWidth=140 407 | ClientHeight=719 408 | TBDockHeight=305 409 | LRDockWidth=140 410 | Dockable=1 411 | 412 | [MessageView@EditWindow0] 413 | Create=1 414 | Visible=0 415 | State=0 416 | Left=12 417 | Top=0 418 | Width=1065 419 | Height=85 420 | MaxLeft=-1 421 | MaxTop=-1 422 | ClientWidth=1065 423 | ClientHeight=85 424 | TBDockHeight=85 425 | LRDockWidth=443 426 | Dockable=1 427 | 428 | [DockHosts] 429 | DockHostCount=0 430 | 431 | -------------------------------------------------------------------------------- /lsDemo.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexpmorris/libsodium-delphi/271d5b98b132cf775d19d616e6f38409ccc9b049/lsDemo.res --------------------------------------------------------------------------------