Create xchacha20NonceLength constant
This commit is contained in:
parent
325a28d8ec
commit
5e3c1cbfba
@ -9,6 +9,7 @@ export {
|
||||
Xchacha20poly1305IetfKey,
|
||||
Xchacha20poly1305IetfMessage,
|
||||
Xchacha20poly1305IetfNonce,
|
||||
xchacha20NonceLength,
|
||||
Argon2id,
|
||||
Argon2idOptions,
|
||||
Ed25519,
|
||||
|
||||
@ -91,6 +91,13 @@ export class Ed25519 {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Nonce length in bytes for all flavours of XChaCha20.
|
||||
*
|
||||
* @see https://libsodium.gitbook.io/doc/advanced/stream_ciphers/xchacha20#notes
|
||||
*/
|
||||
export const xchacha20NonceLength = 24;
|
||||
|
||||
export class Xchacha20poly1305Ietf {
|
||||
public static async encrypt(
|
||||
message: Xchacha20poly1305IetfMessage,
|
||||
|
||||
1
packages/crypto/types/index.d.ts
vendored
1
packages/crypto/types/index.d.ts
vendored
@ -9,6 +9,7 @@ export {
|
||||
Xchacha20poly1305IetfKey,
|
||||
Xchacha20poly1305IetfMessage,
|
||||
Xchacha20poly1305IetfNonce,
|
||||
xchacha20NonceLength,
|
||||
Argon2id,
|
||||
Argon2idOptions,
|
||||
Ed25519,
|
||||
|
||||
6
packages/crypto/types/libsodium.d.ts
vendored
6
packages/crypto/types/libsodium.d.ts
vendored
@ -31,6 +31,12 @@ export declare class Ed25519 {
|
||||
static createSignature(message: Uint8Array, keyPair: Ed25519Keypair): Promise<Uint8Array>;
|
||||
static verifySignature(signature: Uint8Array, message: Uint8Array, pubkey: Uint8Array): Promise<boolean>;
|
||||
}
|
||||
/**
|
||||
* Nonce length in bytes for all flavours of XChaCha20.
|
||||
*
|
||||
* @see https://libsodium.gitbook.io/doc/advanced/stream_ciphers/xchacha20#notes
|
||||
*/
|
||||
export declare const xchacha20NonceLength = 24;
|
||||
export declare class Xchacha20poly1305Ietf {
|
||||
static encrypt(
|
||||
message: Xchacha20poly1305IetfMessage,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user