From 314226a267dceeaebc489205ccc60db3eef2233e Mon Sep 17 00:00:00 2001 From: Florian Keller Date: Thu, 10 Jan 2019 10:14:24 +0100 Subject: [PATCH] fix(libsodium-wrappers): Add updates for v0.7.4 --- types/libsodium-wrappers-sumo/index.d.ts | 28 ++++++++++++++++++++++-- types/libsodium-wrappers/index.d.ts | 16 +++++++------- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/types/libsodium-wrappers-sumo/index.d.ts b/types/libsodium-wrappers-sumo/index.d.ts index ceeadd5980..5341cca299 100644 --- a/types/libsodium-wrappers-sumo/index.d.ts +++ b/types/libsodium-wrappers-sumo/index.d.ts @@ -7,10 +7,12 @@ export * from 'libsodium-wrappers'; import { - Uint8ArrayOutputFormat, - StringOutputFormat, + KeyPair, onetimeauth_state_address, state_address, + StringKeyPair, + StringOutputFormat, + Uint8ArrayOutputFormat, } from 'libsodium-wrappers'; export const crypto_auth_hmacsha256_BYTES: number; @@ -77,6 +79,12 @@ export const crypto_stream_xchacha20_KEYBYTES: number; export const crypto_stream_xchacha20_NONCEBYTES: number; +export const crypto_box_curve25519xchacha20poly1305_NONCEBYTES: number; + +export const crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES: number; + +export const crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES: number; + export function crypto_auth_hmacsha256( message: string | Uint8Array, key: Uint8Array, @@ -113,6 +121,18 @@ export function crypto_auth_hmacsha512_keygen(outputFormat?: StringOutputFormat export function crypto_auth_hmacsha512_verify(tag: Uint8Array, message: string | Uint8Array, key: Uint8Array): boolean; +export function crypto_box_curve25519xchacha20poly1305_keypair(publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): KeyPair; + +export function crypto_box_curve25519xchacha20poly1305_keypair(publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: StringOutputFormat | null): StringKeyPair; + +export function crypto_box_curve25519xchacha20poly1305_seal(message: Uint8Array, publicKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array; + +export function crypto_box_curve25519xchacha20poly1305_seal(message: Uint8Array, publicKey: Uint8Array, outputFormat?: StringOutputFormat | null): string; + +export function crypto_box_curve25519xchacha20poly1305_seal_open(ciphertext: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array; + +export function crypto_box_curve25519xchacha20poly1305_seal_open(ciphertext: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: StringOutputFormat | null): string; + export function crypto_hash_sha256( message: string | Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null, @@ -240,6 +260,10 @@ export function crypto_sign_ed25519_sk_to_seed( outputFormat?: StringOutputFormat | null, ): string; +export function crypto_stream_chacha20(outLength: number, key: Uint8Array, nonce: Uint8Array, outputFormat?: StringOutputFormat | null): string; + +export function crypto_stream_chacha20(outLength: number, key: Uint8Array, nonce: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array; + export function crypto_stream_chacha20_ietf_xor( input_message: string | Uint8Array, nonce: Uint8Array, diff --git a/types/libsodium-wrappers/index.d.ts b/types/libsodium-wrappers/index.d.ts index e9213da782..864aa2369f 100644 --- a/types/libsodium-wrappers/index.d.ts +++ b/types/libsodium-wrappers/index.d.ts @@ -886,30 +886,30 @@ export function crypto_secretstream_xchacha20poly1305_keygen(outputFormat?: Uint export function crypto_secretstream_xchacha20poly1305_keygen(outputFormat?: StringOutputFormat | null): string; export function crypto_secretstream_xchacha20poly1305_pull( - state_address?: secretstream_xchacha20poly1305_state_address, - cipher?: string | Uint8Array, + state_address: secretstream_xchacha20poly1305_state_address, + cipher: string | Uint8Array, ad?: string | Uint8Array | null, outputFormat?: Uint8ArrayOutputFormat | null, ): { message: Uint8Array; tag: Uint8Array }; export function crypto_secretstream_xchacha20poly1305_pull( - state_address?: secretstream_xchacha20poly1305_state_address, - cipher?: string | Uint8Array, + state_address: secretstream_xchacha20poly1305_state_address, + cipher: string | Uint8Array, ad?: string | Uint8Array | null, outputFormat?: StringOutputFormat | null, ): { message: string; tag: Uint8Array }; export function crypto_secretstream_xchacha20poly1305_push( - state_address?: secretstream_xchacha20poly1305_state_address, - message_chunk?: string | Uint8Array, + state_address: secretstream_xchacha20poly1305_state_address, + message_chunk: string | Uint8Array, ad?: string | Uint8Array | null, tag?: number, outputFormat?: Uint8ArrayOutputFormat | null, ): Uint8Array; export function crypto_secretstream_xchacha20poly1305_push( - state_address?: secretstream_xchacha20poly1305_state_address, - message_chunk?: string | Uint8Array, + state_address: secretstream_xchacha20poly1305_state_address, + message_chunk: string | Uint8Array, ad?: string | Uint8Array | null, tag?: number, outputFormat?: StringOutputFormat | null,