WebBuf WebBuf
Docs

Post-quantum primitives

@webbuf/slhdsa

Rust/wasm SLH-DSA (FIPS 205) post-quantum hash-based digital signatures

Install

npm install @webbuf/slhdsa

Usage

const { verifyingKey, signingKey } = slhDsaSha2_128fKeyPair();
const signature = slhDsaSha2_128fSign(signingKey, message, context);
const ok = slhDsaSha2_128fVerify(verifyingKey, message, signature, context);

API reference (97 exports)

Constants

SLH_DSA_SHA2_128F

const
SLH_DSA_SHA2_128F: { readonly seedSize: 16; readonly verifyingKeySize: 32; readonly signingKeySize: 64; readonly signatureSize: 17088; }

SLH_DSA_SHA2_128S

const
SLH_DSA_SHA2_128S: { readonly seedSize: 16; readonly verifyingKeySize: 32; readonly signingKeySize: 64; readonly signatureSize: 7856; }

SLH_DSA_SHA2_192F

const
SLH_DSA_SHA2_192F: { readonly seedSize: 24; readonly verifyingKeySize: 48; readonly signingKeySize: 96; readonly signatureSize: 35664; }

SLH_DSA_SHA2_192S

const
SLH_DSA_SHA2_192S: { readonly seedSize: 24; readonly verifyingKeySize: 48; readonly signingKeySize: 96; readonly signatureSize: 16224; }

SLH_DSA_SHA2_256F

const
SLH_DSA_SHA2_256F: { readonly seedSize: 32; readonly verifyingKeySize: 64; readonly signingKeySize: 128; readonly signatureSize: 49856; }

SLH_DSA_SHA2_256S

const
SLH_DSA_SHA2_256S: { readonly seedSize: 32; readonly verifyingKeySize: 64; readonly signingKeySize: 128; readonly signatureSize: 29792; }

SLH_DSA_SHAKE_128F

const
SLH_DSA_SHAKE_128F: { readonly seedSize: 16; readonly verifyingKeySize: 32; readonly signingKeySize: 64; readonly signatureSize: 17088; }

SLH_DSA_SHAKE_128S

const
SLH_DSA_SHAKE_128S: { readonly seedSize: 16; readonly verifyingKeySize: 32; readonly signingKeySize: 64; readonly signatureSize: 7856; }

SLH_DSA_SHAKE_192F

const
SLH_DSA_SHAKE_192F: { readonly seedSize: 24; readonly verifyingKeySize: 48; readonly signingKeySize: 96; readonly signatureSize: 35664; }

SLH_DSA_SHAKE_192S

const
SLH_DSA_SHAKE_192S: { readonly seedSize: 24; readonly verifyingKeySize: 48; readonly signingKeySize: 96; readonly signatureSize: 16224; }

SLH_DSA_SHAKE_256F

const
SLH_DSA_SHAKE_256F: { readonly seedSize: 32; readonly verifyingKeySize: 64; readonly signingKeySize: 128; readonly signatureSize: 49856; }

SLH_DSA_SHAKE_256S

const
SLH_DSA_SHAKE_256S: { readonly seedSize: 32; readonly verifyingKeySize: 64; readonly signingKeySize: 128; readonly signatureSize: 29792; }

Functions

slhDsaSha2_128fKeyPair

function
slhDsaSha2_128fKeyPair(): SlhDsaKeyPair<32, 64>
slhDsaSha2_128fKeyPair(skSeed: FixedBuf<16>, skPrf: FixedBuf<16>, pkSeed: FixedBuf<16>): SlhDsaKeyPair<32, 64>

slhDsaSha2_128fKeyPairDeterministic

function
slhDsaSha2_128fKeyPairDeterministic(skSeed: FixedBuf<16>, skPrf: FixedBuf<16>, pkSeed: FixedBuf<16>): SlhDsaKeyPair<32, 64>

slhDsaSha2_128fSign

function
slhDsaSha2_128fSign(signingKey: FixedBuf<64>, message: WebBuf, context?: WebBuf): FixedBuf<17088>

slhDsaSha2_128fSignDeterministic

function
slhDsaSha2_128fSignDeterministic(signingKey: FixedBuf<64>, message: WebBuf, context?: WebBuf): FixedBuf<17088>

slhDsaSha2_128fSignInternal

function
slhDsaSha2_128fSignInternal(signingKey: FixedBuf<64>, message: WebBuf, addrnd?: FixedBuf<16>): FixedBuf<17088>

slhDsaSha2_128fVerify

