///
import type { StrictUint8Array, SingleInput } from './types'
export interface Ed25519KeyPair {
publicKey: Buffer
privateKey: Buffer
keyType: 'ed25519'
}
export interface X25519KeyPair {
publicKey: Buffer
privateKey: Buffer
curve: 'x25519'
}
export interface SodiumKeys {
box: {
publicKey: Buffer
privateKey: Buffer
keyType: 'x25519'
}
sign: Ed25519KeyPair
secret: Buffer
derived: Buffer
}
export function convertPublicKeyToX25519(publicKey: SingleInput): Promise
export function convertPrivateKeyToX25519(privateKey: SingleInput): Promise
export function genSignKeyPair(seed: SingleInput): Promise
export function genBoxKeyPair(seed: SingleInput): Promise
export function getSodiumKeysFromSeed(seed: SingleInput): Promise
export interface SignDetachedOptions {
message: SingleInput
privateKey: StrictUint8Array
}
export function signDetached(options: SignDetachedOptions): Promise
export interface VerifyDetachedOptions {
message: SingleInput
sig: StrictUint8Array
publicKey: StrictUint8Array
}
export function verifyDetached(options: VerifyDetachedOptions): Promise
export interface SignOptions {
message: SingleInput
privateKey: StrictUint8Array
}
export function sign(options: SignOptions): Promise
export interface SignOpenOptions {
signed: StrictUint8Array
publicKey: StrictUint8Array
}
export function signOpen(options: SignOpenOptions): Promise
export function encryptAEAD(
message: SingleInput,
secretKey: StrictUint8Array,
nonce: SingleInput,
associatedData?: SingleInput
): Promise
export function decryptAEAD(
ciphertext: SingleInput,
secretKey: StrictUint8Array,
nonce: SingleInput,
associatedData?: SingleInput
): Promise
export function encryptSecret(message: SingleInput, secretKey: SingleInput): Promise
export function decryptSecret(
ciphertextWithNonce: SingleInput,
secretKey: SingleInput
): Promise
export function encryptBox(
message: SingleInput,
toPublic: SingleInput,
fromPrivate: SingleInput
): Promise
export function decryptBox(
input: StrictUint8Array,
fromPublic: SingleInput,
toPrivate: SingleInput
): Promise
export function encryptSealedBox(message: SingleInput, toPublic: SingleInput): Promise
export function decryptSealedBox(
input: StrictUint8Array,
toPublic: SingleInput,
toPrivate: SingleInput
): Promise