libsodium-wrappers 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,6 +23,9 @@ export type base64_variants = number;
23
23
 
24
24
  export const output_formats: string[];
25
25
 
26
+ export type Uint8ArrayOutputFormat = "uint8array";
27
+ export type StringOutputFormat = "text" | "hex" | "base64";
28
+
26
29
  export function from_base64(input: string, variant?: base64_variants): Uint8Array;
27
30
  export function to_base64(input: Uint8Array | string, variant?: base64_variants): string;
28
31
  export function from_hex(input: string): Uint8Array;
@@ -346,223 +349,1638 @@ export const crypto_verify_32_BYTES: number;
346
349
  export const crypto_verify_64_BYTES: number;
347
350
 
348
351
  // Crypto functions
349
- export function crypto_aead_aegis128l_decrypt(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
350
- export function crypto_aead_aegis128l_decrypt_detached(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array | string, mac: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
351
- export function crypto_aead_aegis128l_encrypt(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
352
- export function crypto_aead_aegis128l_encrypt_detached(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {ciphertext: Uint8Array | string, mac: Uint8Array | string};
353
- export function crypto_aead_aegis128l_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
354
- export function crypto_aead_aegis256_decrypt(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
355
- export function crypto_aead_aegis256_decrypt_detached(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array | string, mac: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
356
- export function crypto_aead_aegis256_encrypt(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
357
- export function crypto_aead_aegis256_encrypt_detached(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {ciphertext: Uint8Array | string, mac: Uint8Array | string};
358
- export function crypto_aead_aegis256_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
359
- export function crypto_aead_chacha20poly1305_decrypt(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
360
- export function crypto_aead_chacha20poly1305_decrypt_detached(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array | string, mac: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
361
- export function crypto_aead_chacha20poly1305_encrypt(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
362
- export function crypto_aead_chacha20poly1305_encrypt_detached(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {ciphertext: Uint8Array | string, mac: Uint8Array | string};
363
- export function crypto_aead_chacha20poly1305_ietf_decrypt(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
364
- export function crypto_aead_chacha20poly1305_ietf_decrypt_detached(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array | string, mac: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
365
- export function crypto_aead_chacha20poly1305_ietf_encrypt(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
366
- export function crypto_aead_chacha20poly1305_ietf_encrypt_detached(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {ciphertext: Uint8Array | string, mac: Uint8Array | string};
367
- export function crypto_aead_chacha20poly1305_ietf_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
368
- export function crypto_aead_chacha20poly1305_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
369
- export function crypto_aead_xchacha20poly1305_ietf_decrypt(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
370
- export function crypto_aead_xchacha20poly1305_ietf_decrypt_detached(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array | string, mac: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
371
- export function crypto_aead_xchacha20poly1305_ietf_encrypt(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
372
- export function crypto_aead_xchacha20poly1305_ietf_encrypt_detached(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {ciphertext: Uint8Array | string, mac: Uint8Array | string};
373
- export function crypto_aead_xchacha20poly1305_ietf_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
374
- export function crypto_auth(message: Uint8Array | string, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
375
- export function crypto_auth_hmacsha256(message: Uint8Array | string, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
376
- export function crypto_auth_hmacsha256_final(state_address: StateAddress, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
352
+ /**
353
+ * @param secret_nonce (CRYPTO_AEAD_AEGIS128L_NSECBYTES bytes)
354
+ * @param ciphertext
355
+ * @param additional_data
356
+ * @param public_nonce (CRYPTO_AEAD_AEGIS128L_NPUBBYTES bytes)
357
+ * @param key (CRYPTO_AEAD_AEGIS128L_KEYBYTES bytes)
358
+ * @param outputFormat Output format (default: Uint8Array)
359
+ * @returns Uint8Array | string (CRYPTO_AEAD_AEGIS128L_ABYTES bytes)
360
+ */
361
+ export function crypto_aead_aegis128l_decrypt(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
362
+ export function crypto_aead_aegis128l_decrypt(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
363
+ /**
364
+ * @param secret_nonce (CRYPTO_AEAD_AEGIS128L_NSECBYTES bytes)
365
+ * @param ciphertext
366
+ * @param mac (CRYPTO_AEAD_AEGIS128L_ABYTES bytes)
367
+ * @param additional_data
368
+ * @param public_nonce (CRYPTO_AEAD_AEGIS128L_NPUBBYTES bytes)
369
+ * @param key (CRYPTO_AEAD_AEGIS128L_KEYBYTES bytes)
370
+ * @param outputFormat Output format (default: Uint8Array)
371
+ * @returns Uint8Array | string
372
+ */
373
+ export function crypto_aead_aegis128l_decrypt_detached(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array | string, mac: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
374
+ export function crypto_aead_aegis128l_decrypt_detached(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array | string, mac: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
375
+ /**
376
+ * @param message
377
+ * @param additional_data
378
+ * @param secret_nonce (CRYPTO_AEAD_AEGIS128L_NSECBYTES bytes)
379
+ * @param public_nonce (CRYPTO_AEAD_AEGIS128L_NPUBBYTES bytes)
380
+ * @param key (CRYPTO_AEAD_AEGIS128L_KEYBYTES bytes)
381
+ * @param outputFormat Output format (default: Uint8Array)
382
+ * @returns Uint8Array | string (CRYPTO_AEAD_AEGIS128L_ABYTES bytes)
383
+ */
384
+ export function crypto_aead_aegis128l_encrypt(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
385
+ export function crypto_aead_aegis128l_encrypt(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
386
+ /**
387
+ * @param message
388
+ * @param additional_data
389
+ * @param secret_nonce (CRYPTO_AEAD_AEGIS128L_NSECBYTES bytes)
390
+ * @param public_nonce (CRYPTO_AEAD_AEGIS128L_NPUBBYTES bytes)
391
+ * @param key (CRYPTO_AEAD_AEGIS128L_KEYBYTES bytes)
392
+ * @param outputFormat Output format (default: Uint8Array)
393
+ * @returns {ciphertext, mac}
394
+ */
395
+ export function crypto_aead_aegis128l_encrypt_detached(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { ciphertext: Uint8Array; mac: Uint8Array };
396
+ export function crypto_aead_aegis128l_encrypt_detached(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): { ciphertext: string; mac: string };
397
+ /**
398
+ * @param outputFormat Output format (default: Uint8Array)
399
+ * @returns Uint8Array | string (CRYPTO_AEAD_AEGIS128L_KEYBYTES bytes)
400
+ */
401
+ export function crypto_aead_aegis128l_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
402
+ export function crypto_aead_aegis128l_keygen(outputFormat: StringOutputFormat): string;
403
+ /**
404
+ * @param secret_nonce (CRYPTO_AEAD_AEGIS256_NSECBYTES bytes)
405
+ * @param ciphertext
406
+ * @param additional_data
407
+ * @param public_nonce (CRYPTO_AEAD_AEGIS256_NPUBBYTES bytes)
408
+ * @param key (CRYPTO_AEAD_AEGIS256_KEYBYTES bytes)
409
+ * @param outputFormat Output format (default: Uint8Array)
410
+ * @returns Uint8Array | string (CRYPTO_AEAD_AEGIS256_ABYTES bytes)
411
+ */
412
+ export function crypto_aead_aegis256_decrypt(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
413
+ export function crypto_aead_aegis256_decrypt(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
414
+ /**
415
+ * @param secret_nonce (CRYPTO_AEAD_AEGIS256_NSECBYTES bytes)
416
+ * @param ciphertext
417
+ * @param mac (CRYPTO_AEAD_AEGIS256_ABYTES bytes)
418
+ * @param additional_data
419
+ * @param public_nonce (CRYPTO_AEAD_AEGIS256_NPUBBYTES bytes)
420
+ * @param key (CRYPTO_AEAD_AEGIS256_KEYBYTES bytes)
421
+ * @param outputFormat Output format (default: Uint8Array)
422
+ * @returns Uint8Array | string
423
+ */
424
+ export function crypto_aead_aegis256_decrypt_detached(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array | string, mac: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
425
+ export function crypto_aead_aegis256_decrypt_detached(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array | string, mac: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
426
+ /**
427
+ * @param message
428
+ * @param additional_data
429
+ * @param secret_nonce (CRYPTO_AEAD_AEGIS256_NSECBYTES bytes)
430
+ * @param public_nonce (CRYPTO_AEAD_AEGIS256_NPUBBYTES bytes)
431
+ * @param key (CRYPTO_AEAD_AEGIS256_KEYBYTES bytes)
432
+ * @param outputFormat Output format (default: Uint8Array)
433
+ * @returns Uint8Array | string (CRYPTO_AEAD_AEGIS256_ABYTES bytes)
434
+ */
435
+ export function crypto_aead_aegis256_encrypt(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
436
+ export function crypto_aead_aegis256_encrypt(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
437
+ /**
438
+ * @param message
439
+ * @param additional_data
440
+ * @param secret_nonce (CRYPTO_AEAD_AEGIS256_NSECBYTES bytes)
441
+ * @param public_nonce (CRYPTO_AEAD_AEGIS256_NPUBBYTES bytes)
442
+ * @param key (CRYPTO_AEAD_AEGIS256_KEYBYTES bytes)
443
+ * @param outputFormat Output format (default: Uint8Array)
444
+ * @returns {ciphertext, mac}
445
+ */
446
+ export function crypto_aead_aegis256_encrypt_detached(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { ciphertext: Uint8Array; mac: Uint8Array };
447
+ export function crypto_aead_aegis256_encrypt_detached(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): { ciphertext: string; mac: string };
448
+ /**
449
+ * @param outputFormat Output format (default: Uint8Array)
450
+ * @returns Uint8Array | string (CRYPTO_AEAD_AEGIS256_KEYBYTES bytes)
451
+ */
452
+ export function crypto_aead_aegis256_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
453
+ export function crypto_aead_aegis256_keygen(outputFormat: StringOutputFormat): string;
454
+ /**
455
+ * @param secret_nonce (CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES bytes)
456
+ * @param ciphertext
457
+ * @param additional_data
458
+ * @param public_nonce (CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES bytes)
459
+ * @param key (CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES bytes)
460
+ * @param outputFormat Output format (default: Uint8Array)
461
+ * @returns Uint8Array | string (CRYPTO_AEAD_CHACHA20POLY1305_ABYTES bytes)
462
+ */
463
+ export function crypto_aead_chacha20poly1305_decrypt(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
464
+ export function crypto_aead_chacha20poly1305_decrypt(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
465
+ /**
466
+ * @param secret_nonce (CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES bytes)
467
+ * @param ciphertext
468
+ * @param mac (CRYPTO_BOX_MACBYTES bytes)
469
+ * @param additional_data
470
+ * @param public_nonce (CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES bytes)
471
+ * @param key (CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES bytes)
472
+ * @param outputFormat Output format (default: Uint8Array)
473
+ * @returns Uint8Array | string
474
+ */
475
+ export function crypto_aead_chacha20poly1305_decrypt_detached(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array | string, mac: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
476
+ export function crypto_aead_chacha20poly1305_decrypt_detached(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array | string, mac: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
477
+ /**
478
+ * @param message
479
+ * @param additional_data
480
+ * @param secret_nonce (CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES bytes)
481
+ * @param public_nonce (CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES bytes)
482
+ * @param key (CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES bytes)
483
+ * @param outputFormat Output format (default: Uint8Array)
484
+ * @returns Uint8Array | string (CRYPTO_AEAD_CHACHA20POLY1305_ABYTES bytes)
485
+ */
486
+ export function crypto_aead_chacha20poly1305_encrypt(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
487
+ export function crypto_aead_chacha20poly1305_encrypt(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
488
+ /**
489
+ * @param message
490
+ * @param additional_data
491
+ * @param secret_nonce (CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES bytes)
492
+ * @param public_nonce (CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES bytes)
493
+ * @param key (CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES bytes)
494
+ * @param outputFormat Output format (default: Uint8Array)
495
+ * @returns {ciphertext, mac}
496
+ */
497
+ export function crypto_aead_chacha20poly1305_encrypt_detached(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { ciphertext: Uint8Array; mac: Uint8Array };
498
+ export function crypto_aead_chacha20poly1305_encrypt_detached(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): { ciphertext: string; mac: string };
499
+ /**
500
+ * @param secret_nonce (CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES bytes)
501
+ * @param ciphertext
502
+ * @param additional_data
503
+ * @param public_nonce (CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES bytes)
504
+ * @param key (CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES bytes)
505
+ * @param outputFormat Output format (default: Uint8Array)
506
+ * @returns Uint8Array | string (CRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES bytes)
507
+ */
508
+ export function crypto_aead_chacha20poly1305_ietf_decrypt(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
509
+ export function crypto_aead_chacha20poly1305_ietf_decrypt(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
510
+ /**
511
+ * @param secret_nonce (CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES bytes)
512
+ * @param ciphertext
513
+ * @param mac (CRYPTO_BOX_MACBYTES bytes)
514
+ * @param additional_data
515
+ * @param public_nonce (CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES bytes)
516
+ * @param key (CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES bytes)
517
+ * @param outputFormat Output format (default: Uint8Array)
518
+ * @returns Uint8Array | string
519
+ */
520
+ export function crypto_aead_chacha20poly1305_ietf_decrypt_detached(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array | string, mac: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
521
+ export function crypto_aead_chacha20poly1305_ietf_decrypt_detached(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array | string, mac: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
522
+ /**
523
+ * @param message
524
+ * @param additional_data
525
+ * @param secret_nonce (CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES bytes)
526
+ * @param public_nonce (CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES bytes)
527
+ * @param key (CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES bytes)
528
+ * @param outputFormat Output format (default: Uint8Array)
529
+ * @returns Uint8Array | string (CRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES bytes)
530
+ */
531
+ export function crypto_aead_chacha20poly1305_ietf_encrypt(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
532
+ export function crypto_aead_chacha20poly1305_ietf_encrypt(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
533
+ /**
534
+ * @param message
535
+ * @param additional_data
536
+ * @param secret_nonce (CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES bytes)
537
+ * @param public_nonce (CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES bytes)
538
+ * @param key (CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES bytes)
539
+ * @param outputFormat Output format (default: Uint8Array)
540
+ * @returns {ciphertext, mac}
541
+ */
542
+ export function crypto_aead_chacha20poly1305_ietf_encrypt_detached(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { ciphertext: Uint8Array; mac: Uint8Array };
543
+ export function crypto_aead_chacha20poly1305_ietf_encrypt_detached(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): { ciphertext: string; mac: string };
544
+ /**
545
+ * @param outputFormat Output format (default: Uint8Array)
546
+ * @returns Uint8Array | string (CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES bytes)
547
+ */
548
+ export function crypto_aead_chacha20poly1305_ietf_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
549
+ export function crypto_aead_chacha20poly1305_ietf_keygen(outputFormat: StringOutputFormat): string;
550
+ /**
551
+ * @param outputFormat Output format (default: Uint8Array)
552
+ * @returns Uint8Array | string (CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES bytes)
553
+ */
554
+ export function crypto_aead_chacha20poly1305_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
555
+ export function crypto_aead_chacha20poly1305_keygen(outputFormat: StringOutputFormat): string;
556
+ /**
557
+ * @param secret_nonce (CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NSECBYTES bytes)
558
+ * @param ciphertext
559
+ * @param additional_data
560
+ * @param public_nonce (CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES bytes)
561
+ * @param key (CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES bytes)
562
+ * @param outputFormat Output format (default: Uint8Array)
563
+ * @returns Uint8Array | string (CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES bytes)
564
+ */
565
+ export function crypto_aead_xchacha20poly1305_ietf_decrypt(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
566
+ export function crypto_aead_xchacha20poly1305_ietf_decrypt(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
567
+ /**
568
+ * @param secret_nonce (CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NSECBYTES bytes)
569
+ * @param ciphertext
570
+ * @param mac (CRYPTO_BOX_MACBYTES bytes)
571
+ * @param additional_data
572
+ * @param public_nonce (CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES bytes)
573
+ * @param key (CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES bytes)
574
+ * @param outputFormat Output format (default: Uint8Array)
575
+ * @returns Uint8Array | string
576
+ */
577
+ export function crypto_aead_xchacha20poly1305_ietf_decrypt_detached(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array | string, mac: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
578
+ export function crypto_aead_xchacha20poly1305_ietf_decrypt_detached(secret_nonce: Uint8Array | string | null, ciphertext: Uint8Array | string, mac: Uint8Array, additional_data: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
579
+ /**
580
+ * @param message
581
+ * @param additional_data
582
+ * @param secret_nonce (CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NSECBYTES bytes)
583
+ * @param public_nonce (CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES bytes)
584
+ * @param key (CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES bytes)
585
+ * @param outputFormat Output format (default: Uint8Array)
586
+ * @returns Uint8Array | string (CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES bytes)
587
+ */
588
+ export function crypto_aead_xchacha20poly1305_ietf_encrypt(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
589
+ export function crypto_aead_xchacha20poly1305_ietf_encrypt(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
590
+ /**
591
+ * @param message
592
+ * @param additional_data
593
+ * @param secret_nonce (CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NSECBYTES bytes)
594
+ * @param public_nonce (CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES bytes)
595
+ * @param key (CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES bytes)
596
+ * @param outputFormat Output format (default: Uint8Array)
597
+ * @returns {ciphertext, mac}
598
+ */
599
+ export function crypto_aead_xchacha20poly1305_ietf_encrypt_detached(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { ciphertext: Uint8Array; mac: Uint8Array };
600
+ export function crypto_aead_xchacha20poly1305_ietf_encrypt_detached(message: Uint8Array | string, additional_data: Uint8Array | string | null, secret_nonce: Uint8Array | string | null, public_nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): { ciphertext: string; mac: string };
601
+ /**
602
+ * @param outputFormat Output format (default: Uint8Array)
603
+ * @returns Uint8Array | string (CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES bytes)
604
+ */
605
+ export function crypto_aead_xchacha20poly1305_ietf_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
606
+ export function crypto_aead_xchacha20poly1305_ietf_keygen(outputFormat: StringOutputFormat): string;
607
+ /**
608
+ * @param message
609
+ * @param key (CRYPTO_AUTH_KEYBYTES bytes)
610
+ * @param outputFormat Output format (default: Uint8Array)
611
+ * @returns Uint8Array | string (CRYPTO_AUTH_BYTES bytes)
612
+ */
613
+ export function crypto_auth(message: Uint8Array | string, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
614
+ export function crypto_auth(message: Uint8Array | string, key: Uint8Array, outputFormat: StringOutputFormat): string;
615
+ /**
616
+ * @param message
617
+ * @param key (CRYPTO_AUTH_HMACSHA256_KEYBYTES bytes)
618
+ * @param outputFormat Output format (default: Uint8Array)
619
+ * @returns Uint8Array | string (CRYPTO_AUTH_HMACSHA256_BYTES bytes)
620
+ */
621
+ export function crypto_auth_hmacsha256(message: Uint8Array | string, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
622
+ export function crypto_auth_hmacsha256(message: Uint8Array | string, key: Uint8Array, outputFormat: StringOutputFormat): string;
623
+ /**
624
+ * @param state_address
625
+ * @param outputFormat Output format (default: Uint8Array)
626
+ * @returns Uint8Array | string (CRYPTO_AUTH_HMACSHA256_BYTES bytes)
627
+ */
628
+ export function crypto_auth_hmacsha256_final(state_address: StateAddress, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
629
+ export function crypto_auth_hmacsha256_final(state_address: StateAddress, outputFormat: StringOutputFormat): string;
630
+ /**
631
+ * @param key
632
+ * @returns StateAddress
633
+ */
377
634
  export function crypto_auth_hmacsha256_init(key: Uint8Array | string | null): StateAddress;
378
- export function crypto_auth_hmacsha256_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
635
+ /**
636
+ * @param outputFormat Output format (default: Uint8Array)
637
+ * @returns Uint8Array | string (CRYPTO_AUTH_HMACSHA256_KEYBYTES bytes)
638
+ */
639
+ export function crypto_auth_hmacsha256_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
640
+ export function crypto_auth_hmacsha256_keygen(outputFormat: StringOutputFormat): string;
641
+ /**
642
+ * @param state_address
643
+ * @param message_chunk
644
+ */
379
645
  export function crypto_auth_hmacsha256_update(state_address: StateAddress, message_chunk: Uint8Array | string): void;
646
+ /**
647
+ * @param tag (CRYPTO_AUTH_HMACSHA256_BYTES bytes)
648
+ * @param message
649
+ * @param key (CRYPTO_AUTH_HMACSHA256_KEYBYTES bytes)
650
+ * @returns boolean
651
+ */
380
652
  export function crypto_auth_hmacsha256_verify(tag: Uint8Array, message: Uint8Array | string, key: Uint8Array): boolean;
381
- export function crypto_auth_hmacsha512(message: Uint8Array | string, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
382
- export function crypto_auth_hmacsha512256(message: Uint8Array | string, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
383
- export function crypto_auth_hmacsha512256_final(state_address: StateAddress, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
653
+ /**
654
+ * @param message
655
+ * @param key (CRYPTO_AUTH_HMACSHA512_KEYBYTES bytes)
656
+ * @param outputFormat Output format (default: Uint8Array)
657
+ * @returns Uint8Array | string (CRYPTO_AUTH_HMACSHA512_BYTES bytes)
658
+ */
659
+ export function crypto_auth_hmacsha512(message: Uint8Array | string, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
660
+ export function crypto_auth_hmacsha512(message: Uint8Array | string, key: Uint8Array, outputFormat: StringOutputFormat): string;
661
+ /**
662
+ * @param message
663
+ * @param key (CRYPTO_AUTH_HMACSHA512256_KEYBYTES bytes)
664
+ * @param outputFormat Output format (default: Uint8Array)
665
+ * @returns Uint8Array | string (CRYPTO_AUTH_HMACSHA512256_BYTES bytes)
666
+ */
667
+ export function crypto_auth_hmacsha512256(message: Uint8Array | string, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
668
+ export function crypto_auth_hmacsha512256(message: Uint8Array | string, key: Uint8Array, outputFormat: StringOutputFormat): string;
669
+ /**
670
+ * @param state_address
671
+ * @param outputFormat Output format (default: Uint8Array)
672
+ * @returns Uint8Array | string (CRYPTO_AUTH_HMACSHA512256_BYTES bytes)
673
+ */
674
+ export function crypto_auth_hmacsha512256_final(state_address: StateAddress, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
675
+ export function crypto_auth_hmacsha512256_final(state_address: StateAddress, outputFormat: StringOutputFormat): string;
676
+ /**
677
+ * @param key
678
+ * @returns StateAddress
679
+ */
384
680
  export function crypto_auth_hmacsha512256_init(key: Uint8Array | string | null): StateAddress;
385
- export function crypto_auth_hmacsha512256_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
681
+ /**
682
+ * @param outputFormat Output format (default: Uint8Array)
683
+ * @returns Uint8Array | string (CRYPTO_AUTH_HMACSHA512256_KEYBYTES bytes)
684
+ */
685
+ export function crypto_auth_hmacsha512256_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
686
+ export function crypto_auth_hmacsha512256_keygen(outputFormat: StringOutputFormat): string;
687
+ /**
688
+ * @param state_address
689
+ * @param message_chunk
690
+ */
386
691
  export function crypto_auth_hmacsha512256_update(state_address: StateAddress, message_chunk: Uint8Array | string): void;
692
+ /**
693
+ * @param tag (CRYPTO_AUTH_HMACSHA512256_BYTES bytes)
694
+ * @param message
695
+ * @param key (CRYPTO_AUTH_HMACSHA512256_KEYBYTES bytes)
696
+ * @returns boolean
697
+ */
387
698
  export function crypto_auth_hmacsha512256_verify(tag: Uint8Array, message: Uint8Array | string, key: Uint8Array): boolean;
388
- export function crypto_auth_hmacsha512_final(state_address: StateAddress, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
699
+ /**
700
+ * @param state_address
701
+ * @param outputFormat Output format (default: Uint8Array)
702
+ * @returns Uint8Array | string (CRYPTO_AUTH_HMACSHA512_BYTES bytes)
703
+ */
704
+ export function crypto_auth_hmacsha512_final(state_address: StateAddress, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
705
+ export function crypto_auth_hmacsha512_final(state_address: StateAddress, outputFormat: StringOutputFormat): string;
706
+ /**
707
+ * @param key
708
+ * @returns StateAddress
709
+ */
389
710
  export function crypto_auth_hmacsha512_init(key: Uint8Array | string | null): StateAddress;
390
- export function crypto_auth_hmacsha512_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
711
+ /**
712
+ * @param outputFormat Output format (default: Uint8Array)
713
+ * @returns Uint8Array | string (CRYPTO_AUTH_HMACSHA512_KEYBYTES bytes)
714
+ */
715
+ export function crypto_auth_hmacsha512_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
716
+ export function crypto_auth_hmacsha512_keygen(outputFormat: StringOutputFormat): string;
717
+ /**
718
+ * @param state_address
719
+ * @param message_chunk
720
+ */
391
721
  export function crypto_auth_hmacsha512_update(state_address: StateAddress, message_chunk: Uint8Array | string): void;
722
+ /**
723
+ * @param tag (CRYPTO_AUTH_HMACSHA512_BYTES bytes)
724
+ * @param message
725
+ * @param key (CRYPTO_AUTH_HMACSHA512_KEYBYTES bytes)
726
+ * @returns boolean
727
+ */
392
728
  export function crypto_auth_hmacsha512_verify(tag: Uint8Array, message: Uint8Array | string, key: Uint8Array): boolean;
393
- export function crypto_auth_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
729
+ /**
730
+ * @param outputFormat Output format (default: Uint8Array)
731
+ * @returns Uint8Array | string (CRYPTO_AUTH_KEYBYTES bytes)
732
+ */
733
+ export function crypto_auth_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
734
+ export function crypto_auth_keygen(outputFormat: StringOutputFormat): string;
735
+ /**
736
+ * @param tag (CRYPTO_AUTH_BYTES bytes)
737
+ * @param message
738
+ * @param key (CRYPTO_AUTH_KEYBYTES bytes)
739
+ * @returns boolean
740
+ */
394
741
  export function crypto_auth_verify(tag: Uint8Array, message: Uint8Array | string, key: Uint8Array): boolean;
395
- export function crypto_box_beforenm(publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
396
- export function crypto_box_curve25519xchacha20poly1305_beforenm(publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
397
- export function crypto_box_curve25519xchacha20poly1305_detached(message: Uint8Array | string, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {ciphertext: Uint8Array | string, mac: Uint8Array | string};
398
- export function crypto_box_curve25519xchacha20poly1305_detached_afternm(message: Uint8Array | string, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {ciphertext: Uint8Array | string, mac: Uint8Array | string};
399
- export function crypto_box_curve25519xchacha20poly1305_easy(message: Uint8Array | string, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
400
- export function crypto_box_curve25519xchacha20poly1305_easy_afternm(message: Uint8Array | string, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
401
- export function crypto_box_curve25519xchacha20poly1305_keypair(outputFormat?: "uint8array" | "text" | "hex" | "base64"): {publicKey: Uint8Array | string, privateKey: Uint8Array | string, keyType: string};
402
- export function crypto_box_curve25519xchacha20poly1305_open_detached(ciphertext: Uint8Array | string, mac: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
403
- export function crypto_box_curve25519xchacha20poly1305_open_detached_afternm(ciphertext: Uint8Array | string, mac: Uint8Array, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
404
- export function crypto_box_curve25519xchacha20poly1305_open_easy(ciphertext: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
405
- export function crypto_box_curve25519xchacha20poly1305_open_easy_afternm(ciphertext: Uint8Array | string, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
406
- export function crypto_box_curve25519xchacha20poly1305_seal(message: Uint8Array | string, publicKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
407
- export function crypto_box_curve25519xchacha20poly1305_seal_open(ciphertext: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
408
- export function crypto_box_curve25519xchacha20poly1305_seed_keypair(seed: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {publicKey: Uint8Array | string, privateKey: Uint8Array | string, keyType: string};
409
- export function crypto_box_detached(message: Uint8Array | string, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {ciphertext: Uint8Array | string, mac: Uint8Array | string};
410
- export function crypto_box_easy(message: Uint8Array | string, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
411
- export function crypto_box_easy_afternm(message: Uint8Array | string, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
412
- export function crypto_box_keypair(outputFormat?: "uint8array" | "text" | "hex" | "base64"): {publicKey: Uint8Array | string, privateKey: Uint8Array | string, keyType: string};
413
- export function crypto_box_open_detached(ciphertext: Uint8Array | string, mac: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
414
- export function crypto_box_open_easy(ciphertext: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
415
- export function crypto_box_open_easy_afternm(ciphertext: Uint8Array | string, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
416
- export function crypto_box_seal(message: Uint8Array | string, publicKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
417
- export function crypto_box_seal_open(ciphertext: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
418
- export function crypto_box_seed_keypair(seed: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {publicKey: Uint8Array | string, privateKey: Uint8Array | string, keyType: string};
419
- export function crypto_core_ed25519_add(p: Uint8Array, q: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
420
- export function crypto_core_ed25519_from_hash(r: Uint8Array | string, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
421
- export function crypto_core_ed25519_from_uniform(r: Uint8Array | string, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
742
+ /**
743
+ * @param publicKey (CRYPTO_BOX_PUBLICKEYBYTES bytes)
744
+ * @param privateKey (CRYPTO_BOX_SECRETKEYBYTES bytes)
745
+ * @param outputFormat Output format (default: Uint8Array)
746
+ * @returns Uint8Array | string (CRYPTO_BOX_BEFORENMBYTES bytes)
747
+ */
748
+ export function crypto_box_beforenm(publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
749
+ export function crypto_box_beforenm(publicKey: Uint8Array, privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
750
+ /**
751
+ * @param publicKey (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_PUBLICKEYBYTES bytes)
752
+ * @param privateKey (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_SECRETKEYBYTES bytes)
753
+ * @param outputFormat Output format (default: Uint8Array)
754
+ * @returns Uint8Array | string (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_BEFORENMBYTES bytes)
755
+ */
756
+ export function crypto_box_curve25519xchacha20poly1305_beforenm(publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
757
+ export function crypto_box_curve25519xchacha20poly1305_beforenm(publicKey: Uint8Array, privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
758
+ /**
759
+ * @param message
760
+ * @param nonce (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_NONCEBYTES bytes)
761
+ * @param publicKey (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_PUBLICKEYBYTES bytes)
762
+ * @param privateKey (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_SECRETKEYBYTES bytes)
763
+ * @param outputFormat Output format (default: Uint8Array)
764
+ * @returns {ciphertext, mac}
765
+ */
766
+ export function crypto_box_curve25519xchacha20poly1305_detached(message: Uint8Array | string, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { ciphertext: Uint8Array; mac: Uint8Array };
767
+ export function crypto_box_curve25519xchacha20poly1305_detached(message: Uint8Array | string, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat: StringOutputFormat): { ciphertext: string; mac: string };
768
+ /**
769
+ * @param message
770
+ * @param nonce (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_NONCEBYTES bytes)
771
+ * @param sharedKey (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_BEFORENMBYTES bytes)
772
+ * @param outputFormat Output format (default: Uint8Array)
773
+ * @returns {ciphertext, mac}
774
+ */
775
+ export function crypto_box_curve25519xchacha20poly1305_detached_afternm(message: Uint8Array | string, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { ciphertext: Uint8Array; mac: Uint8Array };
776
+ export function crypto_box_curve25519xchacha20poly1305_detached_afternm(message: Uint8Array | string, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat: StringOutputFormat): { ciphertext: string; mac: string };
777
+ /**
778
+ * @param message
779
+ * @param nonce (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_NONCEBYTES bytes)
780
+ * @param publicKey (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_PUBLICKEYBYTES bytes)
781
+ * @param privateKey (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_SECRETKEYBYTES bytes)
782
+ * @param outputFormat Output format (default: Uint8Array)
783
+ * @returns Uint8Array | string (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_MACBYTES bytes)
784
+ */
785
+ export function crypto_box_curve25519xchacha20poly1305_easy(message: Uint8Array | string, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
786
+ export function crypto_box_curve25519xchacha20poly1305_easy(message: Uint8Array | string, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
787
+ /**
788
+ * @param message
789
+ * @param nonce (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_NONCEBYTES bytes)
790
+ * @param sharedKey (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_BEFORENMBYTES bytes)
791
+ * @param outputFormat Output format (default: Uint8Array)
792
+ * @returns Uint8Array | string (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_MACBYTES bytes)
793
+ */
794
+ export function crypto_box_curve25519xchacha20poly1305_easy_afternm(message: Uint8Array | string, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
795
+ export function crypto_box_curve25519xchacha20poly1305_easy_afternm(message: Uint8Array | string, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat: StringOutputFormat): string;
796
+ /**
797
+ * @param outputFormat Output format (default: Uint8Array)
798
+ * @returns {publicKey, privateKey, keyType} (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_PUBLICKEYBYTES bytes)
799
+ */
800
+ export function crypto_box_curve25519xchacha20poly1305_keypair(outputFormat?: Uint8ArrayOutputFormat | null): { publicKey: Uint8Array; privateKey: Uint8Array; keyType: string };
801
+ export function crypto_box_curve25519xchacha20poly1305_keypair(outputFormat: StringOutputFormat): { publicKey: string; privateKey: string; keyType: string };
802
+ /**
803
+ * @param ciphertext
804
+ * @param mac (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_MACBYTES bytes)
805
+ * @param nonce (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_NONCEBYTES bytes)
806
+ * @param publicKey (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_PUBLICKEYBYTES bytes)
807
+ * @param privateKey (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_SECRETKEYBYTES bytes)
808
+ * @param outputFormat Output format (default: Uint8Array)
809
+ * @returns Uint8Array | string
810
+ */
811
+ export function crypto_box_curve25519xchacha20poly1305_open_detached(ciphertext: Uint8Array | string, mac: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
812
+ export function crypto_box_curve25519xchacha20poly1305_open_detached(ciphertext: Uint8Array | string, mac: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
813
+ /**
814
+ * @param ciphertext
815
+ * @param mac (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_MACBYTES bytes)
816
+ * @param nonce (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_NONCEBYTES bytes)
817
+ * @param sharedKey (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_BEFORENMBYTES bytes)
818
+ * @param outputFormat Output format (default: Uint8Array)
819
+ * @returns Uint8Array | string
820
+ */
821
+ export function crypto_box_curve25519xchacha20poly1305_open_detached_afternm(ciphertext: Uint8Array | string, mac: Uint8Array, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
822
+ export function crypto_box_curve25519xchacha20poly1305_open_detached_afternm(ciphertext: Uint8Array | string, mac: Uint8Array, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat: StringOutputFormat): string;
823
+ /**
824
+ * @param ciphertext
825
+ * @param nonce (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_NONCEBYTES bytes)
826
+ * @param publicKey (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_PUBLICKEYBYTES bytes)
827
+ * @param privateKey (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_SECRETKEYBYTES bytes)
828
+ * @param outputFormat Output format (default: Uint8Array)
829
+ * @returns Uint8Array | string (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_MACBYTES bytes)
830
+ */
831
+ export function crypto_box_curve25519xchacha20poly1305_open_easy(ciphertext: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
832
+ export function crypto_box_curve25519xchacha20poly1305_open_easy(ciphertext: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
833
+ /**
834
+ * @param ciphertext (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_MACBYTES bytes)
835
+ * @param nonce (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_NONCEBYTES bytes)
836
+ * @param sharedKey (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_BEFORENMBYTES bytes)
837
+ * @param outputFormat Output format (default: Uint8Array)
838
+ * @returns Uint8Array | string (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_MACBYTES bytes)
839
+ */
840
+ export function crypto_box_curve25519xchacha20poly1305_open_easy_afternm(ciphertext: Uint8Array | string, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
841
+ export function crypto_box_curve25519xchacha20poly1305_open_easy_afternm(ciphertext: Uint8Array | string, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat: StringOutputFormat): string;
842
+ /**
843
+ * @param message
844
+ * @param publicKey (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_PUBLICKEYBYTES bytes)
845
+ * @param outputFormat Output format (default: Uint8Array)
846
+ * @returns Uint8Array | string (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_SEALBYTES bytes)
847
+ */
848
+ export function crypto_box_curve25519xchacha20poly1305_seal(message: Uint8Array | string, publicKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
849
+ export function crypto_box_curve25519xchacha20poly1305_seal(message: Uint8Array | string, publicKey: Uint8Array, outputFormat: StringOutputFormat): string;
850
+ /**
851
+ * @param ciphertext
852
+ * @param publicKey (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_PUBLICKEYBYTES bytes)
853
+ * @param secretKey (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_SECRETKEYBYTES bytes)
854
+ * @param outputFormat Output format (default: Uint8Array)
855
+ * @returns Uint8Array | string (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_SEALBYTES bytes)
856
+ */
857
+ export function crypto_box_curve25519xchacha20poly1305_seal_open(ciphertext: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
858
+ export function crypto_box_curve25519xchacha20poly1305_seal_open(ciphertext: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array, outputFormat: StringOutputFormat): string;
859
+ /**
860
+ * @param seed (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_SEEDBYTES bytes)
861
+ * @param outputFormat Output format (default: Uint8Array)
862
+ * @returns {publicKey, privateKey, keyType} (CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_PUBLICKEYBYTES bytes)
863
+ */
864
+ export function crypto_box_curve25519xchacha20poly1305_seed_keypair(seed: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { publicKey: Uint8Array; privateKey: Uint8Array; keyType: string };
865
+ export function crypto_box_curve25519xchacha20poly1305_seed_keypair(seed: Uint8Array, outputFormat: StringOutputFormat): { publicKey: string; privateKey: string; keyType: string };
866
+ /**
867
+ * @param message
868
+ * @param nonce (CRYPTO_BOX_NONCEBYTES bytes)
869
+ * @param publicKey (CRYPTO_BOX_PUBLICKEYBYTES bytes)
870
+ * @param privateKey (CRYPTO_BOX_SECRETKEYBYTES bytes)
871
+ * @param outputFormat Output format (default: Uint8Array)
872
+ * @returns {ciphertext, mac}
873
+ */
874
+ export function crypto_box_detached(message: Uint8Array | string, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { ciphertext: Uint8Array; mac: Uint8Array };
875
+ export function crypto_box_detached(message: Uint8Array | string, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat: StringOutputFormat): { ciphertext: string; mac: string };
876
+ /**
877
+ * @param message
878
+ * @param nonce (CRYPTO_BOX_NONCEBYTES bytes)
879
+ * @param publicKey (CRYPTO_BOX_PUBLICKEYBYTES bytes)
880
+ * @param privateKey (CRYPTO_BOX_SECRETKEYBYTES bytes)
881
+ * @param outputFormat Output format (default: Uint8Array)
882
+ * @returns Uint8Array | string (CRYPTO_BOX_MACBYTES bytes)
883
+ */
884
+ export function crypto_box_easy(message: Uint8Array | string, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
885
+ export function crypto_box_easy(message: Uint8Array | string, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
886
+ /**
887
+ * @param message
888
+ * @param nonce (CRYPTO_BOX_NONCEBYTES bytes)
889
+ * @param sharedKey (CRYPTO_BOX_BEFORENMBYTES bytes)
890
+ * @param outputFormat Output format (default: Uint8Array)
891
+ * @returns Uint8Array | string (CRYPTO_BOX_MACBYTES bytes)
892
+ */
893
+ export function crypto_box_easy_afternm(message: Uint8Array | string, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
894
+ export function crypto_box_easy_afternm(message: Uint8Array | string, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat: StringOutputFormat): string;
895
+ /**
896
+ * @param outputFormat Output format (default: Uint8Array)
897
+ * @returns {publicKey, privateKey, keyType} (CRYPTO_BOX_PUBLICKEYBYTES bytes)
898
+ */
899
+ export function crypto_box_keypair(outputFormat?: Uint8ArrayOutputFormat | null): { publicKey: Uint8Array; privateKey: Uint8Array; keyType: string };
900
+ export function crypto_box_keypair(outputFormat: StringOutputFormat): { publicKey: string; privateKey: string; keyType: string };
901
+ /**
902
+ * @param ciphertext
903
+ * @param mac (CRYPTO_BOX_MACBYTES bytes)
904
+ * @param nonce (CRYPTO_BOX_NONCEBYTES bytes)
905
+ * @param publicKey (CRYPTO_BOX_PUBLICKEYBYTES bytes)
906
+ * @param privateKey (CRYPTO_BOX_SECRETKEYBYTES bytes)
907
+ * @param outputFormat Output format (default: Uint8Array)
908
+ * @returns Uint8Array | string
909
+ */
910
+ export function crypto_box_open_detached(ciphertext: Uint8Array | string, mac: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
911
+ export function crypto_box_open_detached(ciphertext: Uint8Array | string, mac: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
912
+ /**
913
+ * @param ciphertext
914
+ * @param nonce (CRYPTO_BOX_NONCEBYTES bytes)
915
+ * @param publicKey (CRYPTO_BOX_PUBLICKEYBYTES bytes)
916
+ * @param privateKey (CRYPTO_BOX_SECRETKEYBYTES bytes)
917
+ * @param outputFormat Output format (default: Uint8Array)
918
+ * @returns Uint8Array | string (CRYPTO_BOX_MACBYTES bytes)
919
+ */
920
+ export function crypto_box_open_easy(ciphertext: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
921
+ export function crypto_box_open_easy(ciphertext: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
922
+ /**
923
+ * @param ciphertext (CRYPTO_BOX_MACBYTES bytes)
924
+ * @param nonce (CRYPTO_BOX_NONCEBYTES bytes)
925
+ * @param sharedKey (CRYPTO_BOX_BEFORENMBYTES bytes)
926
+ * @param outputFormat Output format (default: Uint8Array)
927
+ * @returns Uint8Array | string (CRYPTO_BOX_MACBYTES bytes)
928
+ */
929
+ export function crypto_box_open_easy_afternm(ciphertext: Uint8Array | string, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
930
+ export function crypto_box_open_easy_afternm(ciphertext: Uint8Array | string, nonce: Uint8Array, sharedKey: Uint8Array, outputFormat: StringOutputFormat): string;
931
+ /**
932
+ * @param message
933
+ * @param publicKey (CRYPTO_BOX_PUBLICKEYBYTES bytes)
934
+ * @param outputFormat Output format (default: Uint8Array)
935
+ * @returns Uint8Array | string (CRYPTO_BOX_SEALBYTES bytes)
936
+ */
937
+ export function crypto_box_seal(message: Uint8Array | string, publicKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
938
+ export function crypto_box_seal(message: Uint8Array | string, publicKey: Uint8Array, outputFormat: StringOutputFormat): string;
939
+ /**
940
+ * @param ciphertext
941
+ * @param publicKey (CRYPTO_BOX_PUBLICKEYBYTES bytes)
942
+ * @param privateKey (CRYPTO_BOX_SECRETKEYBYTES bytes)
943
+ * @param outputFormat Output format (default: Uint8Array)
944
+ * @returns Uint8Array | string (CRYPTO_BOX_SEALBYTES bytes)
945
+ */
946
+ export function crypto_box_seal_open(ciphertext: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
947
+ export function crypto_box_seal_open(ciphertext: Uint8Array, publicKey: Uint8Array, privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
948
+ /**
949
+ * @param seed (CRYPTO_BOX_SEEDBYTES bytes)
950
+ * @param outputFormat Output format (default: Uint8Array)
951
+ * @returns {publicKey, privateKey, keyType} (CRYPTO_BOX_PUBLICKEYBYTES bytes)
952
+ */
953
+ export function crypto_box_seed_keypair(seed: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { publicKey: Uint8Array; privateKey: Uint8Array; keyType: string };
954
+ export function crypto_box_seed_keypair(seed: Uint8Array, outputFormat: StringOutputFormat): { publicKey: string; privateKey: string; keyType: string };
955
+ /**
956
+ * @param p (CRYPTO_CORE_ED25519_BYTES bytes)
957
+ * @param q (CRYPTO_CORE_ED25519_BYTES bytes)
958
+ * @param outputFormat Output format (default: Uint8Array)
959
+ * @returns Uint8Array | string (CRYPTO_CORE_ED25519_BYTES bytes)
960
+ */
961
+ export function crypto_core_ed25519_add(p: Uint8Array, q: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
962
+ export function crypto_core_ed25519_add(p: Uint8Array, q: Uint8Array, outputFormat: StringOutputFormat): string;
963
+ /**
964
+ * @param r
965
+ * @param outputFormat Output format (default: Uint8Array)
966
+ * @returns Uint8Array | string (CRYPTO_CORE_ED25519_BYTES bytes)
967
+ */
968
+ export function crypto_core_ed25519_from_hash(r: Uint8Array | string, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
969
+ export function crypto_core_ed25519_from_hash(r: Uint8Array | string, outputFormat: StringOutputFormat): string;
970
+ /**
971
+ * @param r
972
+ * @param outputFormat Output format (default: Uint8Array)
973
+ * @returns Uint8Array | string (CRYPTO_CORE_ED25519_BYTES bytes)
974
+ */
975
+ export function crypto_core_ed25519_from_uniform(r: Uint8Array | string, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
976
+ export function crypto_core_ed25519_from_uniform(r: Uint8Array | string, outputFormat: StringOutputFormat): string;
977
+ /**
978
+ * @param repr (CRYPTO_CORE_ED25519_BYTES bytes)
979
+ * @returns boolean
980
+ */
422
981
  export function crypto_core_ed25519_is_valid_point(repr: Uint8Array): boolean;
423
- export function crypto_core_ed25519_random(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
424
- export function crypto_core_ed25519_scalar_add(x: Uint8Array, y: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
425
- export function crypto_core_ed25519_scalar_complement(s: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
426
- export function crypto_core_ed25519_scalar_invert(s: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
427
- export function crypto_core_ed25519_scalar_mul(x: Uint8Array, y: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
428
- export function crypto_core_ed25519_scalar_negate(s: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
429
- export function crypto_core_ed25519_scalar_random(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
430
- export function crypto_core_ed25519_scalar_reduce(sample: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
431
- export function crypto_core_ed25519_scalar_sub(x: Uint8Array, y: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
432
- export function crypto_core_ed25519_sub(p: Uint8Array, q: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
433
- export function crypto_core_hchacha20(input: Uint8Array, privateKey: Uint8Array, constant: Uint8Array | string | null, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
434
- export function crypto_core_hsalsa20(input: Uint8Array, privateKey: Uint8Array, constant: Uint8Array | string | null, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
435
- export function crypto_core_ristretto255_add(p: Uint8Array, q: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
436
- export function crypto_core_ristretto255_from_hash(r: Uint8Array | string, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
982
+ /**
983
+ * @param outputFormat Output format (default: Uint8Array)
984
+ * @returns Uint8Array | string (CRYPTO_CORE_ED25519_BYTES bytes)
985
+ */
986
+ export function crypto_core_ed25519_random(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
987
+ export function crypto_core_ed25519_random(outputFormat: StringOutputFormat): string;
988
+ /**
989
+ * @param x (CRYPTO_CORE_ED25519_SCALARBYTES bytes)
990
+ * @param y (CRYPTO_CORE_ED25519_SCALARBYTES bytes)
991
+ * @param outputFormat Output format (default: Uint8Array)
992
+ * @returns Uint8Array | string (CRYPTO_CORE_ED25519_SCALARBYTES bytes)
993
+ */
994
+ export function crypto_core_ed25519_scalar_add(x: Uint8Array, y: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
995
+ export function crypto_core_ed25519_scalar_add(x: Uint8Array, y: Uint8Array, outputFormat: StringOutputFormat): string;
996
+ /**
997
+ * @param s (CRYPTO_CORE_ED25519_SCALARBYTES bytes)
998
+ * @param outputFormat Output format (default: Uint8Array)
999
+ * @returns Uint8Array | string (CRYPTO_CORE_ED25519_SCALARBYTES bytes)
1000
+ */
1001
+ export function crypto_core_ed25519_scalar_complement(s: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1002
+ export function crypto_core_ed25519_scalar_complement(s: Uint8Array, outputFormat: StringOutputFormat): string;
1003
+ /**
1004
+ * @param s (CRYPTO_CORE_ED25519_SCALARBYTES bytes)
1005
+ * @param outputFormat Output format (default: Uint8Array)
1006
+ * @returns Uint8Array | string (CRYPTO_CORE_ED25519_SCALARBYTES bytes)
1007
+ */
1008
+ export function crypto_core_ed25519_scalar_invert(s: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1009
+ export function crypto_core_ed25519_scalar_invert(s: Uint8Array, outputFormat: StringOutputFormat): string;
1010
+ /**
1011
+ * @param x (CRYPTO_CORE_ED25519_SCALARBYTES bytes)
1012
+ * @param y (CRYPTO_CORE_ED25519_SCALARBYTES bytes)
1013
+ * @param outputFormat Output format (default: Uint8Array)
1014
+ * @returns Uint8Array | string (CRYPTO_CORE_ED25519_SCALARBYTES bytes)
1015
+ */
1016
+ export function crypto_core_ed25519_scalar_mul(x: Uint8Array, y: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1017
+ export function crypto_core_ed25519_scalar_mul(x: Uint8Array, y: Uint8Array, outputFormat: StringOutputFormat): string;
1018
+ /**
1019
+ * @param s (CRYPTO_CORE_ED25519_SCALARBYTES bytes)
1020
+ * @param outputFormat Output format (default: Uint8Array)
1021
+ * @returns Uint8Array | string (CRYPTO_CORE_ED25519_SCALARBYTES bytes)
1022
+ */
1023
+ export function crypto_core_ed25519_scalar_negate(s: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1024
+ export function crypto_core_ed25519_scalar_negate(s: Uint8Array, outputFormat: StringOutputFormat): string;
1025
+ /**
1026
+ * @param outputFormat Output format (default: Uint8Array)
1027
+ * @returns Uint8Array | string (CRYPTO_CORE_ED25519_SCALARBYTES bytes)
1028
+ */
1029
+ export function crypto_core_ed25519_scalar_random(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1030
+ export function crypto_core_ed25519_scalar_random(outputFormat: StringOutputFormat): string;
1031
+ /**
1032
+ * @param sample (CRYPTO_CORE_ED25519_NONREDUCEDSCALARBYTES bytes)
1033
+ * @param outputFormat Output format (default: Uint8Array)
1034
+ * @returns Uint8Array | string (CRYPTO_CORE_ED25519_SCALARBYTES bytes)
1035
+ */
1036
+ export function crypto_core_ed25519_scalar_reduce(sample: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1037
+ export function crypto_core_ed25519_scalar_reduce(sample: Uint8Array, outputFormat: StringOutputFormat): string;
1038
+ /**
1039
+ * @param x (CRYPTO_CORE_ED25519_SCALARBYTES bytes)
1040
+ * @param y (CRYPTO_CORE_ED25519_SCALARBYTES bytes)
1041
+ * @param outputFormat Output format (default: Uint8Array)
1042
+ * @returns Uint8Array | string (CRYPTO_CORE_ED25519_SCALARBYTES bytes)
1043
+ */
1044
+ export function crypto_core_ed25519_scalar_sub(x: Uint8Array, y: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1045
+ export function crypto_core_ed25519_scalar_sub(x: Uint8Array, y: Uint8Array, outputFormat: StringOutputFormat): string;
1046
+ /**
1047
+ * @param p (CRYPTO_CORE_ED25519_BYTES bytes)
1048
+ * @param q (CRYPTO_CORE_ED25519_BYTES bytes)
1049
+ * @param outputFormat Output format (default: Uint8Array)
1050
+ * @returns Uint8Array | string (CRYPTO_CORE_ED25519_BYTES bytes)
1051
+ */
1052
+ export function crypto_core_ed25519_sub(p: Uint8Array, q: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1053
+ export function crypto_core_ed25519_sub(p: Uint8Array, q: Uint8Array, outputFormat: StringOutputFormat): string;
1054
+ /**
1055
+ * @param input (CRYPTO_CORE_HCHACHA20_INPUTBYTES bytes)
1056
+ * @param privateKey (CRYPTO_CORE_HCHACHA20_KEYBYTES bytes)
1057
+ * @param constant (CRYPTO_CORE_HCHACHA20_CONSTBYTES bytes)
1058
+ * @param outputFormat Output format (default: Uint8Array)
1059
+ * @returns Uint8Array | string (CRYPTO_CORE_HCHACHA20_OUTPUTBYTES bytes)
1060
+ */
1061
+ export function crypto_core_hchacha20(input: Uint8Array, privateKey: Uint8Array, constant: Uint8Array | string | null, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1062
+ export function crypto_core_hchacha20(input: Uint8Array, privateKey: Uint8Array, constant: Uint8Array | string | null, outputFormat: StringOutputFormat): string;
1063
+ /**
1064
+ * @param input (CRYPTO_CORE_HSALSA20_INPUTBYTES bytes)
1065
+ * @param privateKey (CRYPTO_CORE_HSALSA20_KEYBYTES bytes)
1066
+ * @param constant (CRYPTO_CORE_HSALSA20_CONSTBYTES bytes)
1067
+ * @param outputFormat Output format (default: Uint8Array)
1068
+ * @returns Uint8Array | string (CRYPTO_CORE_HSALSA20_OUTPUTBYTES bytes)
1069
+ */
1070
+ export function crypto_core_hsalsa20(input: Uint8Array, privateKey: Uint8Array, constant: Uint8Array | string | null, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1071
+ export function crypto_core_hsalsa20(input: Uint8Array, privateKey: Uint8Array, constant: Uint8Array | string | null, outputFormat: StringOutputFormat): string;
1072
+ /**
1073
+ * @param p (CRYPTO_CORE_RISTRETTO255_BYTES bytes)
1074
+ * @param q (CRYPTO_CORE_RISTRETTO255_BYTES bytes)
1075
+ * @param outputFormat Output format (default: Uint8Array)
1076
+ * @returns Uint8Array | string (CRYPTO_CORE_RISTRETTO255_BYTES bytes)
1077
+ */
1078
+ export function crypto_core_ristretto255_add(p: Uint8Array, q: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1079
+ export function crypto_core_ristretto255_add(p: Uint8Array, q: Uint8Array, outputFormat: StringOutputFormat): string;
1080
+ /**
1081
+ * @param r
1082
+ * @param outputFormat Output format (default: Uint8Array)
1083
+ * @returns Uint8Array | string (CRYPTO_CORE_RISTRETTO255_BYTES bytes)
1084
+ */
1085
+ export function crypto_core_ristretto255_from_hash(r: Uint8Array | string, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1086
+ export function crypto_core_ristretto255_from_hash(r: Uint8Array | string, outputFormat: StringOutputFormat): string;
1087
+ /**
1088
+ * @param repr (CRYPTO_CORE_RISTRETTO255_BYTES bytes)
1089
+ * @returns boolean
1090
+ */
437
1091
  export function crypto_core_ristretto255_is_valid_point(repr: Uint8Array): boolean;
438
- export function crypto_core_ristretto255_random(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
439
- export function crypto_core_ristretto255_scalar_add(x: Uint8Array, y: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
440
- export function crypto_core_ristretto255_scalar_complement(s: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
441
- export function crypto_core_ristretto255_scalar_invert(s: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
442
- export function crypto_core_ristretto255_scalar_mul(x: Uint8Array, y: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
443
- export function crypto_core_ristretto255_scalar_negate(s: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
444
- export function crypto_core_ristretto255_scalar_random(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
445
- export function crypto_core_ristretto255_scalar_reduce(sample: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
446
- export function crypto_core_ristretto255_scalar_sub(x: Uint8Array, y: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
447
- export function crypto_core_ristretto255_sub(p: Uint8Array, q: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
448
- export function crypto_generichash(hash_length: number, message: Uint8Array | string, key: Uint8Array | string | null, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
449
- export function crypto_generichash_blake2b_salt_personal(subkey_len: number, key: Uint8Array | string | null, id: Uint8Array | null, ctx: Uint8Array | null, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
450
- export function crypto_generichash_final(state_address: StateAddress, hash_length: number, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1092
+ /**
1093
+ * @param outputFormat Output format (default: Uint8Array)
1094
+ * @returns Uint8Array | string (CRYPTO_CORE_RISTRETTO255_BYTES bytes)
1095
+ */
1096
+ export function crypto_core_ristretto255_random(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1097
+ export function crypto_core_ristretto255_random(outputFormat: StringOutputFormat): string;
1098
+ /**
1099
+ * @param x (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1100
+ * @param y (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1101
+ * @param outputFormat Output format (default: Uint8Array)
1102
+ * @returns Uint8Array | string (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1103
+ */
1104
+ export function crypto_core_ristretto255_scalar_add(x: Uint8Array, y: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1105
+ export function crypto_core_ristretto255_scalar_add(x: Uint8Array, y: Uint8Array, outputFormat: StringOutputFormat): string;
1106
+ /**
1107
+ * @param s (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1108
+ * @param outputFormat Output format (default: Uint8Array)
1109
+ * @returns Uint8Array | string (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1110
+ */
1111
+ export function crypto_core_ristretto255_scalar_complement(s: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1112
+ export function crypto_core_ristretto255_scalar_complement(s: Uint8Array, outputFormat: StringOutputFormat): string;
1113
+ /**
1114
+ * @param s (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1115
+ * @param outputFormat Output format (default: Uint8Array)
1116
+ * @returns Uint8Array | string (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1117
+ */
1118
+ export function crypto_core_ristretto255_scalar_invert(s: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1119
+ export function crypto_core_ristretto255_scalar_invert(s: Uint8Array, outputFormat: StringOutputFormat): string;
1120
+ /**
1121
+ * @param x (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1122
+ * @param y (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1123
+ * @param outputFormat Output format (default: Uint8Array)
1124
+ * @returns Uint8Array | string (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1125
+ */
1126
+ export function crypto_core_ristretto255_scalar_mul(x: Uint8Array, y: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1127
+ export function crypto_core_ristretto255_scalar_mul(x: Uint8Array, y: Uint8Array, outputFormat: StringOutputFormat): string;
1128
+ /**
1129
+ * @param s (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1130
+ * @param outputFormat Output format (default: Uint8Array)
1131
+ * @returns Uint8Array | string (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1132
+ */
1133
+ export function crypto_core_ristretto255_scalar_negate(s: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1134
+ export function crypto_core_ristretto255_scalar_negate(s: Uint8Array, outputFormat: StringOutputFormat): string;
1135
+ /**
1136
+ * @param outputFormat Output format (default: Uint8Array)
1137
+ * @returns Uint8Array | string (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1138
+ */
1139
+ export function crypto_core_ristretto255_scalar_random(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1140
+ export function crypto_core_ristretto255_scalar_random(outputFormat: StringOutputFormat): string;
1141
+ /**
1142
+ * @param sample (CRYPTO_CORE_RISTRETTO255_NONREDUCEDSCALARBYTES bytes)
1143
+ * @param outputFormat Output format (default: Uint8Array)
1144
+ * @returns Uint8Array | string (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1145
+ */
1146
+ export function crypto_core_ristretto255_scalar_reduce(sample: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1147
+ export function crypto_core_ristretto255_scalar_reduce(sample: Uint8Array, outputFormat: StringOutputFormat): string;
1148
+ /**
1149
+ * @param x (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1150
+ * @param y (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1151
+ * @param outputFormat Output format (default: Uint8Array)
1152
+ * @returns Uint8Array | string (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1153
+ */
1154
+ export function crypto_core_ristretto255_scalar_sub(x: Uint8Array, y: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1155
+ export function crypto_core_ristretto255_scalar_sub(x: Uint8Array, y: Uint8Array, outputFormat: StringOutputFormat): string;
1156
+ /**
1157
+ * @param p (CRYPTO_CORE_RISTRETTO255_BYTES bytes)
1158
+ * @param q (CRYPTO_CORE_RISTRETTO255_BYTES bytes)
1159
+ * @param outputFormat Output format (default: Uint8Array)
1160
+ * @returns Uint8Array | string (CRYPTO_CORE_RISTRETTO255_BYTES bytes)
1161
+ */
1162
+ export function crypto_core_ristretto255_sub(p: Uint8Array, q: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1163
+ export function crypto_core_ristretto255_sub(p: Uint8Array, q: Uint8Array, outputFormat: StringOutputFormat): string;
1164
+ /**
1165
+ * @param hash_length
1166
+ * @param message
1167
+ * @param key
1168
+ * @param outputFormat Output format (default: Uint8Array)
1169
+ * @returns Uint8Array | string
1170
+ */
1171
+ export function crypto_generichash(hash_length: number, message: Uint8Array | string, key: Uint8Array | string | null, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1172
+ export function crypto_generichash(hash_length: number, message: Uint8Array | string, key: Uint8Array | string | null, outputFormat: StringOutputFormat): string;
1173
+ /**
1174
+ * @param subkey_len
1175
+ * @param key
1176
+ * @param id (CRYPTO_GENERICHASH_BLAKE2B_SALTBYTES bytes)
1177
+ * @param ctx (CRYPTO_GENERICHASH_BLAKE2B_PERSONALBYTES bytes)
1178
+ * @param outputFormat Output format (default: Uint8Array)
1179
+ * @returns Uint8Array | string
1180
+ */
1181
+ export function crypto_generichash_blake2b_salt_personal(subkey_len: number, key: Uint8Array | string | null, id: Uint8Array | null, ctx: Uint8Array | null, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1182
+ export function crypto_generichash_blake2b_salt_personal(subkey_len: number, key: Uint8Array | string | null, id: Uint8Array | null, ctx: Uint8Array | null, outputFormat: StringOutputFormat): string;
1183
+ /**
1184
+ * @param state_address
1185
+ * @param hash_length
1186
+ * @param outputFormat Output format (default: Uint8Array)
1187
+ * @returns Uint8Array | string
1188
+ */
1189
+ export function crypto_generichash_final(state_address: StateAddress, hash_length: number, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1190
+ export function crypto_generichash_final(state_address: StateAddress, hash_length: number, outputFormat: StringOutputFormat): string;
1191
+ /**
1192
+ * @param key
1193
+ * @param hash_length
1194
+ * @returns StateAddress
1195
+ */
451
1196
  export function crypto_generichash_init(key: Uint8Array | string | null, hash_length: number): StateAddress;
452
- export function crypto_generichash_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1197
+ /**
1198
+ * @param outputFormat Output format (default: Uint8Array)
1199
+ * @returns Uint8Array | string (CRYPTO_GENERICHASH_KEYBYTES bytes)
1200
+ */
1201
+ export function crypto_generichash_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1202
+ export function crypto_generichash_keygen(outputFormat: StringOutputFormat): string;
1203
+ /**
1204
+ * @param state_address
1205
+ * @param message_chunk
1206
+ */
453
1207
  export function crypto_generichash_update(state_address: StateAddress, message_chunk: Uint8Array | string): void;
454
- export function crypto_hash(message: Uint8Array | string, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
455
- export function crypto_hash_sha256(message: Uint8Array | string, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
456
- export function crypto_hash_sha256_final(state_address: StateAddress, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1208
+ /**
1209
+ * @param message
1210
+ * @param outputFormat Output format (default: Uint8Array)
1211
+ * @returns Uint8Array | string (CRYPTO_HASH_BYTES bytes)
1212
+ */
1213
+ export function crypto_hash(message: Uint8Array | string, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1214
+ export function crypto_hash(message: Uint8Array | string, outputFormat: StringOutputFormat): string;
1215
+ /**
1216
+ * @param message
1217
+ * @param outputFormat Output format (default: Uint8Array)
1218
+ * @returns Uint8Array | string (CRYPTO_HASH_SHA256_BYTES bytes)
1219
+ */
1220
+ export function crypto_hash_sha256(message: Uint8Array | string, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1221
+ export function crypto_hash_sha256(message: Uint8Array | string, outputFormat: StringOutputFormat): string;
1222
+ /**
1223
+ * @param state_address
1224
+ * @param outputFormat Output format (default: Uint8Array)
1225
+ * @returns Uint8Array | string (CRYPTO_HASH_SHA256_BYTES bytes)
1226
+ */
1227
+ export function crypto_hash_sha256_final(state_address: StateAddress, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1228
+ export function crypto_hash_sha256_final(state_address: StateAddress, outputFormat: StringOutputFormat): string;
1229
+ /**
1230
+ * @returns StateAddress
1231
+ */
457
1232
  export function crypto_hash_sha256_init(): StateAddress;
1233
+ /**
1234
+ * @param state_address
1235
+ * @param message_chunk
1236
+ */
458
1237
  export function crypto_hash_sha256_update(state_address: StateAddress, message_chunk: Uint8Array | string): void;
459
- export function crypto_hash_sha512(message: Uint8Array | string, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
460
- export function crypto_hash_sha512_final(state_address: StateAddress, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1238
+ /**
1239
+ * @param message
1240
+ * @param outputFormat Output format (default: Uint8Array)
1241
+ * @returns Uint8Array | string (CRYPTO_HASH_SHA512_BYTES bytes)
1242
+ */
1243
+ export function crypto_hash_sha512(message: Uint8Array | string, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1244
+ export function crypto_hash_sha512(message: Uint8Array | string, outputFormat: StringOutputFormat): string;
1245
+ /**
1246
+ * @param state_address
1247
+ * @param outputFormat Output format (default: Uint8Array)
1248
+ * @returns Uint8Array | string (CRYPTO_HASH_SHA512_BYTES bytes)
1249
+ */
1250
+ export function crypto_hash_sha512_final(state_address: StateAddress, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1251
+ export function crypto_hash_sha512_final(state_address: StateAddress, outputFormat: StringOutputFormat): string;
1252
+ /**
1253
+ * @returns StateAddress
1254
+ */
461
1255
  export function crypto_hash_sha512_init(): StateAddress;
1256
+ /**
1257
+ * @param state_address
1258
+ * @param message_chunk
1259
+ */
462
1260
  export function crypto_hash_sha512_update(state_address: StateAddress, message_chunk: Uint8Array | string): void;
463
- export function crypto_ipcrypt_decrypt(input: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
464
- export function crypto_ipcrypt_encrypt(input: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
465
- export function crypto_ipcrypt_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
466
- export function crypto_ipcrypt_nd_decrypt(input: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
467
- export function crypto_ipcrypt_nd_encrypt(input: Uint8Array, tweak: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
468
- export function crypto_ipcrypt_nd_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
469
- export function crypto_ipcrypt_ndx_decrypt(input: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
470
- export function crypto_ipcrypt_ndx_encrypt(input: Uint8Array, tweak: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
471
- export function crypto_ipcrypt_ndx_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
472
- export function crypto_ipcrypt_pfx_decrypt(input: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
473
- export function crypto_ipcrypt_pfx_encrypt(input: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
474
- export function crypto_ipcrypt_pfx_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
475
- export function crypto_kdf_derive_from_key(subkey_len: number, subkey_id: number | bigint, ctx: string, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
476
- export function crypto_kdf_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
477
- export function crypto_kx_client_session_keys(clientPublicKey: Uint8Array, clientSecretKey: Uint8Array, serverPublicKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {sharedRx: Uint8Array | string, sharedTx: Uint8Array | string};
478
- export function crypto_kx_keypair(outputFormat?: "uint8array" | "text" | "hex" | "base64"): {publicKey: Uint8Array | string, privateKey: Uint8Array | string, keyType: string};
479
- export function crypto_kx_seed_keypair(seed: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {publicKey: Uint8Array | string, privateKey: Uint8Array | string, keyType: string};
480
- export function crypto_kx_server_session_keys(serverPublicKey: Uint8Array, serverSecretKey: Uint8Array, clientPublicKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {sharedRx: Uint8Array | string, sharedTx: Uint8Array | string};
481
- export function crypto_onetimeauth(message: Uint8Array | string, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
482
- export function crypto_onetimeauth_final(state_address: StateAddress, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1261
+ /**
1262
+ * @param input (CRYPTO_IPCRYPT_BYTES bytes)
1263
+ * @param key (CRYPTO_IPCRYPT_KEYBYTES bytes)
1264
+ * @param outputFormat Output format (default: Uint8Array)
1265
+ * @returns Uint8Array | string (CRYPTO_IPCRYPT_BYTES bytes)
1266
+ */
1267
+ export function crypto_ipcrypt_decrypt(input: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1268
+ export function crypto_ipcrypt_decrypt(input: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1269
+ /**
1270
+ * @param input (CRYPTO_IPCRYPT_BYTES bytes)
1271
+ * @param key (CRYPTO_IPCRYPT_KEYBYTES bytes)
1272
+ * @param outputFormat Output format (default: Uint8Array)
1273
+ * @returns Uint8Array | string (CRYPTO_IPCRYPT_BYTES bytes)
1274
+ */
1275
+ export function crypto_ipcrypt_encrypt(input: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1276
+ export function crypto_ipcrypt_encrypt(input: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1277
+ /**
1278
+ * @param outputFormat Output format (default: Uint8Array)
1279
+ * @returns Uint8Array | string (CRYPTO_IPCRYPT_KEYBYTES bytes)
1280
+ */
1281
+ export function crypto_ipcrypt_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1282
+ export function crypto_ipcrypt_keygen(outputFormat: StringOutputFormat): string;
1283
+ /**
1284
+ * @param input (CRYPTO_IPCRYPT_ND_OUTPUTBYTES bytes)
1285
+ * @param key (CRYPTO_IPCRYPT_ND_KEYBYTES bytes)
1286
+ * @param outputFormat Output format (default: Uint8Array)
1287
+ * @returns Uint8Array | string (CRYPTO_IPCRYPT_ND_INPUTBYTES bytes)
1288
+ */
1289
+ export function crypto_ipcrypt_nd_decrypt(input: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1290
+ export function crypto_ipcrypt_nd_decrypt(input: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1291
+ /**
1292
+ * @param input (CRYPTO_IPCRYPT_ND_INPUTBYTES bytes)
1293
+ * @param tweak (CRYPTO_IPCRYPT_ND_TWEAKBYTES bytes)
1294
+ * @param key (CRYPTO_IPCRYPT_ND_KEYBYTES bytes)
1295
+ * @param outputFormat Output format (default: Uint8Array)
1296
+ * @returns Uint8Array | string (CRYPTO_IPCRYPT_ND_OUTPUTBYTES bytes)
1297
+ */
1298
+ export function crypto_ipcrypt_nd_encrypt(input: Uint8Array, tweak: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1299
+ export function crypto_ipcrypt_nd_encrypt(input: Uint8Array, tweak: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1300
+ /**
1301
+ * @param outputFormat Output format (default: Uint8Array)
1302
+ * @returns Uint8Array | string (CRYPTO_IPCRYPT_ND_KEYBYTES bytes)
1303
+ */
1304
+ export function crypto_ipcrypt_nd_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1305
+ export function crypto_ipcrypt_nd_keygen(outputFormat: StringOutputFormat): string;
1306
+ /**
1307
+ * @param input (CRYPTO_IPCRYPT_NDX_OUTPUTBYTES bytes)
1308
+ * @param key (CRYPTO_IPCRYPT_NDX_KEYBYTES bytes)
1309
+ * @param outputFormat Output format (default: Uint8Array)
1310
+ * @returns Uint8Array | string (CRYPTO_IPCRYPT_NDX_INPUTBYTES bytes)
1311
+ */
1312
+ export function crypto_ipcrypt_ndx_decrypt(input: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1313
+ export function crypto_ipcrypt_ndx_decrypt(input: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1314
+ /**
1315
+ * @param input (CRYPTO_IPCRYPT_NDX_INPUTBYTES bytes)
1316
+ * @param tweak (CRYPTO_IPCRYPT_NDX_TWEAKBYTES bytes)
1317
+ * @param key (CRYPTO_IPCRYPT_NDX_KEYBYTES bytes)
1318
+ * @param outputFormat Output format (default: Uint8Array)
1319
+ * @returns Uint8Array | string (CRYPTO_IPCRYPT_NDX_OUTPUTBYTES bytes)
1320
+ */
1321
+ export function crypto_ipcrypt_ndx_encrypt(input: Uint8Array, tweak: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1322
+ export function crypto_ipcrypt_ndx_encrypt(input: Uint8Array, tweak: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1323
+ /**
1324
+ * @param outputFormat Output format (default: Uint8Array)
1325
+ * @returns Uint8Array | string (CRYPTO_IPCRYPT_NDX_KEYBYTES bytes)
1326
+ */
1327
+ export function crypto_ipcrypt_ndx_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1328
+ export function crypto_ipcrypt_ndx_keygen(outputFormat: StringOutputFormat): string;
1329
+ /**
1330
+ * @param input (CRYPTO_IPCRYPT_PFX_BYTES bytes)
1331
+ * @param key (CRYPTO_IPCRYPT_PFX_KEYBYTES bytes)
1332
+ * @param outputFormat Output format (default: Uint8Array)
1333
+ * @returns Uint8Array | string (CRYPTO_IPCRYPT_PFX_BYTES bytes)
1334
+ */
1335
+ export function crypto_ipcrypt_pfx_decrypt(input: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1336
+ export function crypto_ipcrypt_pfx_decrypt(input: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1337
+ /**
1338
+ * @param input (CRYPTO_IPCRYPT_PFX_BYTES bytes)
1339
+ * @param key (CRYPTO_IPCRYPT_PFX_KEYBYTES bytes)
1340
+ * @param outputFormat Output format (default: Uint8Array)
1341
+ * @returns Uint8Array | string (CRYPTO_IPCRYPT_PFX_BYTES bytes)
1342
+ */
1343
+ export function crypto_ipcrypt_pfx_encrypt(input: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1344
+ export function crypto_ipcrypt_pfx_encrypt(input: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1345
+ /**
1346
+ * @param outputFormat Output format (default: Uint8Array)
1347
+ * @returns Uint8Array | string (CRYPTO_IPCRYPT_PFX_KEYBYTES bytes)
1348
+ */
1349
+ export function crypto_ipcrypt_pfx_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1350
+ export function crypto_ipcrypt_pfx_keygen(outputFormat: StringOutputFormat): string;
1351
+ /**
1352
+ * @param subkey_len
1353
+ * @param subkey_id
1354
+ * @param ctx (CRYPTO_KDF_CONTEXTBYTES bytes)
1355
+ * @param key (CRYPTO_KDF_KEYBYTES bytes)
1356
+ * @param outputFormat Output format (default: Uint8Array)
1357
+ * @returns Uint8Array | string
1358
+ */
1359
+ export function crypto_kdf_derive_from_key(subkey_len: number, subkey_id: number | bigint, ctx: string, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1360
+ export function crypto_kdf_derive_from_key(subkey_len: number, subkey_id: number | bigint, ctx: string, key: Uint8Array, outputFormat: StringOutputFormat): string;
1361
+ /**
1362
+ * @param outputFormat Output format (default: Uint8Array)
1363
+ * @returns Uint8Array | string (CRYPTO_KDF_KEYBYTES bytes)
1364
+ */
1365
+ export function crypto_kdf_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1366
+ export function crypto_kdf_keygen(outputFormat: StringOutputFormat): string;
1367
+ /**
1368
+ * @param clientPublicKey (CRYPTO_KX_PUBLICKEYBYTES bytes)
1369
+ * @param clientSecretKey (CRYPTO_KX_SECRETKEYBYTES bytes)
1370
+ * @param serverPublicKey (CRYPTO_KX_PUBLICKEYBYTES bytes)
1371
+ * @param outputFormat Output format (default: Uint8Array)
1372
+ * @returns {sharedRx, sharedTx} (CRYPTO_KX_SESSIONKEYBYTES bytes)
1373
+ */
1374
+ export function crypto_kx_client_session_keys(clientPublicKey: Uint8Array, clientSecretKey: Uint8Array, serverPublicKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { sharedRx: Uint8Array; sharedTx: Uint8Array };
1375
+ export function crypto_kx_client_session_keys(clientPublicKey: Uint8Array, clientSecretKey: Uint8Array, serverPublicKey: Uint8Array, outputFormat: StringOutputFormat): { sharedRx: string; sharedTx: string };
1376
+ /**
1377
+ * @param outputFormat Output format (default: Uint8Array)
1378
+ * @returns {publicKey, privateKey, keyType} (CRYPTO_KX_PUBLICKEYBYTES bytes)
1379
+ */
1380
+ export function crypto_kx_keypair(outputFormat?: Uint8ArrayOutputFormat | null): { publicKey: Uint8Array; privateKey: Uint8Array; keyType: string };
1381
+ export function crypto_kx_keypair(outputFormat: StringOutputFormat): { publicKey: string; privateKey: string; keyType: string };
1382
+ /**
1383
+ * @param seed (CRYPTO_KX_SEEDBYTES bytes)
1384
+ * @param outputFormat Output format (default: Uint8Array)
1385
+ * @returns {publicKey, privateKey, keyType} (CRYPTO_KX_PUBLICKEYBYTES bytes)
1386
+ */
1387
+ export function crypto_kx_seed_keypair(seed: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { publicKey: Uint8Array; privateKey: Uint8Array; keyType: string };
1388
+ export function crypto_kx_seed_keypair(seed: Uint8Array, outputFormat: StringOutputFormat): { publicKey: string; privateKey: string; keyType: string };
1389
+ /**
1390
+ * @param serverPublicKey (CRYPTO_KX_PUBLICKEYBYTES bytes)
1391
+ * @param serverSecretKey (CRYPTO_KX_SECRETKEYBYTES bytes)
1392
+ * @param clientPublicKey (CRYPTO_KX_PUBLICKEYBYTES bytes)
1393
+ * @param outputFormat Output format (default: Uint8Array)
1394
+ * @returns {sharedRx, sharedTx} (CRYPTO_KX_SESSIONKEYBYTES bytes)
1395
+ */
1396
+ export function crypto_kx_server_session_keys(serverPublicKey: Uint8Array, serverSecretKey: Uint8Array, clientPublicKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { sharedRx: Uint8Array; sharedTx: Uint8Array };
1397
+ export function crypto_kx_server_session_keys(serverPublicKey: Uint8Array, serverSecretKey: Uint8Array, clientPublicKey: Uint8Array, outputFormat: StringOutputFormat): { sharedRx: string; sharedTx: string };
1398
+ /**
1399
+ * @param message
1400
+ * @param key (CRYPTO_ONETIMEAUTH_KEYBYTES bytes)
1401
+ * @param outputFormat Output format (default: Uint8Array)
1402
+ * @returns Uint8Array | string (CRYPTO_ONETIMEAUTH_BYTES bytes)
1403
+ */
1404
+ export function crypto_onetimeauth(message: Uint8Array | string, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1405
+ export function crypto_onetimeauth(message: Uint8Array | string, key: Uint8Array, outputFormat: StringOutputFormat): string;
1406
+ /**
1407
+ * @param state_address
1408
+ * @param outputFormat Output format (default: Uint8Array)
1409
+ * @returns Uint8Array | string (CRYPTO_ONETIMEAUTH_BYTES bytes)
1410
+ */
1411
+ export function crypto_onetimeauth_final(state_address: StateAddress, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1412
+ export function crypto_onetimeauth_final(state_address: StateAddress, outputFormat: StringOutputFormat): string;
1413
+ /**
1414
+ * @param key
1415
+ * @returns StateAddress
1416
+ */
483
1417
  export function crypto_onetimeauth_init(key: Uint8Array | string | null): StateAddress;
484
- export function crypto_onetimeauth_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1418
+ /**
1419
+ * @param outputFormat Output format (default: Uint8Array)
1420
+ * @returns Uint8Array | string (CRYPTO_ONETIMEAUTH_KEYBYTES bytes)
1421
+ */
1422
+ export function crypto_onetimeauth_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1423
+ export function crypto_onetimeauth_keygen(outputFormat: StringOutputFormat): string;
1424
+ /**
1425
+ * @param state_address
1426
+ * @param message_chunk
1427
+ */
485
1428
  export function crypto_onetimeauth_update(state_address: StateAddress, message_chunk: Uint8Array | string): void;
1429
+ /**
1430
+ * @param hash (CRYPTO_ONETIMEAUTH_BYTES bytes)
1431
+ * @param message
1432
+ * @param key (CRYPTO_ONETIMEAUTH_KEYBYTES bytes)
1433
+ * @returns boolean
1434
+ */
486
1435
  export function crypto_onetimeauth_verify(hash: Uint8Array, message: Uint8Array | string, key: Uint8Array): boolean;
487
- export function crypto_pwhash(keyLength: number, password: Uint8Array | string, salt: Uint8Array, opsLimit: number, memLimit: number, algorithm: number, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1436
+ /**
1437
+ * @param keyLength
1438
+ * @param password
1439
+ * @param salt (CRYPTO_PWHASH_SALTBYTES bytes)
1440
+ * @param opsLimit
1441
+ * @param memLimit
1442
+ * @param algorithm
1443
+ * @param outputFormat Output format (default: Uint8Array)
1444
+ * @returns Uint8Array | string
1445
+ */
1446
+ export function crypto_pwhash(keyLength: number, password: Uint8Array | string, salt: Uint8Array, opsLimit: number, memLimit: number, algorithm: number, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1447
+ export function crypto_pwhash(keyLength: number, password: Uint8Array | string, salt: Uint8Array, opsLimit: number, memLimit: number, algorithm: number, outputFormat: StringOutputFormat): string;
1448
+ /**
1449
+ * @param password
1450
+ * @param opsLimit
1451
+ * @param memLimit
1452
+ * @returns Uint8Array (CRYPTO_PWHASH_STRBYTES bytes)
1453
+ */
488
1454
  export function crypto_pwhash_str(password: Uint8Array | string, opsLimit: number, memLimit: number): Uint8Array;
1455
+ /**
1456
+ * @param hashed_password
1457
+ * @param opsLimit
1458
+ * @param memLimit
1459
+ * @returns boolean
1460
+ */
489
1461
  export function crypto_pwhash_str_needs_rehash(hashed_password: string, opsLimit: number, memLimit: number): boolean;
1462
+ /**
1463
+ * @param hashed_password
1464
+ * @param password
1465
+ * @returns boolean
1466
+ */
490
1467
  export function crypto_pwhash_str_verify(hashed_password: string, password: Uint8Array | string): boolean;
491
- export function crypto_scalarmult(privateKey: Uint8Array, publicKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
492
- export function crypto_scalarmult_base(privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
493
- export function crypto_scalarmult_ed25519(n: Uint8Array, p: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
494
- export function crypto_scalarmult_ed25519_base(scalar: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
495
- export function crypto_scalarmult_ed25519_base_noclamp(scalar: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
496
- export function crypto_scalarmult_ed25519_noclamp(n: Uint8Array, p: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
497
- export function crypto_scalarmult_ristretto255(scalar: Uint8Array, element: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
498
- export function crypto_scalarmult_ristretto255_base(scalar: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
499
- export function crypto_secretbox_detached(message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {mac: Uint8Array | string, cipher: Uint8Array | string};
500
- export function crypto_secretbox_easy(message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
501
- export function crypto_secretbox_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
502
- export function crypto_secretbox_open_detached(ciphertext: Uint8Array | string, mac: Uint8Array, nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
503
- export function crypto_secretbox_open_easy(ciphertext: Uint8Array, nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1468
+ /**
1469
+ * @param privateKey (CRYPTO_SCALARMULT_SCALARBYTES bytes)
1470
+ * @param publicKey (CRYPTO_SCALARMULT_BYTES bytes)
1471
+ * @param outputFormat Output format (default: Uint8Array)
1472
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_BYTES bytes)
1473
+ */
1474
+ export function crypto_scalarmult(privateKey: Uint8Array, publicKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1475
+ export function crypto_scalarmult(privateKey: Uint8Array, publicKey: Uint8Array, outputFormat: StringOutputFormat): string;
1476
+ /**
1477
+ * @param privateKey (CRYPTO_SCALARMULT_SCALARBYTES bytes)
1478
+ * @param outputFormat Output format (default: Uint8Array)
1479
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_BYTES bytes)
1480
+ */
1481
+ export function crypto_scalarmult_base(privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1482
+ export function crypto_scalarmult_base(privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
1483
+ /**
1484
+ * @param n (CRYPTO_SCALARMULT_ED25519_SCALARBYTES bytes)
1485
+ * @param p (CRYPTO_SCALARMULT_ED25519_BYTES bytes)
1486
+ * @param outputFormat Output format (default: Uint8Array)
1487
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_ED25519_BYTES bytes)
1488
+ */
1489
+ export function crypto_scalarmult_ed25519(n: Uint8Array, p: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1490
+ export function crypto_scalarmult_ed25519(n: Uint8Array, p: Uint8Array, outputFormat: StringOutputFormat): string;
1491
+ /**
1492
+ * @param scalar (CRYPTO_SCALARMULT_ED25519_SCALARBYTES bytes)
1493
+ * @param outputFormat Output format (default: Uint8Array)
1494
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_ED25519_BYTES bytes)
1495
+ */
1496
+ export function crypto_scalarmult_ed25519_base(scalar: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1497
+ export function crypto_scalarmult_ed25519_base(scalar: Uint8Array, outputFormat: StringOutputFormat): string;
1498
+ /**
1499
+ * @param scalar (CRYPTO_SCALARMULT_ED25519_SCALARBYTES bytes)
1500
+ * @param outputFormat Output format (default: Uint8Array)
1501
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_ED25519_BYTES bytes)
1502
+ */
1503
+ export function crypto_scalarmult_ed25519_base_noclamp(scalar: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1504
+ export function crypto_scalarmult_ed25519_base_noclamp(scalar: Uint8Array, outputFormat: StringOutputFormat): string;
1505
+ /**
1506
+ * @param n (CRYPTO_SCALARMULT_ED25519_SCALARBYTES bytes)
1507
+ * @param p (CRYPTO_SCALARMULT_ED25519_BYTES bytes)
1508
+ * @param outputFormat Output format (default: Uint8Array)
1509
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_ED25519_BYTES bytes)
1510
+ */
1511
+ export function crypto_scalarmult_ed25519_noclamp(n: Uint8Array, p: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1512
+ export function crypto_scalarmult_ed25519_noclamp(n: Uint8Array, p: Uint8Array, outputFormat: StringOutputFormat): string;
1513
+ /**
1514
+ * @param scalar (CRYPTO_SCALARMULT_RISTRETTO255_SCALARBYTES bytes)
1515
+ * @param element (CRYPTO_SCALARMULT_RISTRETTO255_BYTES bytes)
1516
+ * @param outputFormat Output format (default: Uint8Array)
1517
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_RISTRETTO255_BYTES bytes)
1518
+ */
1519
+ export function crypto_scalarmult_ristretto255(scalar: Uint8Array, element: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1520
+ export function crypto_scalarmult_ristretto255(scalar: Uint8Array, element: Uint8Array, outputFormat: StringOutputFormat): string;
1521
+ /**
1522
+ * @param scalar (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1523
+ * @param outputFormat Output format (default: Uint8Array)
1524
+ * @returns Uint8Array | string (CRYPTO_CORE_RISTRETTO255_BYTES bytes)
1525
+ */
1526
+ export function crypto_scalarmult_ristretto255_base(scalar: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1527
+ export function crypto_scalarmult_ristretto255_base(scalar: Uint8Array, outputFormat: StringOutputFormat): string;
1528
+ /**
1529
+ * @param message
1530
+ * @param nonce (CRYPTO_SECRETBOX_NONCEBYTES bytes)
1531
+ * @param key (CRYPTO_SECRETBOX_KEYBYTES bytes)
1532
+ * @param outputFormat Output format (default: Uint8Array)
1533
+ * @returns {mac, cipher}
1534
+ */
1535
+ export function crypto_secretbox_detached(message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { mac: Uint8Array; cipher: Uint8Array };
1536
+ export function crypto_secretbox_detached(message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): { mac: string; cipher: string };
1537
+ /**
1538
+ * @param message
1539
+ * @param nonce (CRYPTO_SECRETBOX_NONCEBYTES bytes)
1540
+ * @param key (CRYPTO_SECRETBOX_KEYBYTES bytes)
1541
+ * @param outputFormat Output format (default: Uint8Array)
1542
+ * @returns Uint8Array | string (CRYPTO_SECRETBOX_MACBYTES bytes)
1543
+ */
1544
+ export function crypto_secretbox_easy(message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1545
+ export function crypto_secretbox_easy(message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1546
+ /**
1547
+ * @param outputFormat Output format (default: Uint8Array)
1548
+ * @returns Uint8Array | string (CRYPTO_SECRETBOX_KEYBYTES bytes)
1549
+ */
1550
+ export function crypto_secretbox_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1551
+ export function crypto_secretbox_keygen(outputFormat: StringOutputFormat): string;
1552
+ /**
1553
+ * @param ciphertext
1554
+ * @param mac (CRYPTO_SECRETBOX_MACBYTES bytes)
1555
+ * @param nonce (CRYPTO_SECRETBOX_NONCEBYTES bytes)
1556
+ * @param key (CRYPTO_SECRETBOX_KEYBYTES bytes)
1557
+ * @param outputFormat Output format (default: Uint8Array)
1558
+ * @returns Uint8Array | string
1559
+ */
1560
+ export function crypto_secretbox_open_detached(ciphertext: Uint8Array | string, mac: Uint8Array, nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1561
+ export function crypto_secretbox_open_detached(ciphertext: Uint8Array | string, mac: Uint8Array, nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1562
+ /**
1563
+ * @param ciphertext
1564
+ * @param nonce (CRYPTO_SECRETBOX_NONCEBYTES bytes)
1565
+ * @param key (CRYPTO_SECRETBOX_KEYBYTES bytes)
1566
+ * @param outputFormat Output format (default: Uint8Array)
1567
+ * @returns Uint8Array | string (CRYPTO_SECRETBOX_MACBYTES bytes)
1568
+ */
1569
+ export function crypto_secretbox_open_easy(ciphertext: Uint8Array, nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1570
+ export function crypto_secretbox_open_easy(ciphertext: Uint8Array, nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1571
+ /**
1572
+ * @param header (CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES bytes)
1573
+ * @param key (CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES bytes)
1574
+ * @returns StateAddress
1575
+ */
504
1576
  export function crypto_secretstream_xchacha20poly1305_init_pull(header: Uint8Array, key: Uint8Array): StateAddress;
505
- export function crypto_secretstream_xchacha20poly1305_init_push(key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {state: StateAddress, header: Uint8Array | string};
506
- export function crypto_secretstream_xchacha20poly1305_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
507
- export function crypto_secretstream_xchacha20poly1305_pull(state_address: StateAddress, cipher: Uint8Array, ad: Uint8Array | string | null, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {message: Uint8Array | string, tag: number} | false;
508
- export function crypto_secretstream_xchacha20poly1305_push(state_address: StateAddress, message_chunk: Uint8Array | string, ad: Uint8Array | string | null, tag: number, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1577
+ /**
1578
+ * @param key (CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES bytes)
1579
+ * @param outputFormat Output format (default: Uint8Array)
1580
+ * @returns {state, header}
1581
+ */
1582
+ export function crypto_secretstream_xchacha20poly1305_init_push(key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { state: StateAddress; header: Uint8Array };
1583
+ export function crypto_secretstream_xchacha20poly1305_init_push(key: Uint8Array, outputFormat: StringOutputFormat): { state: StateAddress; header: string };
1584
+ /**
1585
+ * @param outputFormat Output format (default: Uint8Array)
1586
+ * @returns Uint8Array | string (CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES bytes)
1587
+ */
1588
+ export function crypto_secretstream_xchacha20poly1305_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1589
+ export function crypto_secretstream_xchacha20poly1305_keygen(outputFormat: StringOutputFormat): string;
1590
+ /**
1591
+ * @param state_address
1592
+ * @param cipher
1593
+ * @param ad
1594
+ * @param outputFormat Output format (default: Uint8Array)
1595
+ * @returns {message, tag} | false (CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES bytes)
1596
+ */
1597
+ export function crypto_secretstream_xchacha20poly1305_pull(state_address: StateAddress, cipher: Uint8Array, ad: Uint8Array | string | null, outputFormat?: Uint8ArrayOutputFormat | null): { message: Uint8Array; tag: number } | false;
1598
+ export function crypto_secretstream_xchacha20poly1305_pull(state_address: StateAddress, cipher: Uint8Array, ad: Uint8Array | string | null, outputFormat: StringOutputFormat): { message: string; tag: number } | false;
1599
+ /**
1600
+ * @param state_address
1601
+ * @param message_chunk
1602
+ * @param ad
1603
+ * @param tag
1604
+ * @param outputFormat Output format (default: Uint8Array)
1605
+ * @returns Uint8Array | string (CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES bytes)
1606
+ */
1607
+ export function crypto_secretstream_xchacha20poly1305_push(state_address: StateAddress, message_chunk: Uint8Array | string, ad: Uint8Array | string | null, tag: number, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1608
+ export function crypto_secretstream_xchacha20poly1305_push(state_address: StateAddress, message_chunk: Uint8Array | string, ad: Uint8Array | string | null, tag: number, outputFormat: StringOutputFormat): string;
1609
+ /**
1610
+ * @param state_address
1611
+ */
509
1612
  export function crypto_secretstream_xchacha20poly1305_rekey(state_address: StateAddress): void;
510
- export function crypto_shorthash(message: Uint8Array | string, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
511
- export function crypto_shorthash_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
512
- export function crypto_shorthash_siphashx24(message: Uint8Array | string, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
513
- export function crypto_sign(message: Uint8Array | string, privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
514
- export function crypto_sign_detached(message: Uint8Array | string, privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
515
- export function crypto_sign_ed25519_pk_to_curve25519(edPk: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
516
- export function crypto_sign_ed25519_sk_to_curve25519(edSk: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
517
- export function crypto_sign_ed25519_sk_to_pk(privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
518
- export function crypto_sign_ed25519_sk_to_seed(privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
519
- export function crypto_sign_final_create(state_address: StateAddress, privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1613
+ /**
1614
+ * @param message
1615
+ * @param key (CRYPTO_SHORTHASH_KEYBYTES bytes)
1616
+ * @param outputFormat Output format (default: Uint8Array)
1617
+ * @returns Uint8Array | string (CRYPTO_SHORTHASH_BYTES bytes)
1618
+ */
1619
+ export function crypto_shorthash(message: Uint8Array | string, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1620
+ export function crypto_shorthash(message: Uint8Array | string, key: Uint8Array, outputFormat: StringOutputFormat): string;
1621
+ /**
1622
+ * @param outputFormat Output format (default: Uint8Array)
1623
+ * @returns Uint8Array | string (CRYPTO_SHORTHASH_KEYBYTES bytes)
1624
+ */
1625
+ export function crypto_shorthash_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1626
+ export function crypto_shorthash_keygen(outputFormat: StringOutputFormat): string;
1627
+ /**
1628
+ * @param message
1629
+ * @param key (CRYPTO_SHORTHASH_SIPHASHX24_KEYBYTES bytes)
1630
+ * @param outputFormat Output format (default: Uint8Array)
1631
+ * @returns Uint8Array | string (CRYPTO_SHORTHASH_SIPHASHX24_BYTES bytes)
1632
+ */
1633
+ export function crypto_shorthash_siphashx24(message: Uint8Array | string, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1634
+ export function crypto_shorthash_siphashx24(message: Uint8Array | string, key: Uint8Array, outputFormat: StringOutputFormat): string;
1635
+ /**
1636
+ * @param message
1637
+ * @param privateKey (CRYPTO_SIGN_SECRETKEYBYTES bytes)
1638
+ * @param outputFormat Output format (default: Uint8Array)
1639
+ * @returns Uint8Array | string (CRYPTO_SIGN_BYTES bytes)
1640
+ */
1641
+ export function crypto_sign(message: Uint8Array | string, privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1642
+ export function crypto_sign(message: Uint8Array | string, privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
1643
+ /**
1644
+ * @param message
1645
+ * @param privateKey (CRYPTO_SIGN_SECRETKEYBYTES bytes)
1646
+ * @param outputFormat Output format (default: Uint8Array)
1647
+ * @returns Uint8Array | string (CRYPTO_SIGN_BYTES bytes)
1648
+ */
1649
+ export function crypto_sign_detached(message: Uint8Array | string, privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1650
+ export function crypto_sign_detached(message: Uint8Array | string, privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
1651
+ /**
1652
+ * @param edPk (CRYPTO_SIGN_PUBLICKEYBYTES bytes)
1653
+ * @param outputFormat Output format (default: Uint8Array)
1654
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_SCALARBYTES bytes)
1655
+ */
1656
+ export function crypto_sign_ed25519_pk_to_curve25519(edPk: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1657
+ export function crypto_sign_ed25519_pk_to_curve25519(edPk: Uint8Array, outputFormat: StringOutputFormat): string;
1658
+ /**
1659
+ * @param edSk (CRYPTO_SIGN_SECRETKEYBYTES bytes)
1660
+ * @param outputFormat Output format (default: Uint8Array)
1661
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_SCALARBYTES bytes)
1662
+ */
1663
+ export function crypto_sign_ed25519_sk_to_curve25519(edSk: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1664
+ export function crypto_sign_ed25519_sk_to_curve25519(edSk: Uint8Array, outputFormat: StringOutputFormat): string;
1665
+ /**
1666
+ * @param privateKey (CRYPTO_SIGN_SECRETKEYBYTES bytes)
1667
+ * @param outputFormat Output format (default: Uint8Array)
1668
+ * @returns Uint8Array | string (CRYPTO_SIGN_PUBLICKEYBYTES bytes)
1669
+ */
1670
+ export function crypto_sign_ed25519_sk_to_pk(privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1671
+ export function crypto_sign_ed25519_sk_to_pk(privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
1672
+ /**
1673
+ * @param privateKey (CRYPTO_SIGN_SECRETKEYBYTES bytes)
1674
+ * @param outputFormat Output format (default: Uint8Array)
1675
+ * @returns Uint8Array | string (CRYPTO_SIGN_SEEDBYTES bytes)
1676
+ */
1677
+ export function crypto_sign_ed25519_sk_to_seed(privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1678
+ export function crypto_sign_ed25519_sk_to_seed(privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
1679
+ /**
1680
+ * @param state_address
1681
+ * @param privateKey (CRYPTO_SIGN_SECRETKEYBYTES bytes)
1682
+ * @param outputFormat Output format (default: Uint8Array)
1683
+ * @returns Uint8Array | string (CRYPTO_SIGN_BYTES bytes)
1684
+ */
1685
+ export function crypto_sign_final_create(state_address: StateAddress, privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1686
+ export function crypto_sign_final_create(state_address: StateAddress, privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
1687
+ /**
1688
+ * @param state_address
1689
+ * @param signature (CRYPTO_SIGN_BYTES bytes)
1690
+ * @param publicKey (CRYPTO_SIGN_PUBLICKEYBYTES bytes)
1691
+ * @returns boolean
1692
+ */
520
1693
  export function crypto_sign_final_verify(state_address: StateAddress, signature: Uint8Array, publicKey: Uint8Array): boolean;
1694
+ /**
1695
+ * @returns StateAddress
1696
+ */
521
1697
  export function crypto_sign_init(): StateAddress;
522
- export function crypto_sign_keypair(outputFormat?: "uint8array" | "text" | "hex" | "base64"): {publicKey: Uint8Array | string, privateKey: Uint8Array | string, keyType: string};
523
- export function crypto_sign_open(signedMessage: Uint8Array, publicKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
524
- export function crypto_sign_seed_keypair(seed: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {publicKey: Uint8Array | string, privateKey: Uint8Array | string, keyType: string};
1698
+ /**
1699
+ * @param outputFormat Output format (default: Uint8Array)
1700
+ * @returns {publicKey, privateKey, keyType} (CRYPTO_SIGN_PUBLICKEYBYTES bytes)
1701
+ */
1702
+ export function crypto_sign_keypair(outputFormat?: Uint8ArrayOutputFormat | null): { publicKey: Uint8Array; privateKey: Uint8Array; keyType: string };
1703
+ export function crypto_sign_keypair(outputFormat: StringOutputFormat): { publicKey: string; privateKey: string; keyType: string };
1704
+ /**
1705
+ * @param signedMessage
1706
+ * @param publicKey (CRYPTO_SIGN_PUBLICKEYBYTES bytes)
1707
+ * @param outputFormat Output format (default: Uint8Array)
1708
+ * @returns Uint8Array | string (CRYPTO_SIGN_BYTES bytes)
1709
+ */
1710
+ export function crypto_sign_open(signedMessage: Uint8Array, publicKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1711
+ export function crypto_sign_open(signedMessage: Uint8Array, publicKey: Uint8Array, outputFormat: StringOutputFormat): string;
1712
+ /**
1713
+ * @param seed (CRYPTO_SIGN_SEEDBYTES bytes)
1714
+ * @param outputFormat Output format (default: Uint8Array)
1715
+ * @returns {publicKey, privateKey, keyType} (CRYPTO_SIGN_PUBLICKEYBYTES bytes)
1716
+ */
1717
+ export function crypto_sign_seed_keypair(seed: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { publicKey: Uint8Array; privateKey: Uint8Array; keyType: string };
1718
+ export function crypto_sign_seed_keypair(seed: Uint8Array, outputFormat: StringOutputFormat): { publicKey: string; privateKey: string; keyType: string };
1719
+ /**
1720
+ * @param state_address
1721
+ * @param message_chunk
1722
+ */
525
1723
  export function crypto_sign_update(state_address: StateAddress, message_chunk: Uint8Array | string): void;
1724
+ /**
1725
+ * @param signature (CRYPTO_SIGN_BYTES bytes)
1726
+ * @param message
1727
+ * @param publicKey (CRYPTO_SIGN_PUBLICKEYBYTES bytes)
1728
+ * @returns boolean
1729
+ */
526
1730
  export function crypto_sign_verify_detached(signature: Uint8Array, message: Uint8Array | string, publicKey: Uint8Array): boolean;
527
- export function crypto_stream_chacha20(outLength: number, key: Uint8Array, nonce: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
528
- export function crypto_stream_chacha20_ietf_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
529
- export function crypto_stream_chacha20_ietf_xor_ic(input_message: Uint8Array | string, nonce: Uint8Array, nonce_increment: number, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
530
- export function crypto_stream_chacha20_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
531
- export function crypto_stream_chacha20_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
532
- export function crypto_stream_chacha20_xor_ic(input_message: Uint8Array | string, nonce: Uint8Array, nonce_increment: number, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
533
- export function crypto_stream_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
534
- export function crypto_stream_xchacha20_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
535
- export function crypto_stream_xchacha20_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
536
- export function crypto_stream_xchacha20_xor_ic(input_message: Uint8Array | string, nonce: Uint8Array, nonce_increment: number, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
537
- export function crypto_xof_shake128(out_length: number, message: Uint8Array | string, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1731
+ /**
1732
+ * @param outLength
1733
+ * @param key (CRYPTO_STREAM_CHACHA20_KEYBYTES bytes)
1734
+ * @param nonce (CRYPTO_STREAM_CHACHA20_NONCEBYTES bytes)
1735
+ * @param outputFormat Output format (default: Uint8Array)
1736
+ * @returns Uint8Array | string
1737
+ */
1738
+ export function crypto_stream_chacha20(outLength: number, key: Uint8Array, nonce: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1739
+ export function crypto_stream_chacha20(outLength: number, key: Uint8Array, nonce: Uint8Array, outputFormat: StringOutputFormat): string;
1740
+ /**
1741
+ * @param input_message
1742
+ * @param nonce (CRYPTO_STREAM_CHACHA20_IETF_NONCEBYTES bytes)
1743
+ * @param key (CRYPTO_STREAM_CHACHA20_IETF_KEYBYTES bytes)
1744
+ * @param outputFormat Output format (default: Uint8Array)
1745
+ * @returns Uint8Array | string
1746
+ */
1747
+ export function crypto_stream_chacha20_ietf_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1748
+ export function crypto_stream_chacha20_ietf_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1749
+ /**
1750
+ * @param input_message
1751
+ * @param nonce (CRYPTO_STREAM_CHACHA20_IETF_NONCEBYTES bytes)
1752
+ * @param nonce_increment
1753
+ * @param key (CRYPTO_STREAM_CHACHA20_IETF_KEYBYTES bytes)
1754
+ * @param outputFormat Output format (default: Uint8Array)
1755
+ * @returns Uint8Array | string
1756
+ */
1757
+ export function crypto_stream_chacha20_ietf_xor_ic(input_message: Uint8Array | string, nonce: Uint8Array, nonce_increment: number, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1758
+ export function crypto_stream_chacha20_ietf_xor_ic(input_message: Uint8Array | string, nonce: Uint8Array, nonce_increment: number, key: Uint8Array, outputFormat: StringOutputFormat): string;
1759
+ /**
1760
+ * @param outputFormat Output format (default: Uint8Array)
1761
+ * @returns Uint8Array | string (CRYPTO_STREAM_CHACHA20_KEYBYTES bytes)
1762
+ */
1763
+ export function crypto_stream_chacha20_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1764
+ export function crypto_stream_chacha20_keygen(outputFormat: StringOutputFormat): string;
1765
+ /**
1766
+ * @param input_message
1767
+ * @param nonce (CRYPTO_STREAM_CHACHA20_NONCEBYTES bytes)
1768
+ * @param key (CRYPTO_STREAM_CHACHA20_KEYBYTES bytes)
1769
+ * @param outputFormat Output format (default: Uint8Array)
1770
+ * @returns Uint8Array | string
1771
+ */
1772
+ export function crypto_stream_chacha20_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1773
+ export function crypto_stream_chacha20_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1774
+ /**
1775
+ * @param input_message
1776
+ * @param nonce (CRYPTO_STREAM_CHACHA20_NONCEBYTES bytes)
1777
+ * @param nonce_increment
1778
+ * @param key (CRYPTO_STREAM_CHACHA20_KEYBYTES bytes)
1779
+ * @param outputFormat Output format (default: Uint8Array)
1780
+ * @returns Uint8Array | string
1781
+ */
1782
+ export function crypto_stream_chacha20_xor_ic(input_message: Uint8Array | string, nonce: Uint8Array, nonce_increment: number, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1783
+ export function crypto_stream_chacha20_xor_ic(input_message: Uint8Array | string, nonce: Uint8Array, nonce_increment: number, key: Uint8Array, outputFormat: StringOutputFormat): string;
1784
+ /**
1785
+ * @param outputFormat Output format (default: Uint8Array)
1786
+ * @returns Uint8Array | string (CRYPTO_STREAM_KEYBYTES bytes)
1787
+ */
1788
+ export function crypto_stream_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1789
+ export function crypto_stream_keygen(outputFormat: StringOutputFormat): string;
1790
+ /**
1791
+ * @param outputFormat Output format (default: Uint8Array)
1792
+ * @returns Uint8Array | string (CRYPTO_STREAM_XCHACHA20_KEYBYTES bytes)
1793
+ */
1794
+ export function crypto_stream_xchacha20_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1795
+ export function crypto_stream_xchacha20_keygen(outputFormat: StringOutputFormat): string;
1796
+ /**
1797
+ * @param input_message
1798
+ * @param nonce (CRYPTO_STREAM_XCHACHA20_NONCEBYTES bytes)
1799
+ * @param key (CRYPTO_STREAM_XCHACHA20_KEYBYTES bytes)
1800
+ * @param outputFormat Output format (default: Uint8Array)
1801
+ * @returns Uint8Array | string
1802
+ */
1803
+ export function crypto_stream_xchacha20_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1804
+ export function crypto_stream_xchacha20_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1805
+ /**
1806
+ * @param input_message
1807
+ * @param nonce (CRYPTO_STREAM_XCHACHA20_NONCEBYTES bytes)
1808
+ * @param nonce_increment
1809
+ * @param key (CRYPTO_STREAM_XCHACHA20_KEYBYTES bytes)
1810
+ * @param outputFormat Output format (default: Uint8Array)
1811
+ * @returns Uint8Array | string
1812
+ */
1813
+ export function crypto_stream_xchacha20_xor_ic(input_message: Uint8Array | string, nonce: Uint8Array, nonce_increment: number, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1814
+ export function crypto_stream_xchacha20_xor_ic(input_message: Uint8Array | string, nonce: Uint8Array, nonce_increment: number, key: Uint8Array, outputFormat: StringOutputFormat): string;
1815
+ /**
1816
+ * @param out_length
1817
+ * @param message
1818
+ * @param outputFormat Output format (default: Uint8Array)
1819
+ * @returns Uint8Array | string
1820
+ */
1821
+ export function crypto_xof_shake128(out_length: number, message: Uint8Array | string, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1822
+ export function crypto_xof_shake128(out_length: number, message: Uint8Array | string, outputFormat: StringOutputFormat): string;
1823
+ /**
1824
+ * @returns StateAddress
1825
+ */
538
1826
  export function crypto_xof_shake128_init(): StateAddress;
1827
+ /**
1828
+ * @param domain
1829
+ * @returns StateAddress
1830
+ */
539
1831
  export function crypto_xof_shake128_init_with_domain(domain: number): StateAddress;
540
- export function crypto_xof_shake128_squeeze(state_address: StateAddress, out_length: number, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1832
+ /**
1833
+ * @param state_address
1834
+ * @param out_length
1835
+ * @param outputFormat Output format (default: Uint8Array)
1836
+ * @returns Uint8Array | string
1837
+ */
1838
+ export function crypto_xof_shake128_squeeze(state_address: StateAddress, out_length: number, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1839
+ export function crypto_xof_shake128_squeeze(state_address: StateAddress, out_length: number, outputFormat: StringOutputFormat): string;
1840
+ /**
1841
+ * @param state_address
1842
+ * @param message_chunk
1843
+ */
541
1844
  export function crypto_xof_shake128_update(state_address: StateAddress, message_chunk: Uint8Array | string): void;
542
- export function crypto_xof_shake256(out_length: number, message: Uint8Array | string, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1845
+ /**
1846
+ * @param out_length
1847
+ * @param message
1848
+ * @param outputFormat Output format (default: Uint8Array)
1849
+ * @returns Uint8Array | string
1850
+ */
1851
+ export function crypto_xof_shake256(out_length: number, message: Uint8Array | string, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1852
+ export function crypto_xof_shake256(out_length: number, message: Uint8Array | string, outputFormat: StringOutputFormat): string;
1853
+ /**
1854
+ * @returns StateAddress
1855
+ */
543
1856
  export function crypto_xof_shake256_init(): StateAddress;
1857
+ /**
1858
+ * @param domain
1859
+ * @returns StateAddress
1860
+ */
544
1861
  export function crypto_xof_shake256_init_with_domain(domain: number): StateAddress;
545
- export function crypto_xof_shake256_squeeze(state_address: StateAddress, out_length: number, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1862
+ /**
1863
+ * @param state_address
1864
+ * @param out_length
1865
+ * @param outputFormat Output format (default: Uint8Array)
1866
+ * @returns Uint8Array | string
1867
+ */
1868
+ export function crypto_xof_shake256_squeeze(state_address: StateAddress, out_length: number, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1869
+ export function crypto_xof_shake256_squeeze(state_address: StateAddress, out_length: number, outputFormat: StringOutputFormat): string;
1870
+ /**
1871
+ * @param state_address
1872
+ * @param message_chunk
1873
+ */
546
1874
  export function crypto_xof_shake256_update(state_address: StateAddress, message_chunk: Uint8Array | string): void;
547
- export function crypto_xof_turboshake128(out_length: number, message: Uint8Array | string, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1875
+ /**
1876
+ * @param out_length
1877
+ * @param message
1878
+ * @param outputFormat Output format (default: Uint8Array)
1879
+ * @returns Uint8Array | string
1880
+ */
1881
+ export function crypto_xof_turboshake128(out_length: number, message: Uint8Array | string, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1882
+ export function crypto_xof_turboshake128(out_length: number, message: Uint8Array | string, outputFormat: StringOutputFormat): string;
1883
+ /**
1884
+ * @returns StateAddress
1885
+ */
548
1886
  export function crypto_xof_turboshake128_init(): StateAddress;
1887
+ /**
1888
+ * @param domain
1889
+ * @returns StateAddress
1890
+ */
549
1891
  export function crypto_xof_turboshake128_init_with_domain(domain: number): StateAddress;
550
- export function crypto_xof_turboshake128_squeeze(state_address: StateAddress, out_length: number, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1892
+ /**
1893
+ * @param state_address
1894
+ * @param out_length
1895
+ * @param outputFormat Output format (default: Uint8Array)
1896
+ * @returns Uint8Array | string
1897
+ */
1898
+ export function crypto_xof_turboshake128_squeeze(state_address: StateAddress, out_length: number, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1899
+ export function crypto_xof_turboshake128_squeeze(state_address: StateAddress, out_length: number, outputFormat: StringOutputFormat): string;
1900
+ /**
1901
+ * @param state_address
1902
+ * @param message_chunk
1903
+ */
551
1904
  export function crypto_xof_turboshake128_update(state_address: StateAddress, message_chunk: Uint8Array | string): void;
552
- export function crypto_xof_turboshake256(out_length: number, message: Uint8Array | string, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1905
+ /**
1906
+ * @param out_length
1907
+ * @param message
1908
+ * @param outputFormat Output format (default: Uint8Array)
1909
+ * @returns Uint8Array | string
1910
+ */
1911
+ export function crypto_xof_turboshake256(out_length: number, message: Uint8Array | string, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1912
+ export function crypto_xof_turboshake256(out_length: number, message: Uint8Array | string, outputFormat: StringOutputFormat): string;
1913
+ /**
1914
+ * @returns StateAddress
1915
+ */
553
1916
  export function crypto_xof_turboshake256_init(): StateAddress;
1917
+ /**
1918
+ * @param domain
1919
+ * @returns StateAddress
1920
+ */
554
1921
  export function crypto_xof_turboshake256_init_with_domain(domain: number): StateAddress;
555
- export function crypto_xof_turboshake256_squeeze(state_address: StateAddress, out_length: number, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1922
+ /**
1923
+ * @param state_address
1924
+ * @param out_length
1925
+ * @param outputFormat Output format (default: Uint8Array)
1926
+ * @returns Uint8Array | string
1927
+ */
1928
+ export function crypto_xof_turboshake256_squeeze(state_address: StateAddress, out_length: number, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1929
+ export function crypto_xof_turboshake256_squeeze(state_address: StateAddress, out_length: number, outputFormat: StringOutputFormat): string;
1930
+ /**
1931
+ * @param state_address
1932
+ * @param message_chunk
1933
+ */
556
1934
  export function crypto_xof_turboshake256_update(state_address: StateAddress, message_chunk: Uint8Array | string): void;
557
- export function randombytes_buf(length: number, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
558
- export function randombytes_buf_deterministic(length: number, seed: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1935
+ /**
1936
+ * @param length
1937
+ * @param outputFormat Output format (default: Uint8Array)
1938
+ * @returns Uint8Array | string
1939
+ */
1940
+ export function randombytes_buf(length: number, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1941
+ export function randombytes_buf(length: number, outputFormat: StringOutputFormat): string;
1942
+ /**
1943
+ * @param length
1944
+ * @param seed (RANDOMBYTES_SEEDBYTES bytes)
1945
+ * @param outputFormat Output format (default: Uint8Array)
1946
+ * @returns Uint8Array | string
1947
+ */
1948
+ export function randombytes_buf_deterministic(length: number, seed: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1949
+ export function randombytes_buf_deterministic(length: number, seed: Uint8Array, outputFormat: StringOutputFormat): string;
1950
+ /**
1951
+ */
559
1952
  export function randombytes_close(): void;
1953
+ /**
1954
+ * @returns number
1955
+ */
560
1956
  export function randombytes_random(): number;
1957
+ /**
1958
+ * @param implementation
1959
+ */
561
1960
  export function randombytes_set_implementation(implementation: object): void;
1961
+ /**
1962
+ */
562
1963
  export function randombytes_stir(): void;
1964
+ /**
1965
+ * @param upper_bound
1966
+ * @returns number
1967
+ */
563
1968
  export function randombytes_uniform(upper_bound: number): number;
1969
+ /**
1970
+ * @param bin
1971
+ * @returns Uint8Array
1972
+ */
564
1973
  export function sodium_bin2ip(bin: Uint8Array): Uint8Array;
565
- export function sodium_ip2bin(ip: string, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1974
+ /**
1975
+ * @param ip
1976
+ * @param outputFormat Output format (default: Uint8Array)
1977
+ * @returns Uint8Array | string
1978
+ */
1979
+ export function sodium_ip2bin(ip: string, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1980
+ export function sodium_ip2bin(ip: string, outputFormat: StringOutputFormat): string;
1981
+ /**
1982
+ * @returns string
1983
+ */
566
1984
  export function sodium_version_string(): string;
567
1985
 
568
1986
  // Internal: list of all exported symbols