function
slhDsaSha2_128fVerify(verifyingKey: FixedBuf<32>, message: WebBuf, signature: FixedBuf<17088>, context?: WebBuf): boolean

slhDsaSha2_128fVerifyInternal

function
slhDsaSha2_128fVerifyInternal(verifyingKey: FixedBuf<32>, message: WebBuf, signature: FixedBuf<17088>): boolean

slhDsaSha2_128sKeyPair

function
slhDsaSha2_128sKeyPair(): SlhDsaKeyPair<32, 64>
slhDsaSha2_128sKeyPair(skSeed: FixedBuf<16>, skPrf: FixedBuf<16>, pkSeed: FixedBuf<16>): SlhDsaKeyPair<32, 64>

slhDsaSha2_128sKeyPairDeterministic

function
slhDsaSha2_128sKeyPairDeterministic(skSeed: FixedBuf<16>, skPrf: FixedBuf<16>, pkSeed: FixedBuf<16>): SlhDsaKeyPair<32, 64>

slhDsaSha2_128sSign

function
slhDsaSha2_128sSign(signingKey: FixedBuf<64>, message: WebBuf, context?: WebBuf): FixedBuf<7856>

slhDsaSha2_128sSignDeterministic

function
slhDsaSha2_128sSignDeterministic(signingKey: FixedBuf<64>, message: WebBuf, context?: WebBuf): FixedBuf<7856>

slhDsaSha2_128sSignInternal

function
slhDsaSha2_128sSignInternal(signingKey: FixedBuf<64>, message: WebBuf, addrnd?: FixedBuf<16>): FixedBuf<7856>

slhDsaSha2_128sVerify

function
slhDsaSha2_128sVerify(verifyingKey: FixedBuf<32>, message: WebBuf, signature: FixedBuf<7856>, context?: WebBuf): boolean

slhDsaSha2_128sVerifyInternal

function
slhDsaSha2_128sVerifyInternal(verifyingKey: FixedBuf<32>, message: WebBuf, signature: FixedBuf<7856>): boolean

slhDsaSha2_192fKeyPair

function
slhDsaSha2_192fKeyPair(): SlhDsaKeyPair<48, 96>
slhDsaSha2_192fKeyPair(skSeed: FixedBuf<24>, skPrf: FixedBuf<24>, pkSeed: FixedBuf<24>): SlhDsaKeyPair<48, 96>

slhDsaSha2_192fKeyPairDeterministic

function
slhDsaSha2_192fKeyPairDeterministic(skSeed: FixedBuf<24>, skPrf: FixedBuf<24>, pkSeed: FixedBuf<24>): SlhDsaKeyPair<48, 96>

slhDsaSha2_192fSign

function
slhDsaSha2_192fSign(signingKey: FixedBuf<96>, message: WebBuf, context?: WebBuf): FixedBuf<35664>

slhDsaSha2_192fSignDeterministic

function
slhDsaSha2_192fSignDeterministic(signingKey: FixedBuf<96>, message: WebBuf, context?: WebBuf): FixedBuf<35664>

slhDsaSha2_192fSignInternal

function
slhDsaSha2_192fSignInternal(signingKey: FixedBuf<96>, message: WebBuf, addrnd?: FixedBuf<24>): FixedBuf<35664>

slhDsaSha2_192fVerify

function
slhDsaSha2_192fVerify(verifyingKey: FixedBuf<48>, message: WebBuf, signature: FixedBuf<35664>, context?: WebBuf): boolean

slhDsaSha2_192fVerifyInternal

function
slhDsaSha2_192fVerifyInternal(verifyingKey: FixedBuf<48>, message: WebBuf, signature: FixedBuf<35664>): boolean

slhDsaSha2_192sKeyPair

function
slhDsaSha2_192sKeyPair(): SlhDsaKeyPair<48, 96>
slhDsaSha2_192sKeyPair(skSeed: FixedBuf<24>, skPrf: FixedBuf<24>, pkSeed: FixedBuf<24>): SlhDsaKeyPair<48, 96>

slhDsaSha2_192sKeyPairDeterministic

function
slhDsaSha2_192sKeyPairDeterministic(skSeed: FixedBuf<24>, skPrf: FixedBuf<24>, pkSeed: FixedBuf<24>): SlhDsaKeyPair<48, 96>

slhDsaSha2_192sSign

function
slhDsaSha2_192sSign(signingKey: FixedBuf<96>, message: WebBuf, context?: WebBuf): FixedBuf<16224>

slhDsaSha2_192sSignDeterministic

function
slhDsaSha2_192sSignDeterministic(signingKey: FixedBuf<96>, message: WebBuf, context?: WebBuf): FixedBuf<16224>

