diff --git a/packages/crypto/src/libsodium.ts b/packages/crypto/src/libsodium.ts index 5f425fba..a68274cc 100644 --- a/packages/crypto/src/libsodium.ts +++ b/packages/crypto/src/libsodium.ts @@ -6,12 +6,21 @@ import sodium from "libsodium-wrappers"; export interface Argon2idOptions { - // in bytes + /** Output length in bytes */ readonly outputLength: number; - // integer between 1 and 4294967295 + /** + * An integer between 1 and 4294967295 representing the computational difficulty. + * + * @see https://libsodium.gitbook.io/doc/password_hashing/default_phf#key-derivation + */ readonly opsLimit: number; - // memory limit measured in KiB (like argon2 command line tool) - // Note: only ~ 16 MiB of memory are available using the non-sumo version of libsodium + /** + * Memory limit measured in KiB (like argon2 command line tool) + * + * Note: only approximately 16 MiB of memory are available using the non-sumo version of libsodium.js + * + * @see https://libsodium.gitbook.io/doc/password_hashing/default_phf#key-derivation + */ readonly memLimitKib: number; } diff --git a/packages/crypto/types/libsodium.d.ts b/packages/crypto/types/libsodium.d.ts index 6ecd5ce7..00437296 100644 --- a/packages/crypto/types/libsodium.d.ts +++ b/packages/crypto/types/libsodium.d.ts @@ -1,6 +1,19 @@ export interface Argon2idOptions { + /** Output length in bytes */ readonly outputLength: number; + /** + * An integer between 1 and 4294967295 representing the computational difficulty. + * + * @see https://libsodium.gitbook.io/doc/password_hashing/default_phf#key-derivation + */ readonly opsLimit: number; + /** + * Memory limit measured in KiB (like argon2 command line tool) + * + * Note: only approximately 16 MiB of memory are available using the non-sumo version of libsodium.js + * + * @see https://libsodium.gitbook.io/doc/password_hashing/default_phf#key-derivation + */ readonly memLimitKib: number; } export declare class Argon2id {