libsodium-wrappers-sumo 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,227 +349,1674 @@ 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;
488
- export function crypto_pwhash_scryptsalsa208sha256(keyLength: number, password: Uint8Array | string, salt: Uint8Array, opsLimit: number, memLimit: number, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
489
- export function crypto_pwhash_scryptsalsa208sha256_ll(password: Uint8Array | string, salt: Uint8Array | string, opsLimit: number, r: number, p: number, keyLength: 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 keyLength
1450
+ * @param password
1451
+ * @param salt (CRYPTO_PWHASH_SCRYPTSALSA208SHA256_SALTBYTES bytes)
1452
+ * @param opsLimit
1453
+ * @param memLimit
1454
+ * @param outputFormat Output format (default: Uint8Array)
1455
+ * @returns Uint8Array | string
1456
+ */
1457
+ export function crypto_pwhash_scryptsalsa208sha256(keyLength: number, password: Uint8Array | string, salt: Uint8Array, opsLimit: number, memLimit: number, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1458
+ export function crypto_pwhash_scryptsalsa208sha256(keyLength: number, password: Uint8Array | string, salt: Uint8Array, opsLimit: number, memLimit: number, outputFormat: StringOutputFormat): string;
1459
+ /**
1460
+ * @param password
1461
+ * @param salt
1462
+ * @param opsLimit
1463
+ * @param r
1464
+ * @param p
1465
+ * @param keyLength
1466
+ * @param outputFormat Output format (default: Uint8Array)
1467
+ * @returns Uint8Array | string
1468
+ */
1469
+ export function crypto_pwhash_scryptsalsa208sha256_ll(password: Uint8Array | string, salt: Uint8Array | string, opsLimit: number, r: number, p: number, keyLength: number, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1470
+ export function crypto_pwhash_scryptsalsa208sha256_ll(password: Uint8Array | string, salt: Uint8Array | string, opsLimit: number, r: number, p: number, keyLength: number, outputFormat: StringOutputFormat): string;
1471
+ /**
1472
+ * @param password
1473
+ * @param opsLimit
1474
+ * @param memLimit
1475
+ * @returns Uint8Array (CRYPTO_PWHASH_SCRYPTSALSA208SHA256_STRBYTES bytes)
1476
+ */
490
1477
  export function crypto_pwhash_scryptsalsa208sha256_str(password: Uint8Array | string, opsLimit: number, memLimit: number): Uint8Array;
1478
+ /**
1479
+ * @param hashed_password
1480
+ * @param password
1481
+ * @returns boolean
1482
+ */
491
1483
  export function crypto_pwhash_scryptsalsa208sha256_str_verify(hashed_password: string, password: Uint8Array | string): boolean;
1484
+ /**
1485
+ * @param password
1486
+ * @param opsLimit
1487
+ * @param memLimit
1488
+ * @returns Uint8Array (CRYPTO_PWHASH_STRBYTES bytes)
1489
+ */
492
1490
  export function crypto_pwhash_str(password: Uint8Array | string, opsLimit: number, memLimit: number): Uint8Array;
1491
+ /**
1492
+ * @param hashed_password
1493
+ * @param opsLimit
1494
+ * @param memLimit
1495
+ * @returns boolean
1496
+ */
493
1497
  export function crypto_pwhash_str_needs_rehash(hashed_password: string, opsLimit: number, memLimit: number): boolean;
1498
+ /**
1499
+ * @param hashed_password
1500
+ * @param password
1501
+ * @returns boolean
1502
+ */
494
1503
  export function crypto_pwhash_str_verify(hashed_password: string, password: Uint8Array | string): boolean;
495
- export function crypto_scalarmult(privateKey: Uint8Array, publicKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
496
- export function crypto_scalarmult_base(privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
497
- export function crypto_scalarmult_ed25519(n: Uint8Array, p: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
498
- export function crypto_scalarmult_ed25519_base(scalar: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
499
- export function crypto_scalarmult_ed25519_base_noclamp(scalar: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
500
- export function crypto_scalarmult_ed25519_noclamp(n: Uint8Array, p: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
501
- export function crypto_scalarmult_ristretto255(scalar: Uint8Array, element: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
502
- export function crypto_scalarmult_ristretto255_base(scalar: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
503
- export function crypto_secretbox_detached(message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {mac: Uint8Array | string, cipher: Uint8Array | string};
504
- export function crypto_secretbox_easy(message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
505
- export function crypto_secretbox_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
506
- export function crypto_secretbox_open_detached(ciphertext: Uint8Array | string, mac: Uint8Array, nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
507
- export function crypto_secretbox_open_easy(ciphertext: Uint8Array, nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1504
+ /**
1505
+ * @param privateKey (CRYPTO_SCALARMULT_SCALARBYTES bytes)
1506
+ * @param publicKey (CRYPTO_SCALARMULT_BYTES bytes)
1507
+ * @param outputFormat Output format (default: Uint8Array)
1508
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_BYTES bytes)
1509
+ */
1510
+ export function crypto_scalarmult(privateKey: Uint8Array, publicKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1511
+ export function crypto_scalarmult(privateKey: Uint8Array, publicKey: Uint8Array, outputFormat: StringOutputFormat): string;
1512
+ /**
1513
+ * @param privateKey (CRYPTO_SCALARMULT_SCALARBYTES bytes)
1514
+ * @param outputFormat Output format (default: Uint8Array)
1515
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_BYTES bytes)
1516
+ */
1517
+ export function crypto_scalarmult_base(privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1518
+ export function crypto_scalarmult_base(privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
1519
+ /**
1520
+ * @param n (CRYPTO_SCALARMULT_ED25519_SCALARBYTES bytes)
1521
+ * @param p (CRYPTO_SCALARMULT_ED25519_BYTES bytes)
1522
+ * @param outputFormat Output format (default: Uint8Array)
1523
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_ED25519_BYTES bytes)
1524
+ */
1525
+ export function crypto_scalarmult_ed25519(n: Uint8Array, p: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1526
+ export function crypto_scalarmult_ed25519(n: Uint8Array, p: Uint8Array, outputFormat: StringOutputFormat): string;
1527
+ /**
1528
+ * @param scalar (CRYPTO_SCALARMULT_ED25519_SCALARBYTES bytes)
1529
+ * @param outputFormat Output format (default: Uint8Array)
1530
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_ED25519_BYTES bytes)
1531
+ */
1532
+ export function crypto_scalarmult_ed25519_base(scalar: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1533
+ export function crypto_scalarmult_ed25519_base(scalar: Uint8Array, outputFormat: StringOutputFormat): string;
1534
+ /**
1535
+ * @param scalar (CRYPTO_SCALARMULT_ED25519_SCALARBYTES bytes)
1536
+ * @param outputFormat Output format (default: Uint8Array)
1537
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_ED25519_BYTES bytes)
1538
+ */
1539
+ export function crypto_scalarmult_ed25519_base_noclamp(scalar: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1540
+ export function crypto_scalarmult_ed25519_base_noclamp(scalar: Uint8Array, outputFormat: StringOutputFormat): string;
1541
+ /**
1542
+ * @param n (CRYPTO_SCALARMULT_ED25519_SCALARBYTES bytes)
1543
+ * @param p (CRYPTO_SCALARMULT_ED25519_BYTES bytes)
1544
+ * @param outputFormat Output format (default: Uint8Array)
1545
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_ED25519_BYTES bytes)
1546
+ */
1547
+ export function crypto_scalarmult_ed25519_noclamp(n: Uint8Array, p: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1548
+ export function crypto_scalarmult_ed25519_noclamp(n: Uint8Array, p: Uint8Array, outputFormat: StringOutputFormat): string;
1549
+ /**
1550
+ * @param scalar (CRYPTO_SCALARMULT_RISTRETTO255_SCALARBYTES bytes)
1551
+ * @param element (CRYPTO_SCALARMULT_RISTRETTO255_BYTES bytes)
1552
+ * @param outputFormat Output format (default: Uint8Array)
1553
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_RISTRETTO255_BYTES bytes)
1554
+ */
1555
+ export function crypto_scalarmult_ristretto255(scalar: Uint8Array, element: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1556
+ export function crypto_scalarmult_ristretto255(scalar: Uint8Array, element: Uint8Array, outputFormat: StringOutputFormat): string;
1557
+ /**
1558
+ * @param scalar (CRYPTO_CORE_RISTRETTO255_SCALARBYTES bytes)
1559
+ * @param outputFormat Output format (default: Uint8Array)
1560
+ * @returns Uint8Array | string (CRYPTO_CORE_RISTRETTO255_BYTES bytes)
1561
+ */
1562
+ export function crypto_scalarmult_ristretto255_base(scalar: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1563
+ export function crypto_scalarmult_ristretto255_base(scalar: Uint8Array, outputFormat: StringOutputFormat): string;
1564
+ /**
1565
+ * @param message
1566
+ * @param nonce (CRYPTO_SECRETBOX_NONCEBYTES bytes)
1567
+ * @param key (CRYPTO_SECRETBOX_KEYBYTES bytes)
1568
+ * @param outputFormat Output format (default: Uint8Array)
1569
+ * @returns {mac, cipher}
1570
+ */
1571
+ export function crypto_secretbox_detached(message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { mac: Uint8Array; cipher: Uint8Array };
1572
+ export function crypto_secretbox_detached(message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): { mac: string; cipher: string };
1573
+ /**
1574
+ * @param message
1575
+ * @param nonce (CRYPTO_SECRETBOX_NONCEBYTES bytes)
1576
+ * @param key (CRYPTO_SECRETBOX_KEYBYTES bytes)
1577
+ * @param outputFormat Output format (default: Uint8Array)
1578
+ * @returns Uint8Array | string (CRYPTO_SECRETBOX_MACBYTES bytes)
1579
+ */
1580
+ export function crypto_secretbox_easy(message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1581
+ export function crypto_secretbox_easy(message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1582
+ /**
1583
+ * @param outputFormat Output format (default: Uint8Array)
1584
+ * @returns Uint8Array | string (CRYPTO_SECRETBOX_KEYBYTES bytes)
1585
+ */
1586
+ export function crypto_secretbox_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1587
+ export function crypto_secretbox_keygen(outputFormat: StringOutputFormat): string;
1588
+ /**
1589
+ * @param ciphertext
1590
+ * @param mac (CRYPTO_SECRETBOX_MACBYTES bytes)
1591
+ * @param nonce (CRYPTO_SECRETBOX_NONCEBYTES bytes)
1592
+ * @param key (CRYPTO_SECRETBOX_KEYBYTES bytes)
1593
+ * @param outputFormat Output format (default: Uint8Array)
1594
+ * @returns Uint8Array | string
1595
+ */
1596
+ export function crypto_secretbox_open_detached(ciphertext: Uint8Array | string, mac: Uint8Array, nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1597
+ export function crypto_secretbox_open_detached(ciphertext: Uint8Array | string, mac: Uint8Array, nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1598
+ /**
1599
+ * @param ciphertext
1600
+ * @param nonce (CRYPTO_SECRETBOX_NONCEBYTES bytes)
1601
+ * @param key (CRYPTO_SECRETBOX_KEYBYTES bytes)
1602
+ * @param outputFormat Output format (default: Uint8Array)
1603
+ * @returns Uint8Array | string (CRYPTO_SECRETBOX_MACBYTES bytes)
1604
+ */
1605
+ export function crypto_secretbox_open_easy(ciphertext: Uint8Array, nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1606
+ export function crypto_secretbox_open_easy(ciphertext: Uint8Array, nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1607
+ /**
1608
+ * @param header (CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES bytes)
1609
+ * @param key (CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES bytes)
1610
+ * @returns StateAddress
1611
+ */
508
1612
  export function crypto_secretstream_xchacha20poly1305_init_pull(header: Uint8Array, key: Uint8Array): StateAddress;
509
- export function crypto_secretstream_xchacha20poly1305_init_push(key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {state: StateAddress, header: Uint8Array | string};
510
- export function crypto_secretstream_xchacha20poly1305_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
511
- 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;
512
- 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;
1613
+ /**
1614
+ * @param key (CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES bytes)
1615
+ * @param outputFormat Output format (default: Uint8Array)
1616
+ * @returns {state, header}
1617
+ */
1618
+ export function crypto_secretstream_xchacha20poly1305_init_push(key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { state: StateAddress; header: Uint8Array };
1619
+ export function crypto_secretstream_xchacha20poly1305_init_push(key: Uint8Array, outputFormat: StringOutputFormat): { state: StateAddress; header: string };
1620
+ /**
1621
+ * @param outputFormat Output format (default: Uint8Array)
1622
+ * @returns Uint8Array | string (CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES bytes)
1623
+ */
1624
+ export function crypto_secretstream_xchacha20poly1305_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1625
+ export function crypto_secretstream_xchacha20poly1305_keygen(outputFormat: StringOutputFormat): string;
1626
+ /**
1627
+ * @param state_address
1628
+ * @param cipher
1629
+ * @param ad
1630
+ * @param outputFormat Output format (default: Uint8Array)
1631
+ * @returns {message, tag} | false (CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES bytes)
1632
+ */
1633
+ export function crypto_secretstream_xchacha20poly1305_pull(state_address: StateAddress, cipher: Uint8Array, ad: Uint8Array | string | null, outputFormat?: Uint8ArrayOutputFormat | null): { message: Uint8Array; tag: number } | false;
1634
+ export function crypto_secretstream_xchacha20poly1305_pull(state_address: StateAddress, cipher: Uint8Array, ad: Uint8Array | string | null, outputFormat: StringOutputFormat): { message: string; tag: number } | false;
1635
+ /**
1636
+ * @param state_address
1637
+ * @param message_chunk
1638
+ * @param ad
1639
+ * @param tag
1640
+ * @param outputFormat Output format (default: Uint8Array)
1641
+ * @returns Uint8Array | string (CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES bytes)
1642
+ */
1643
+ export function crypto_secretstream_xchacha20poly1305_push(state_address: StateAddress, message_chunk: Uint8Array | string, ad: Uint8Array | string | null, tag: number, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1644
+ export function crypto_secretstream_xchacha20poly1305_push(state_address: StateAddress, message_chunk: Uint8Array | string, ad: Uint8Array | string | null, tag: number, outputFormat: StringOutputFormat): string;
1645
+ /**
1646
+ * @param state_address
1647
+ */
513
1648
  export function crypto_secretstream_xchacha20poly1305_rekey(state_address: StateAddress): void;
514
- export function crypto_shorthash(message: Uint8Array | string, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
515
- export function crypto_shorthash_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
516
- export function crypto_shorthash_siphashx24(message: Uint8Array | string, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
517
- export function crypto_sign(message: Uint8Array | string, privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
518
- export function crypto_sign_detached(message: Uint8Array | string, privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
519
- export function crypto_sign_ed25519_pk_to_curve25519(edPk: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
520
- export function crypto_sign_ed25519_sk_to_curve25519(edSk: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
521
- export function crypto_sign_ed25519_sk_to_pk(privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
522
- export function crypto_sign_ed25519_sk_to_seed(privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
523
- export function crypto_sign_final_create(state_address: StateAddress, privateKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1649
+ /**
1650
+ * @param message
1651
+ * @param key (CRYPTO_SHORTHASH_KEYBYTES bytes)
1652
+ * @param outputFormat Output format (default: Uint8Array)
1653
+ * @returns Uint8Array | string (CRYPTO_SHORTHASH_BYTES bytes)
1654
+ */
1655
+ export function crypto_shorthash(message: Uint8Array | string, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1656
+ export function crypto_shorthash(message: Uint8Array | string, key: Uint8Array, outputFormat: StringOutputFormat): string;
1657
+ /**
1658
+ * @param outputFormat Output format (default: Uint8Array)
1659
+ * @returns Uint8Array | string (CRYPTO_SHORTHASH_KEYBYTES bytes)
1660
+ */
1661
+ export function crypto_shorthash_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1662
+ export function crypto_shorthash_keygen(outputFormat: StringOutputFormat): string;
1663
+ /**
1664
+ * @param message
1665
+ * @param key (CRYPTO_SHORTHASH_SIPHASHX24_KEYBYTES bytes)
1666
+ * @param outputFormat Output format (default: Uint8Array)
1667
+ * @returns Uint8Array | string (CRYPTO_SHORTHASH_SIPHASHX24_BYTES bytes)
1668
+ */
1669
+ export function crypto_shorthash_siphashx24(message: Uint8Array | string, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1670
+ export function crypto_shorthash_siphashx24(message: Uint8Array | string, key: Uint8Array, outputFormat: StringOutputFormat): string;
1671
+ /**
1672
+ * @param message
1673
+ * @param privateKey (CRYPTO_SIGN_SECRETKEYBYTES bytes)
1674
+ * @param outputFormat Output format (default: Uint8Array)
1675
+ * @returns Uint8Array | string (CRYPTO_SIGN_BYTES bytes)
1676
+ */
1677
+ export function crypto_sign(message: Uint8Array | string, privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1678
+ export function crypto_sign(message: Uint8Array | string, privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
1679
+ /**
1680
+ * @param message
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_detached(message: Uint8Array | string, privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1686
+ export function crypto_sign_detached(message: Uint8Array | string, privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
1687
+ /**
1688
+ * @param edPk (CRYPTO_SIGN_PUBLICKEYBYTES bytes)
1689
+ * @param outputFormat Output format (default: Uint8Array)
1690
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_SCALARBYTES bytes)
1691
+ */
1692
+ export function crypto_sign_ed25519_pk_to_curve25519(edPk: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1693
+ export function crypto_sign_ed25519_pk_to_curve25519(edPk: Uint8Array, outputFormat: StringOutputFormat): string;
1694
+ /**
1695
+ * @param edSk (CRYPTO_SIGN_SECRETKEYBYTES bytes)
1696
+ * @param outputFormat Output format (default: Uint8Array)
1697
+ * @returns Uint8Array | string (CRYPTO_SCALARMULT_SCALARBYTES bytes)
1698
+ */
1699
+ export function crypto_sign_ed25519_sk_to_curve25519(edSk: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1700
+ export function crypto_sign_ed25519_sk_to_curve25519(edSk: Uint8Array, outputFormat: StringOutputFormat): string;
1701
+ /**
1702
+ * @param privateKey (CRYPTO_SIGN_SECRETKEYBYTES bytes)
1703
+ * @param outputFormat Output format (default: Uint8Array)
1704
+ * @returns Uint8Array | string (CRYPTO_SIGN_PUBLICKEYBYTES bytes)
1705
+ */
1706
+ export function crypto_sign_ed25519_sk_to_pk(privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1707
+ export function crypto_sign_ed25519_sk_to_pk(privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
1708
+ /**
1709
+ * @param privateKey (CRYPTO_SIGN_SECRETKEYBYTES bytes)
1710
+ * @param outputFormat Output format (default: Uint8Array)
1711
+ * @returns Uint8Array | string (CRYPTO_SIGN_SEEDBYTES bytes)
1712
+ */
1713
+ export function crypto_sign_ed25519_sk_to_seed(privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1714
+ export function crypto_sign_ed25519_sk_to_seed(privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
1715
+ /**
1716
+ * @param state_address
1717
+ * @param privateKey (CRYPTO_SIGN_SECRETKEYBYTES bytes)
1718
+ * @param outputFormat Output format (default: Uint8Array)
1719
+ * @returns Uint8Array | string (CRYPTO_SIGN_BYTES bytes)
1720
+ */
1721
+ export function crypto_sign_final_create(state_address: StateAddress, privateKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1722
+ export function crypto_sign_final_create(state_address: StateAddress, privateKey: Uint8Array, outputFormat: StringOutputFormat): string;
1723
+ /**
1724
+ * @param state_address
1725
+ * @param signature (CRYPTO_SIGN_BYTES bytes)
1726
+ * @param publicKey (CRYPTO_SIGN_PUBLICKEYBYTES bytes)
1727
+ * @returns boolean
1728
+ */
524
1729
  export function crypto_sign_final_verify(state_address: StateAddress, signature: Uint8Array, publicKey: Uint8Array): boolean;
1730
+ /**
1731
+ * @returns StateAddress
1732
+ */
525
1733
  export function crypto_sign_init(): StateAddress;
526
- export function crypto_sign_keypair(outputFormat?: "uint8array" | "text" | "hex" | "base64"): {publicKey: Uint8Array | string, privateKey: Uint8Array | string, keyType: string};
527
- export function crypto_sign_open(signedMessage: Uint8Array, publicKey: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
528
- export function crypto_sign_seed_keypair(seed: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): {publicKey: Uint8Array | string, privateKey: Uint8Array | string, keyType: string};
1734
+ /**
1735
+ * @param outputFormat Output format (default: Uint8Array)
1736
+ * @returns {publicKey, privateKey, keyType} (CRYPTO_SIGN_PUBLICKEYBYTES bytes)
1737
+ */
1738
+ export function crypto_sign_keypair(outputFormat?: Uint8ArrayOutputFormat | null): { publicKey: Uint8Array; privateKey: Uint8Array; keyType: string };
1739
+ export function crypto_sign_keypair(outputFormat: StringOutputFormat): { publicKey: string; privateKey: string; keyType: string };
1740
+ /**
1741
+ * @param signedMessage
1742
+ * @param publicKey (CRYPTO_SIGN_PUBLICKEYBYTES bytes)
1743
+ * @param outputFormat Output format (default: Uint8Array)
1744
+ * @returns Uint8Array | string (CRYPTO_SIGN_BYTES bytes)
1745
+ */
1746
+ export function crypto_sign_open(signedMessage: Uint8Array, publicKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1747
+ export function crypto_sign_open(signedMessage: Uint8Array, publicKey: Uint8Array, outputFormat: StringOutputFormat): string;
1748
+ /**
1749
+ * @param seed (CRYPTO_SIGN_SEEDBYTES bytes)
1750
+ * @param outputFormat Output format (default: Uint8Array)
1751
+ * @returns {publicKey, privateKey, keyType} (CRYPTO_SIGN_PUBLICKEYBYTES bytes)
1752
+ */
1753
+ export function crypto_sign_seed_keypair(seed: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): { publicKey: Uint8Array; privateKey: Uint8Array; keyType: string };
1754
+ export function crypto_sign_seed_keypair(seed: Uint8Array, outputFormat: StringOutputFormat): { publicKey: string; privateKey: string; keyType: string };
1755
+ /**
1756
+ * @param state_address
1757
+ * @param message_chunk
1758
+ */
529
1759
  export function crypto_sign_update(state_address: StateAddress, message_chunk: Uint8Array | string): void;
1760
+ /**
1761
+ * @param signature (CRYPTO_SIGN_BYTES bytes)
1762
+ * @param message
1763
+ * @param publicKey (CRYPTO_SIGN_PUBLICKEYBYTES bytes)
1764
+ * @returns boolean
1765
+ */
530
1766
  export function crypto_sign_verify_detached(signature: Uint8Array, message: Uint8Array | string, publicKey: Uint8Array): boolean;
531
- export function crypto_stream_chacha20(outLength: number, key: Uint8Array, nonce: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
532
- export function crypto_stream_chacha20_ietf_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
533
- 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;
534
- export function crypto_stream_chacha20_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
535
- export function crypto_stream_chacha20_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
536
- 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;
537
- export function crypto_stream_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
538
- export function crypto_stream_xchacha20_keygen(outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
539
- export function crypto_stream_xchacha20_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
540
- 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;
541
- export function crypto_xof_shake128(out_length: number, message: Uint8Array | string, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1767
+ /**
1768
+ * @param outLength
1769
+ * @param key (CRYPTO_STREAM_CHACHA20_KEYBYTES bytes)
1770
+ * @param nonce (CRYPTO_STREAM_CHACHA20_NONCEBYTES bytes)
1771
+ * @param outputFormat Output format (default: Uint8Array)
1772
+ * @returns Uint8Array | string
1773
+ */
1774
+ export function crypto_stream_chacha20(outLength: number, key: Uint8Array, nonce: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1775
+ export function crypto_stream_chacha20(outLength: number, key: Uint8Array, nonce: Uint8Array, outputFormat: StringOutputFormat): string;
1776
+ /**
1777
+ * @param input_message
1778
+ * @param nonce (CRYPTO_STREAM_CHACHA20_IETF_NONCEBYTES bytes)
1779
+ * @param key (CRYPTO_STREAM_CHACHA20_IETF_KEYBYTES bytes)
1780
+ * @param outputFormat Output format (default: Uint8Array)
1781
+ * @returns Uint8Array | string
1782
+ */
1783
+ export function crypto_stream_chacha20_ietf_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1784
+ export function crypto_stream_chacha20_ietf_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1785
+ /**
1786
+ * @param input_message
1787
+ * @param nonce (CRYPTO_STREAM_CHACHA20_IETF_NONCEBYTES bytes)
1788
+ * @param nonce_increment
1789
+ * @param key (CRYPTO_STREAM_CHACHA20_IETF_KEYBYTES bytes)
1790
+ * @param outputFormat Output format (default: Uint8Array)
1791
+ * @returns Uint8Array | string
1792
+ */
1793
+ export function crypto_stream_chacha20_ietf_xor_ic(input_message: Uint8Array | string, nonce: Uint8Array, nonce_increment: number, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1794
+ export function crypto_stream_chacha20_ietf_xor_ic(input_message: Uint8Array | string, nonce: Uint8Array, nonce_increment: number, key: Uint8Array, outputFormat: StringOutputFormat): string;
1795
+ /**
1796
+ * @param outputFormat Output format (default: Uint8Array)
1797
+ * @returns Uint8Array | string (CRYPTO_STREAM_CHACHA20_KEYBYTES bytes)
1798
+ */
1799
+ export function crypto_stream_chacha20_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1800
+ export function crypto_stream_chacha20_keygen(outputFormat: StringOutputFormat): string;
1801
+ /**
1802
+ * @param input_message
1803
+ * @param nonce (CRYPTO_STREAM_CHACHA20_NONCEBYTES bytes)
1804
+ * @param key (CRYPTO_STREAM_CHACHA20_KEYBYTES bytes)
1805
+ * @param outputFormat Output format (default: Uint8Array)
1806
+ * @returns Uint8Array | string
1807
+ */
1808
+ export function crypto_stream_chacha20_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1809
+ export function crypto_stream_chacha20_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1810
+ /**
1811
+ * @param input_message
1812
+ * @param nonce (CRYPTO_STREAM_CHACHA20_NONCEBYTES bytes)
1813
+ * @param nonce_increment
1814
+ * @param key (CRYPTO_STREAM_CHACHA20_KEYBYTES bytes)
1815
+ * @param outputFormat Output format (default: Uint8Array)
1816
+ * @returns Uint8Array | string
1817
+ */
1818
+ export function crypto_stream_chacha20_xor_ic(input_message: Uint8Array | string, nonce: Uint8Array, nonce_increment: number, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1819
+ export function crypto_stream_chacha20_xor_ic(input_message: Uint8Array | string, nonce: Uint8Array, nonce_increment: number, key: Uint8Array, outputFormat: StringOutputFormat): string;
1820
+ /**
1821
+ * @param outputFormat Output format (default: Uint8Array)
1822
+ * @returns Uint8Array | string (CRYPTO_STREAM_KEYBYTES bytes)
1823
+ */
1824
+ export function crypto_stream_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1825
+ export function crypto_stream_keygen(outputFormat: StringOutputFormat): string;
1826
+ /**
1827
+ * @param outputFormat Output format (default: Uint8Array)
1828
+ * @returns Uint8Array | string (CRYPTO_STREAM_XCHACHA20_KEYBYTES bytes)
1829
+ */
1830
+ export function crypto_stream_xchacha20_keygen(outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1831
+ export function crypto_stream_xchacha20_keygen(outputFormat: StringOutputFormat): string;
1832
+ /**
1833
+ * @param input_message
1834
+ * @param nonce (CRYPTO_STREAM_XCHACHA20_NONCEBYTES bytes)
1835
+ * @param key (CRYPTO_STREAM_XCHACHA20_KEYBYTES bytes)
1836
+ * @param outputFormat Output format (default: Uint8Array)
1837
+ * @returns Uint8Array | string
1838
+ */
1839
+ export function crypto_stream_xchacha20_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1840
+ export function crypto_stream_xchacha20_xor(input_message: Uint8Array | string, nonce: Uint8Array, key: Uint8Array, outputFormat: StringOutputFormat): string;
1841
+ /**
1842
+ * @param input_message
1843
+ * @param nonce (CRYPTO_STREAM_XCHACHA20_NONCEBYTES bytes)
1844
+ * @param nonce_increment
1845
+ * @param key (CRYPTO_STREAM_XCHACHA20_KEYBYTES bytes)
1846
+ * @param outputFormat Output format (default: Uint8Array)
1847
+ * @returns Uint8Array | string
1848
+ */
1849
+ export function crypto_stream_xchacha20_xor_ic(input_message: Uint8Array | string, nonce: Uint8Array, nonce_increment: number, key: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1850
+ export function crypto_stream_xchacha20_xor_ic(input_message: Uint8Array | string, nonce: Uint8Array, nonce_increment: number, key: Uint8Array, outputFormat: StringOutputFormat): string;
1851
+ /**
1852
+ * @param out_length
1853
+ * @param message
1854
+ * @param outputFormat Output format (default: Uint8Array)
1855
+ * @returns Uint8Array | string
1856
+ */
1857
+ export function crypto_xof_shake128(out_length: number, message: Uint8Array | string, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1858
+ export function crypto_xof_shake128(out_length: number, message: Uint8Array | string, outputFormat: StringOutputFormat): string;
1859
+ /**
1860
+ * @returns StateAddress
1861
+ */
542
1862
  export function crypto_xof_shake128_init(): StateAddress;
1863
+ /**
1864
+ * @param domain
1865
+ * @returns StateAddress
1866
+ */
543
1867
  export function crypto_xof_shake128_init_with_domain(domain: number): StateAddress;
544
- export function crypto_xof_shake128_squeeze(state_address: StateAddress, out_length: number, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1868
+ /**
1869
+ * @param state_address
1870
+ * @param out_length
1871
+ * @param outputFormat Output format (default: Uint8Array)
1872
+ * @returns Uint8Array | string
1873
+ */
1874
+ export function crypto_xof_shake128_squeeze(state_address: StateAddress, out_length: number, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1875
+ export function crypto_xof_shake128_squeeze(state_address: StateAddress, out_length: number, outputFormat: StringOutputFormat): string;
1876
+ /**
1877
+ * @param state_address
1878
+ * @param message_chunk
1879
+ */
545
1880
  export function crypto_xof_shake128_update(state_address: StateAddress, message_chunk: Uint8Array | string): void;
546
- export function crypto_xof_shake256(out_length: number, message: Uint8Array | string, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1881
+ /**
1882
+ * @param out_length
1883
+ * @param message
1884
+ * @param outputFormat Output format (default: Uint8Array)
1885
+ * @returns Uint8Array | string
1886
+ */
1887
+ export function crypto_xof_shake256(out_length: number, message: Uint8Array | string, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1888
+ export function crypto_xof_shake256(out_length: number, message: Uint8Array | string, outputFormat: StringOutputFormat): string;
1889
+ /**
1890
+ * @returns StateAddress
1891
+ */
547
1892
  export function crypto_xof_shake256_init(): StateAddress;
1893
+ /**
1894
+ * @param domain
1895
+ * @returns StateAddress
1896
+ */
548
1897
  export function crypto_xof_shake256_init_with_domain(domain: number): StateAddress;
549
- export function crypto_xof_shake256_squeeze(state_address: StateAddress, out_length: number, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1898
+ /**
1899
+ * @param state_address
1900
+ * @param out_length
1901
+ * @param outputFormat Output format (default: Uint8Array)
1902
+ * @returns Uint8Array | string
1903
+ */
1904
+ export function crypto_xof_shake256_squeeze(state_address: StateAddress, out_length: number, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1905
+ export function crypto_xof_shake256_squeeze(state_address: StateAddress, out_length: number, outputFormat: StringOutputFormat): string;
1906
+ /**
1907
+ * @param state_address
1908
+ * @param message_chunk
1909
+ */
550
1910
  export function crypto_xof_shake256_update(state_address: StateAddress, message_chunk: Uint8Array | string): void;
551
- export function crypto_xof_turboshake128(out_length: number, message: Uint8Array | string, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1911
+ /**
1912
+ * @param out_length
1913
+ * @param message
1914
+ * @param outputFormat Output format (default: Uint8Array)
1915
+ * @returns Uint8Array | string
1916
+ */
1917
+ export function crypto_xof_turboshake128(out_length: number, message: Uint8Array | string, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1918
+ export function crypto_xof_turboshake128(out_length: number, message: Uint8Array | string, outputFormat: StringOutputFormat): string;
1919
+ /**
1920
+ * @returns StateAddress
1921
+ */
552
1922
  export function crypto_xof_turboshake128_init(): StateAddress;
1923
+ /**
1924
+ * @param domain
1925
+ * @returns StateAddress
1926
+ */
553
1927
  export function crypto_xof_turboshake128_init_with_domain(domain: number): StateAddress;
554
- export function crypto_xof_turboshake128_squeeze(state_address: StateAddress, out_length: number, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1928
+ /**
1929
+ * @param state_address
1930
+ * @param out_length
1931
+ * @param outputFormat Output format (default: Uint8Array)
1932
+ * @returns Uint8Array | string
1933
+ */
1934
+ export function crypto_xof_turboshake128_squeeze(state_address: StateAddress, out_length: number, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1935
+ export function crypto_xof_turboshake128_squeeze(state_address: StateAddress, out_length: number, outputFormat: StringOutputFormat): string;
1936
+ /**
1937
+ * @param state_address
1938
+ * @param message_chunk
1939
+ */
555
1940
  export function crypto_xof_turboshake128_update(state_address: StateAddress, message_chunk: Uint8Array | string): void;
556
- export function crypto_xof_turboshake256(out_length: number, message: Uint8Array | string, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1941
+ /**
1942
+ * @param out_length
1943
+ * @param message
1944
+ * @param outputFormat Output format (default: Uint8Array)
1945
+ * @returns Uint8Array | string
1946
+ */
1947
+ export function crypto_xof_turboshake256(out_length: number, message: Uint8Array | string, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1948
+ export function crypto_xof_turboshake256(out_length: number, message: Uint8Array | string, outputFormat: StringOutputFormat): string;
1949
+ /**
1950
+ * @returns StateAddress
1951
+ */
557
1952
  export function crypto_xof_turboshake256_init(): StateAddress;
1953
+ /**
1954
+ * @param domain
1955
+ * @returns StateAddress
1956
+ */
558
1957
  export function crypto_xof_turboshake256_init_with_domain(domain: number): StateAddress;
559
- export function crypto_xof_turboshake256_squeeze(state_address: StateAddress, out_length: number, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1958
+ /**
1959
+ * @param state_address
1960
+ * @param out_length
1961
+ * @param outputFormat Output format (default: Uint8Array)
1962
+ * @returns Uint8Array | string
1963
+ */
1964
+ export function crypto_xof_turboshake256_squeeze(state_address: StateAddress, out_length: number, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1965
+ export function crypto_xof_turboshake256_squeeze(state_address: StateAddress, out_length: number, outputFormat: StringOutputFormat): string;
1966
+ /**
1967
+ * @param state_address
1968
+ * @param message_chunk
1969
+ */
560
1970
  export function crypto_xof_turboshake256_update(state_address: StateAddress, message_chunk: Uint8Array | string): void;
561
- export function randombytes_buf(length: number, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
562
- export function randombytes_buf_deterministic(length: number, seed: Uint8Array, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
1971
+ /**
1972
+ * @param length
1973
+ * @param outputFormat Output format (default: Uint8Array)
1974
+ * @returns Uint8Array | string
1975
+ */
1976
+ export function randombytes_buf(length: number, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1977
+ export function randombytes_buf(length: number, outputFormat: StringOutputFormat): string;
1978
+ /**
1979
+ * @param length
1980
+ * @param seed (RANDOMBYTES_SEEDBYTES bytes)
1981
+ * @param outputFormat Output format (default: Uint8Array)
1982
+ * @returns Uint8Array | string
1983
+ */
1984
+ export function randombytes_buf_deterministic(length: number, seed: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
1985
+ export function randombytes_buf_deterministic(length: number, seed: Uint8Array, outputFormat: StringOutputFormat): string;
1986
+ /**
1987
+ */
563
1988
  export function randombytes_close(): void;
1989
+ /**
1990
+ * @returns number
1991
+ */
564
1992
  export function randombytes_random(): number;
1993
+ /**
1994
+ * @param implementation
1995
+ */
565
1996
  export function randombytes_set_implementation(implementation: object): void;
1997
+ /**
1998
+ */
566
1999
  export function randombytes_stir(): void;
2000
+ /**
2001
+ * @param upper_bound
2002
+ * @returns number
2003
+ */
567
2004
  export function randombytes_uniform(upper_bound: number): number;
2005
+ /**
2006
+ * @param bin
2007
+ * @returns Uint8Array
2008
+ */
568
2009
  export function sodium_bin2ip(bin: Uint8Array): Uint8Array;
569
- export function sodium_ip2bin(ip: string, outputFormat?: "uint8array" | "text" | "hex" | "base64"): Uint8Array | string;
2010
+ /**
2011
+ * @param ip
2012
+ * @param outputFormat Output format (default: Uint8Array)
2013
+ * @returns Uint8Array | string
2014
+ */
2015
+ export function sodium_ip2bin(ip: string, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array;
2016
+ export function sodium_ip2bin(ip: string, outputFormat: StringOutputFormat): string;
2017
+ /**
2018
+ * @returns string
2019
+ */
570
2020
  export function sodium_version_string(): string;
571
2021
 
572
2022
  // Internal: list of all exported symbols