slhDsaSha2_192sSignInternal

function
slhDsaSha2_192sSignInternal(signingKey: FixedBuf<96>, message: WebBuf, addrnd?: FixedBuf<24>): FixedBuf<16224>

slhDsaSha2_192sVerify

function
slhDsaSha2_192sVerify(verifyingKey: FixedBuf<48>, message: WebBuf, signature: FixedBuf<16224>, context?: WebBuf): boolean

slhDsaSha2_192sVerifyInternal

function
slhDsaSha2_192sVerifyInternal(verifyingKey: FixedBuf<48>, message: WebBuf, signature: FixedBuf<16224>): boolean

slhDsaSha2_256fKeyPair

function
slhDsaSha2_256fKeyPair(): SlhDsaKeyPair<64, 128>
slhDsaSha2_256fKeyPair(skSeed: FixedBuf<32>, skPrf: FixedBuf<32>, pkSeed: FixedBuf<32>): SlhDsaKeyPair<64, 128>

slhDsaSha2_256fKeyPairDeterministic

function
slhDsaSha2_256fKeyPairDeterministic(skSeed: FixedBuf<32>, skPrf: FixedBuf<32>, pkSeed: FixedBuf<32>): SlhDsaKeyPair<64, 128>

slhDsaSha2_256fSign

function
slhDsaSha2_256fSign(signingKey: FixedBuf<128>, message: WebBuf, context?: WebBuf): FixedBuf<49856>

slhDsaSha2_256fSignDeterministic

function
slhDsaSha2_256fSignDeterministic(signingKey: FixedBuf<128>, message: WebBuf, context?: WebBuf): FixedBuf<49856>

slhDsaSha2_256fSignInternal

function
slhDsaSha2_256fSignInternal(signingKey: FixedBuf<128>, message: WebBuf, addrnd?: FixedBuf<32>): FixedBuf<49856>

slhDsaSha2_256fVerify

function
slhDsaSha2_256fVerify(verifyingKey: FixedBuf<64>, message: WebBuf, signature: FixedBuf<49856>, context?: WebBuf): boolean

slhDsaSha2_256fVerifyInternal

function
slhDsaSha2_256fVerifyInternal(verifyingKey: FixedBuf<64>, message: WebBuf, signature: FixedBuf<49856>): boolean

slhDsaSha2_256sKeyPair

function
slhDsaSha2_256sKeyPair(): SlhDsaKeyPair<64, 128>
slhDsaSha2_256sKeyPair(skSeed: FixedBuf<32>, skPrf: FixedBuf<32>, pkSeed: FixedBuf<32>): SlhDsaKeyPair<64, 128>

slhDsaSha2_256sKeyPairDeterministic

function
slhDsaSha2_256sKeyPairDeterministic(skSeed: FixedBuf<32>, skPrf: FixedBuf<32>, pkSeed: FixedBuf<32>): SlhDsaKeyPair<64, 128>

slhDsaSha2_256sSign

function
slhDsaSha2_256sSign(signingKey: FixedBuf<128>, message: WebBuf, context?: WebBuf): FixedBuf<29792>

slhDsaSha2_256sSignDeterministic

function
slhDsaSha2_256sSignDeterministic(signingKey: FixedBuf<128>, message: WebBuf, context?: WebBuf): FixedBuf<29792>

slhDsaSha2_256sSignInternal

function
slhDsaSha2_256sSignInternal(signingKey: FixedBuf<128>, message: WebBuf, addrnd?: FixedBuf<32>): FixedBuf<29792>

slhDsaSha2_256sVerify

function
slhDsaSha2_256sVerify(verifyingKey: FixedBuf<64>, message: WebBuf, signature: FixedBuf<29792>, context?: WebBuf): boolean

slhDsaSha2_256sVerifyInternal

function
slhDsaSha2_256sVerifyInternal(verifyingKey: FixedBuf<64>, message: WebBuf, signature: FixedBuf<29792>): boolean

slhDsaShake_128fKeyPair

function
slhDsaShake_128fKeyPair(): SlhDsaKeyPair<32, 64>
slhDsaShake_128fKeyPair(skSeed: FixedBuf<16>, skPrf: FixedBuf<16>, pkSeed: FixedBuf<16>): SlhDsaKeyPair<32, 64>

slhDsaShake_128fKeyPairDeterministic

function
slhDsaShake_128fKeyPairDeterministic(skSeed: FixedBuf<16>, skPrf: FixedBuf<16>, pkSeed: FixedBuf<16>): SlhDsaKeyPair<32, 64>

slhDsaShake_128fSign

