1 #ifndef LIBWALLY_CORE_CRYPTO_H 2 #define LIBWALLY_CORE_CRYPTO_H 3 4 #include "wally_core.h" 5 6 #ifdef __cplusplus 7 extern "C" { 8 #endif 9 10 /** 11 * Derive a pseudorandom key from inputs using an expensive application 12 * of HMAC SHA-256. 13 * 14 * :param pass: Password to derive from. 15 * :param pass_len: Length of ``pass`` in bytes. 16 * :param salt: Salt to derive from. 17 * :param salt_len: Length of ``salt`` in bytes. 18 * :param cost: The cost of the function. The larger this number, the 19 *| longer the key will take to derive. 20 * :param block_size: The size of memory blocks required. 21 * :param parallelism: Parallelism factor. 22 * :param bytes_out: Destination for the derived pseudorandom key. 23 * :param len: The length of ``bytes_out`` in bytes. 24 */ 25 WALLY_CORE_API int wally_scrypt( 26 const unsigned char *pass, 27 size_t pass_len, 28 const unsigned char *salt, 29 size_t salt_len, 30 uint32_t cost, 31 uint32_t block_size, 32 uint32_t parallelism, 33 unsigned char *bytes_out, 34 size_t len); 35 36 37 #define AES_BLOCK_LEN 16 /** Length of AES encrypted blocks */ 38 39 #define AES_KEY_LEN_128 16 /** AES-128 Key length */ 40 #define AES_KEY_LEN_192 24 /** AES-192 Key length */ 41 #define AES_KEY_LEN_256 32 /** AES-256 Key length */ 42 43 #define AES_FLAG_ENCRYPT 1 /** Encrypt */ 44 #define AES_FLAG_DECRYPT 2 /** Decrypt */ 45 46 /** 47 * Encrypt/decrypt data using AES (ECB mode, no padding). 48 * 49 * :param key: Key material for initialisation. 50 * :param key_len: Length of ``key`` in bytes. Must be an AES_KEY_LEN_ constant. 51 * :param bytes: Bytes to encrypt/decrypt. 52 * :param bytes_len: Length of ``bytes`` in bytes. Must be a multiple of ``AES_BLOCK_LEN``. 53 * :param flags: AES_FLAG_ constants indicating the desired behavior. 54 * :param bytes_out: Destination for the encrypted/decrypted data. 55 * :param len: The length of ``bytes_out`` in bytes. Must be a multiple of ``AES_BLOCK_LEN``. 56 */ 57 WALLY_CORE_API int wally_aes( 58 const unsigned char *key, 59 size_t key_len, 60 const unsigned char *bytes, 61 size_t bytes_len, 62 uint32_t flags, 63 unsigned char *bytes_out, 64 size_t len); 65 66 /** 67 * Encrypt/decrypt data using AES (CBC mode, PKCS#7 padding). 68 * 69 * :param key: Key material for initialisation. 70 * :param key_len: Length of ``key`` in bytes. Must be an AES_KEY_LEN_ constant. 71 * :param iv: Initialisation vector. 72 * :param iv_len: Length of ``iv`` in bytes. Must be ``AES_BLOCK_LEN``. 73 * :param bytes: Bytes to encrypt/decrypt. 74 * :param bytes_len: Length of ``bytes`` in bytes. Must be a multiple of ``AES_BLOCK_LEN``. 75 * :param flags: AES_FLAG_ constants indicating the desired behavior. 76 * :param bytes_out: Destination for the encrypted/decrypted data. 77 * :param len: The length of ``bytes_out`` in bytes. Must be a multiple of ``AES_BLOCK_LEN``. 78 * :param written: Destination for the number of bytes written to ``bytes_out``. 79 */ 80 WALLY_CORE_API int wally_aes_cbc( 81 const unsigned char *key, 82 size_t key_len, 83 const unsigned char *iv, 84 size_t iv_len, 85 const unsigned char *bytes, 86 size_t bytes_len, 87 uint32_t flags, 88 unsigned char *bytes_out, 89 size_t len, 90 size_t *written); 91 92 93 /** Output length for `wally_sha256` */ 94 #define SHA256_LEN 32 95 96 /** Output length for `wally_sha512` */ 97 #define SHA512_LEN 64 98 99 /** 100 * SHA-256(m) 101 * 102 * :param bytes: The message to hash 103 * :param bytes_len: The length of ``bytes`` in bytes. 104 * :param bytes_out: Destination for the resulting hash. 105 * :param len: The length of ``bytes_out`` in bytes. Must be ``SHA256_LEN``. 106 */ 107 WALLY_CORE_API int wally_sha256( 108 const unsigned char *bytes, 109 size_t bytes_len, 110 unsigned char *bytes_out, 111 size_t len); 112 113 /** 114 * SHA-256(m) midstate 115 * 116 * :param bytes: The message to hash 117 * :param bytes_len: The length of ``bytes`` in bytes. 118 * :param bytes_out: Destination for the resulting hash. 119 * :param len: The length of ``bytes_out`` in bytes. Must be ``SHA256_LEN``. 120 */ 121 WALLY_CORE_API int wally_sha256_midstate( 122 const unsigned char *bytes, 123 size_t bytes_len, 124 unsigned char *bytes_out, 125 size_t len); 126 127 /** 128 * SHA-256(SHA-256(m)) (double SHA-256) 129 * 130 * :param bytes: The message to hash 131 * :param bytes_len: The length of ``bytes`` in bytes. 132 * :param bytes_out: Destination for the resulting hash. 133 * :param len: The length of ``bytes_out`` in bytes. Must be ``SHA256_LEN``. 134 */ 135 WALLY_CORE_API int wally_sha256d( 136 const unsigned char *bytes, 137 size_t bytes_len, 138 unsigned char *bytes_out, 139 size_t len); 140 141 /** 142 * SHA-512(m) 143 * 144 * :param bytes: The message to hash 145 * :param bytes_len: The length of ``bytes`` in bytes. 146 * :param bytes_out: Destination for the resulting hash. 147 * :param len: The length of ``bytes_out`` in bytes. Must be ``SHA512_LEN``. 148 */ 149 WALLY_CORE_API int wally_sha512( 150 const unsigned char *bytes, 151 size_t bytes_len, 152 unsigned char *bytes_out, 153 size_t len); 154 155 /** Output length for `wally_hash160` */ 156 #define HASH160_LEN 20 157 158 /** 159 * RIPEMD-160(SHA-256(m)) 160 * 161 * :param bytes: The message to hash 162 * :param bytes_len: The length of ``bytes`` in bytes. 163 * :param bytes_out: Destination for the resulting hash. 164 * :param len: The length of ``bytes_out`` in bytes. Must be ``HASH160_LEN``. 165 */ 166 WALLY_CORE_API int wally_hash160( 167 const unsigned char *bytes, 168 size_t bytes_len, 169 unsigned char *bytes_out, 170 size_t len); 171 172 173 /** Output length for `wally_hmac_sha256` */ 174 #define HMAC_SHA256_LEN 32 175 176 /** Output length for `wally_hmac_sha512` */ 177 #define HMAC_SHA512_LEN 64 178 179 /** 180 * Compute an HMAC using SHA-256 181 * 182 * :param key: The key for the hash 183 * :param key_len: The length of ``key`` in bytes. 184 * :param bytes: The message to hash 185 * :param bytes_len: The length of ``bytes`` in bytes. 186 * :param bytes_out: Destination for the resulting HMAC. 187 * :param len: The length of ``bytes_out`` in bytes. Must be ``HMAC_SHA256_LEN``. 188 */ 189 WALLY_CORE_API int wally_hmac_sha256( 190 const unsigned char *key, 191 size_t key_len, 192 const unsigned char *bytes, 193 size_t bytes_len, 194 unsigned char *bytes_out, 195 size_t len); 196 197 /** 198 * Compute an HMAC using SHA-512 199 * 200 * :param key: The key for the hash 201 * :param key_len: The length of ``key`` in bytes. 202 * :param bytes: The message to hash 203 * :param bytes_len: The length of ``bytes`` in bytes. 204 * :param bytes_out: Destination for the resulting HMAC. 205 * :param len: The length of ``bytes_out`` in bytes. Must be ``HMAC_SHA512_LEN``. 206 */ 207 WALLY_CORE_API int wally_hmac_sha512( 208 const unsigned char *key, 209 size_t key_len, 210 const unsigned char *bytes, 211 size_t bytes_len, 212 unsigned char *bytes_out, 213 size_t len); 214 215 216 /** Output length for `wally_pbkdf2_hmac_sha256` */ 217 #define PBKDF2_HMAC_SHA256_LEN 32 218 219 /** Output length for `wally_pbkdf2_hmac_sha512` */ 220 #define PBKDF2_HMAC_SHA512_LEN 64 221 222 /** 223 * Derive a pseudorandom key from inputs using HMAC SHA-256. 224 * 225 * :param pass: Password to derive from. 226 * :param pass_len: Length of ``pass`` in bytes. 227 * :param salt: Salt to derive from. 228 * :param salt_len: Length of ``salt`` in bytes. 229 * :param flags: Reserved, must be 0. 230 * :param cost: The cost of the function. The larger this number, the 231 *| longer the key will take to derive. 232 * :param bytes_out: Destination for the derived pseudorandom key. 233 * :param len: The length of ``bytes_out`` in bytes. This must be a multiple 234 *| of ``PBKDF2_HMAC_SHA256_LEN``. 235 */ 236 WALLY_CORE_API int wally_pbkdf2_hmac_sha256( 237 const unsigned char *pass, 238 size_t pass_len, 239 const unsigned char *salt, 240 size_t salt_len, 241 uint32_t flags, 242 uint32_t cost, 243 unsigned char *bytes_out, 244 size_t len); 245 246 /** 247 * Derive a pseudorandom key from inputs using HMAC SHA-512. 248 * 249 * :param pass: Password to derive from. 250 * :param pass_len: Length of ``pass`` in bytes. 251 * :param salt: Salt to derive from. 252 * :param salt_len: Length of ``salt`` in bytes. 253 * :param flags: Reserved, must be 0. 254 * :param cost: The cost of the function. The larger this number, the 255 *| longer the key will take to derive. 256 * :param bytes_out: Destination for the derived pseudorandom key. 257 * :param len: The length of ``bytes_out`` in bytes. This must be a multiple 258 *| of ``PBKDF2_HMAC_SHA512_LEN``. 259 */ 260 WALLY_CORE_API int wally_pbkdf2_hmac_sha512( 261 const unsigned char *pass, 262 size_t pass_len, 263 const unsigned char *salt, 264 size_t salt_len, 265 uint32_t flags, 266 uint32_t cost, 267 unsigned char *bytes_out, 268 size_t len); 269 270 /** The length of a private key used for EC signing */ 271 #define EC_PRIVATE_KEY_LEN 32 272 /** The length of a public key used for EC signing */ 273 #define EC_PUBLIC_KEY_LEN 33 274 /** The length of an uncompressed public key */ 275 #define EC_PUBLIC_KEY_UNCOMPRESSED_LEN 65 276 /** The length of a message hash to EC sign */ 277 #define EC_MESSAGE_HASH_LEN 32 278 /** The length of a compact signature produced by EC signing */ 279 #define EC_SIGNATURE_LEN 64 280 /** The length of a compact recoverable signature produced by EC signing */ 281 #define EC_SIGNATURE_RECOVERABLE_LEN 65 282 /** The maximum encoded length of a DER encoded signature */ 283 #define EC_SIGNATURE_DER_MAX_LEN 72 284 /** The maximum encoded length of a DER encoded signature created with EC_FLAG_GRIND_R */ 285 #define EC_SIGNATURE_DER_MAX_LOW_R_LEN 71 286 287 /** Indicates that a signature using ECDSA/secp256k1 is required */ 288 #define EC_FLAG_ECDSA 0x1 289 /** Indicates that a signature using EC-Schnorr-SHA256 is required */ 290 #define EC_FLAG_SCHNORR 0x2 291 /** Indicates that the signature nonce should be incremented until the signature is low-R */ 292 #define EC_FLAG_GRIND_R 0x4 293 /** Indicates that the signature is recoverable */ 294 #define EC_FLAG_RECOVERABLE 0x8 295 296 /* All defined flags */ 297 #define EC_FLAGS_ALL (0x1 | 0x2 | 0x4 | 0x8) 298 299 /** 300 * Verify that a private key is valid. 301 * 302 * :param priv_key: The private key to validate. 303 * :param priv_key_len: The length of ``priv_key`` in bytes. Must be ``EC_PRIVATE_KEY_LEN``. 304 */ 305 WALLY_CORE_API int wally_ec_private_key_verify( 306 const unsigned char *priv_key, 307 size_t priv_key_len); 308 309 /** 310 * Verify that a public key is valid. 311 * 312 * :param pub_key: The public key to validate. 313 * :param pub_key_len: The length of ``pub_key`` in bytes. Must be 314 *| ``EC_PUBLIC_KEY_LEN`` or ``EC_PUBLIC_KEY_UNCOMPRESSED_LEN``. 315 */ 316 WALLY_CORE_API int wally_ec_public_key_verify( 317 const unsigned char *pub_key, 318 size_t pub_key_len); 319 320 /** 321 * Create a public key from a private key. 322 * 323 * :param priv_key: The private key to create a public key from. 324 * :param priv_key_len: The length of ``priv_key`` in bytes. Must be ``EC_PRIVATE_KEY_LEN``. 325 * :param bytes_out: Destination for the resulting public key. 326 * :param len: The length of ``bytes_out`` in bytes. Must be ``EC_PUBLIC_KEY_LEN``. 327 */ 328 WALLY_CORE_API int wally_ec_public_key_from_private_key( 329 const unsigned char *priv_key, 330 size_t priv_key_len, 331 unsigned char *bytes_out, 332 size_t len); 333 334 /** 335 * Create an uncompressed public key from a compressed public key. 336 * 337 * :param pub_key: The public key to decompress. 338 * :param pub_key_len: The length of ``pub_key`` in bytes. Must be ``EC_PUBLIC_KEY_LEN``. 339 * :param bytes_out: Destination for the resulting public key. 340 * :param len: The length of ``bytes_out`` in bytes. Must be ``EC_PUBLIC_KEY_UNCOMPRESSED_LEN``. 341 */ 342 WALLY_CORE_API int wally_ec_public_key_decompress( 343 const unsigned char *pub_key, 344 size_t pub_key_len, 345 unsigned char *bytes_out, 346 size_t len); 347 348 /** 349 * Negates a public key. 350 * 351 * :param pub_key: The public key to negate. 352 * :param pub_key_len: The length of ``pub_key`` in bytes. Must be ``EC_PUBLIC_KEY_LEN``. 353 * :param bytes_out: Destination for the resulting public key. 354 * :param len: The length of ``bytes_out`` in bytes. Must be ``EC_PUBLIC_KEY_LEN``. 355 */ 356 WALLY_CORE_API int wally_ec_public_key_negate( 357 const unsigned char *pub_key, 358 size_t pub_key_len, 359 unsigned char *bytes_out, 360 size_t len); 361 362 /** 363 * Sign a message hash with a private key, producing a compact signature. 364 * 365 * :param priv_key: The private key to sign with. 366 * :param priv_key_len: The length of ``priv_key`` in bytes. Must be ``EC_PRIVATE_KEY_LEN``. 367 * :param bytes: The message hash to sign. 368 * :param bytes_len: The length of ``bytes`` in bytes. Must be ``EC_MESSAGE_HASH_LEN``. 369 * :param flags: EC_FLAG_ flag values indicating desired behavior. 370 * :param bytes_out: Destination for the resulting compact signature. 371 * :param len: The length of ``bytes_out`` in bytes. Must be 372 *| ``EC_SIGNATURE_LEN`` if EC_FLAG_RECOVERABLE is not set, otherwise must 373 *| be ``EC_SIGNATURE_RECOVERABLE_LEN``. 374 */ 375 WALLY_CORE_API int wally_ec_sig_from_bytes( 376 const unsigned char *priv_key, 377 size_t priv_key_len, 378 const unsigned char *bytes, 379 size_t bytes_len, 380 uint32_t flags, 381 unsigned char *bytes_out, 382 size_t len); 383 384 /** 385 * Convert a signature to low-s form. 386 * 387 * :param sig: The compact signature to convert. 388 * :param sig_len: The length of ``sig`` in bytes. Must be ``EC_SIGNATURE_LEN``. 389 * :param bytes_out: Destination for the resulting low-s signature. 390 * :param len: The length of ``bytes_out`` in bytes. Must be ``EC_SIGNATURE_LEN``. 391 */ 392 WALLY_CORE_API int wally_ec_sig_normalize( 393 const unsigned char *sig, 394 size_t sig_len, 395 unsigned char *bytes_out, 396 size_t len); 397 398 /** 399 * Convert a compact signature to DER encoding. 400 * 401 * :param sig: The compact signature to convert. 402 * :param sig_len: The length of ``sig`` in bytes. Must be ``EC_SIGNATURE_LEN``. 403 * :param bytes_out: Destination for the resulting DER encoded signature. 404 * :param len: The length of ``bytes_out`` in bytes. Must be ``EC_SIGNATURE_DER_MAX_LEN``. 405 * :param written: Destination for the number of bytes written to ``bytes_out``. 406 */ 407 WALLY_CORE_API int wally_ec_sig_to_der( 408 const unsigned char *sig, 409 size_t sig_len, 410 unsigned char *bytes_out, 411 size_t len, 412 size_t *written); 413 414 /** 415 * Convert a DER encoded signature to a compact signature. 416 * 417 * :param bytes: The DER encoded signature to convert. 418 * :param bytes_len: The length of ``sig`` in bytes. 419 * :param bytes_out: Destination for the resulting compact signature. 420 * :param len: The length of ``bytes_out`` in bytes. Must be ``EC_SIGNATURE_LEN``. 421 */ 422 WALLY_CORE_API int wally_ec_sig_from_der( 423 const unsigned char *bytes, 424 size_t bytes_len, 425 unsigned char *bytes_out, 426 size_t len); 427 428 /** 429 * Verify a signed message hash. 430 * 431 * :param pub_key: The public key to verify with. 432 * :param pub_key_len: The length of ``pub_key`` in bytes. Must be ``EC_PUBLIC_KEY_LEN``. 433 * :param bytes: The message hash to verify. 434 * :param bytes_len: The length of ``bytes`` in bytes. Must be ``EC_MESSAGE_HASH_LEN``. 435 * :param flags: EC_FLAG_ flag values indicating desired behavior. 436 * :param sig: The compact signature of the message in ``bytes``. 437 * :param sig_len: The length of ``sig`` in bytes. Must be ``EC_SIGNATURE_LEN``. 438 */ 439 WALLY_CORE_API int wally_ec_sig_verify( 440 const unsigned char *pub_key, 441 size_t pub_key_len, 442 const unsigned char *bytes, 443 size_t bytes_len, 444 uint32_t flags, 445 const unsigned char *sig, 446 size_t sig_len); 447 448 /** 449 * Recover compressed public key from a recoverable signature. 450 * 451 * :param bytes: The message hash signed. 452 * :param bytes_len: The length of ``bytes`` in bytes. Must be ``EC_MESSAGE_HASH_LEN``. 453 * :param sig: The recoverable compact signature of the message in ``bytes``. 454 * :param sig_len: The length of ``sig`` in bytes. Must be ``EC_SIGNATURE_RECOVERABLE_LEN``. 455 * :param bytes_out: Destination for recovered public key. 456 * :param len: The length of ``bytes_out`` in bytes. Must be ``EC_PUBLIC_KEY_LEN``. 457 * .. note:: The successful recovery of the public key guarantees the correctness of the signature. 458 */ 459 WALLY_CORE_API int wally_ec_sig_to_public_key( 460 const unsigned char *bytes, 461 size_t bytes_len, 462 const unsigned char *sig, 463 size_t sig_len, 464 unsigned char *bytes_out, 465 size_t len); 466 467 /** The maximum size of input message that can be formatted */ 468 #define BITCOIN_MESSAGE_MAX_LEN (64 * 1024 - 64) 469 470 /** Indicates that SHA256D(message) should be returned */ 471 #define BITCOIN_MESSAGE_FLAG_HASH 1 472 473 /** 474 * Format a message for use as a bitcoin signed message. 475 * 476 * :param bytes: The message string to sign. 477 * :param bytes_len: The length of ``bytes`` in bytes. Must be less than 478 *| or equal to BITCOIN_MESSAGE_MAX_LEN. 479 * :param flags: BITCOIN_MESSAGE_FLAG_ flags indicating the desired output. 480 *| if BITCOIN_MESSAGE_FLAG_HASH is passed, the double SHA256 hash 481 *| of the message is placed in ``bytes_out`` instead of the formatted 482 *| message. In this case ``len`` must be at least ``SHA256_LEN``. 483 * :param bytes_out: Destination for the formatted message or message hash. 484 * :param len: The length of ``bytes_out`` in bytes. 485 * :param written: Destination for the number of bytes written to ``bytes_out``. 486 */ 487 WALLY_CORE_API int wally_format_bitcoin_message( 488 const unsigned char *bytes, 489 size_t bytes_len, 490 uint32_t flags, 491 unsigned char *bytes_out, 492 size_t len, 493 size_t *written); 494 495 /** 496 * 497 * Compute an EC Diffie-Hellman secret in constant time 498 * 499 * :param pub_key: The public key. 500 * :param pub_key_len: The length of ``pub_key`` in bytes. Must be ``EC_PUBLIC_KEY_LEN``. 501 * :param priv_key: The private key. 502 * :param priv_key_len: The length of ``priv_key`` in bytes. Must be ``EC_PRIVATE_KEY_LEN``. 503 * :param bytes_out: Destination for the shared secret. 504 * :param len: The length of ``bytes_out`` in bytes. Must be ``SHA256_LEN``. 505 */ 506 WALLY_CORE_API int wally_ecdh( 507 const unsigned char *pub_key, 508 size_t pub_key_len, 509 const unsigned char *priv_key, 510 size_t priv_key_len, 511 unsigned char *bytes_out, 512 size_t len); 513 514 /** The length of a data committed using sign-to-contract (s2c) */ 515 #define WALLY_S2C_DATA_LEN 32 516 /** The length of a sign-to-contract (s2c) opening */ 517 #define WALLY_S2C_OPENING_LEN 33 518 519 /** 520 * Sign a message hash with a private key, producing a compact signature which 521 * commits to additional data using sign-to-contract (s2c). 522 * 523 * :param priv_key: The private key to sign with. 524 * :param priv_key_len: The length of ``priv_key`` in bytes. Must be ``EC_PRIVATE_KEY_LEN``. 525 * :param bytes: The message hash to sign. 526 * :param bytes_len: The length of ``bytes`` in bytes. Must be ``EC_MESSAGE_HASH_LEN``. 527 * :param s2c_data: The data to commit to. 528 * :param s2c_data_len: The length of ``s2c_data`` in bytes. Must be ``WALLY_S2C_DATA_LEN``. 529 * :param flags: Must be ``EC_FLAG_ECDSA``. 530 * :param s2c_opening_out: Destination for the resulting opening information. 531 * :param s2c_opening_out_len: The length of ``s2c_opening_out`` in bytes. Must be 532 *| ``WALLY_S2C_OPENING_LEN``. 533 * :param bytes_out: Destination for the resulting compact signature. 534 * :param len: The length of ``bytes_out`` in bytes. Must be ``EC_SIGNATURE_LEN``. 535 */ 536 WALLY_CORE_API int wally_s2c_sig_from_bytes( 537 const unsigned char *priv_key, 538 size_t priv_key_len, 539 const unsigned char *bytes, 540 size_t bytes_len, 541 const unsigned char *s2c_data, 542 size_t s2c_data_len, 543 uint32_t flags, 544 unsigned char *s2c_opening_out, 545 size_t s2c_opening_out_len, 546 unsigned char *bytes_out, 547 size_t len); 548 549 /** 550 * Verify a sign-to-contract (s2c) commitment. 551 * 552 * :param sig: The compact signature. 553 * :param sig_len: The length of ``sig`` in bytes. Must be ``EC_SIGNATURE_LEN``. 554 * :param s2c_data: The data that was committed to. 555 * :param s2c_data_len: The length of ``s2c_data`` in bytes. Must be ``WALLY_S2C_DATA_LEN``. 556 * :param s2c_opening: The opening information produced during signing. 557 * :param s2c_opening_len: The length of ``s2c_opening`` in bytes. Must be 558 *| ``WALLY_S2C_OPENING_LEN``. 559 * :param flags: Must be ``EC_FLAG_ECDSA``. 560 */ 561 WALLY_CORE_API int wally_s2c_commitment_verify( 562 const unsigned char *sig, 563 size_t sig_len, 564 const unsigned char *s2c_data, 565 size_t s2c_data_len, 566 const unsigned char *s2c_opening, 567 size_t s2c_opening_len, 568 uint32_t flags); 569 570 #ifdef __cplusplus 571 } 572 #endif 573 574 #endif /* LIBWALLY_CORE_CRYPTO_H */ 575