function
slhDsaShake_128fSign(signingKey: FixedBuf<64>, message: WebBuf, context?: WebBuf): FixedBuf<17088>

slhDsaShake_128fSignDeterministic

function
slhDsaShake_128fSignDeterministic(signingKey: FixedBuf<64>, message: WebBuf, context?: WebBuf): FixedBuf<17088>

slhDsaShake_128fSignInternal

function
slhDsaShake_128fSignInternal(signingKey: FixedBuf<64>, message: WebBuf, addrnd?: FixedBuf<16>): FixedBuf<17088>

slhDsaShake_128fVerify

function
slhDsaShake_128fVerify(verifyingKey: FixedBuf<32>, message: WebBuf, signature: FixedBuf<17088>, context?: WebBuf): boolean

slhDsaShake_128fVerifyInternal

function
slhDsaShake_128fVerifyInternal(verifyingKey: FixedBuf<32>, message: WebBuf, signature: FixedBuf<17088>): boolean

slhDsaShake_128sKeyPair

function
slhDsaShake_128sKeyPair(): SlhDsaKeyPair<32, 64>
slhDsaShake_128sKeyPair(skSeed: FixedBuf<16>, skPrf: FixedBuf<16>, pkSeed: FixedBuf<16>): SlhDsaKeyPair<32, 64>

slhDsaShake_128sKeyPairDeterministic

function
slhDsaShake_128sKeyPairDeterministic(skSeed: FixedBuf<16>, skPrf: FixedBuf<16>, pkSeed: FixedBuf<16>): SlhDsaKeyPair<32, 64>

slhDsaShake_128sSign

function
slhDsaShake_128sSign(signingKey: FixedBuf<64>, message: WebBuf, context?: WebBuf): FixedBuf<7856>

slhDsaShake_128sSignDeterministic

function
slhDsaShake_128sSignDeterministic(signingKey: FixedBuf<64>, message: WebBuf, context?: WebBuf): FixedBuf<7856>

slhDsaShake_128sSignInternal

function
slhDsaShake_128sSignInternal(signingKey: FixedBuf<64>, message: WebBuf, addrnd?: FixedBuf<16>): FixedBuf<7856>

slhDsaShake_128sVerify

function
slhDsaShake_128sVerify(verifyingKey: FixedBuf<32>, message: WebBuf, signature: FixedBuf<7856>, context?: WebBuf): boolean

slhDsaShake_128sVerifyInternal

function
slhDsaShake_128sVerifyInternal(verifyingKey: FixedBuf<32>, message: WebBuf, signature: FixedBuf<7856>): boolean

slhDsaShake_192fKeyPair

function
slhDsaShake_192fKeyPair(): SlhDsaKeyPair<48, 96>
slhDsaShake_192fKeyPair(skSeed: FixedBuf<24>, skPrf: FixedBuf<24>, pkSeed: FixedBuf<24>): SlhDsaKeyPair<48, 96>

slhDsaShake_192fKeyPairDeterministic

function
slhDsaShake_192fKeyPairDeterministic(skSeed: FixedBuf<24>, skPrf: FixedBuf<24>, pkSeed: FixedBuf<24>): SlhDsaKeyPair<48, 96>

slhDsaShake_192fSign

function
slhDsaShake_192fSign(signingKey: FixedBuf<96>, message: WebBuf, context?: WebBuf): FixedBuf<35664>

slhDsaShake_192fSignDeterministic

function
slhDsaShake_192fSignDeterministic(signingKey: FixedBuf<96>, message: WebBuf, context?: WebBuf): FixedBuf<35664>

slhDsaShake_192fSignInternal

function
slhDsaShake_192fSignInternal(signingKey: FixedBuf<96>, message: WebBuf, addrnd?: FixedBuf<24>): FixedBuf<35664>

slhDsaShake_192fVerify

function
slhDsaShake_192fVerify(verifyingKey: FixedBuf<48>, message: WebBuf, signature: FixedBuf<35664>, context?: WebBuf): boolean

slhDsaShake_192fVerifyInternal

function
slhDsaShake_192fVerifyInternal(verifyingKey: FixedBuf<48>, message: WebBuf, signature: FixedBuf<35664>): boolean

slhDsaShake_192sKeyPair

function
slhDsaShake_192sKeyPair(): SlhDsaKeyPair<48, 96>
slhDsaShake_192sKeyPair(skSeed: FixedBuf<24>, skPrf: FixedBuf<24>, pkSeed: FixedBuf<24>): SlhDsaKeyPair<48, 96>

slhDsaShake_192sKeyPairDeterministic

function
slhDsaShake_192sKeyPairDeterministic(skSeed: FixedBuf<24>, skPrf: FixedBuf<24>, pkSeed: FixedBuf<24>): SlhDsaKeyPair<48, 96>

slhDsaShake_192sSign

function
slhDsaShake_192sSign(signingKey: FixedBuf<96>, message: WebBuf, context?: WebBuf): FixedBuf<16224>

slhDsaShake_192sSignDeterministic

function
slhDsaShake_192sSignDeterministic(signingKey: FixedBuf<96>, message: WebBuf, context?: WebBuf): FixedBuf<16224>

slhDsaShake_192sSignInternal

function
slhDsaShake_192sSignInternal(signingKey: FixedBuf<96>, message: WebBuf, addrnd?: FixedBuf<24>): FixedBuf<16224>

slhDsaShake_192sVerify

function
slhDsaShake_192sVerify(verifyingKey: FixedBuf<48>, message: WebBuf, signature: FixedBuf<16224>, context?: WebBuf): boolean

slhDsaShake_192sVerifyInternal

function
slhDsaShake_192sVerifyInternal(verifyingKey: FixedBuf<48>, message: WebBuf, signature: FixedBuf<16224>): boolean

slhDsaShake_256fKeyPair

function
slhDsaShake_256fKeyPair(): SlhDsaKeyPair<64, 128>
slhDsaShake_256fKeyPair(skSeed: FixedBuf<32>, skPrf: FixedBuf<32>, pkSeed: FixedBuf<32>): SlhDsaKeyPair<64, 128>

slhDsaShake_256fKeyPairDeterministic

function
slhDsaShake_256fKeyPairDeterministic(skSeed: FixedBuf<32>, skPrf: FixedBuf<32>, pkSeed: FixedBuf<32>): SlhDsaKeyPair<64, 128>

slhDsaShake_256fSign

function
slhDsaShake_256fSign(signingKey: FixedBuf<128>, message: WebBuf, context?: WebBuf): FixedBuf<49856>

slhDsaShake_256fSignDeterministic

function
slhDsaShake_256fSignDeterministic(signingKey: FixedBuf<128>, message: WebBuf, context?: WebBuf): FixedBuf<49856>

slhDsaShake_256fSignInternal

function
slhDsaShake_256fSignInternal(signingKey: FixedBuf<128>, message: WebBuf, addrnd?: FixedBuf<32>): FixedBuf<49856>

slhDsaShake_256fVerify

function
slhDsaShake_256fVerify(verifyingKey: FixedBuf<64>, message: WebBuf, signature: FixedBuf<49856>, context?: WebBuf): boolean

slhDsaShake_256fVerifyInternal

function
slhDsaShake_256fVerifyInternal(verifyingKey: FixedBuf<64>, message: WebBuf, signature: FixedBuf<49856>): boolean

slhDsaShake_256sKeyPair

function
slhDsaShake_256sKeyPair(): SlhDsaKeyPair<64, 128>
slhDsaShake_256sKeyPair(skSeed: FixedBuf<32>, skPrf: FixedBuf<32>, pkSeed: FixedBuf<32>): SlhDsaKeyPair<64, 128>

slhDsaShake_256sKeyPairDeterministic

function
slhDsaShake_256sKeyPairDeterministic(skSeed: FixedBuf<32>, skPrf: FixedBuf<32>, pkSeed: FixedBuf<32>): SlhDsaKeyPair<64, 128>

slhDsaShake_256sSign

function
slhDsaShake_256sSign(signingKey: FixedBuf<128>, message: WebBuf, context?: WebBuf): FixedBuf<29792>

slhDsaShake_256sSignDeterministic

function
slhDsaShake_256sSignDeterministic(signingKey: FixedBuf<128>, message: WebBuf, context?: WebBuf): FixedBuf<29792>

slhDsaShake_256sSignInternal

function
slhDsaShake_256sSignInternal(signingKey: FixedBuf<128>, message: WebBuf, addrnd?: FixedBuf<32>): FixedBuf<29792>

slhDsaShake_256sVerify

function
slhDsaShake_256sVerify(verifyingKey: FixedBuf<64>, message: WebBuf, signature: FixedBuf<29792>, context?: WebBuf): boolean

slhDsaShake_256sVerifyInternal

function
slhDsaShake_256sVerifyInternal(verifyingKey: FixedBuf<64>, message: WebBuf, signature: FixedBuf<29792>): boolean

Interfaces

SlhDsaKeyPair

interface
verifyingKey: FixedBuf<VkSize>
signingKey: FixedBuf<SkSize>