Sphincs

template Sphincs (
uint n
uint m
uint n_levels
uint subtree_height
alias hash_n_n
alias hash_2n_n
alias prg
) if (
is_hash_n_n!hash_n_n &&
is_hash_2n_n!hash_2n_n
&&
is_prg!(prg, seed_bytes)
&&
n % 8 == 0
) {
enum n_masks;
enum sk_rand_seed_bytes;
enum secretkey_bytes;
enum publickey_bytes;
}

Members

Functions

keypair
void keypair(out ubyte[secretkey_bytes] sk, out ubyte[publickey_bytes] pk)

Generate a Sphincs keypair.

pubkey
ubyte[publickey_bytes] pubkey(in ref ubyte[secretkey_bytes] sk)

Compute the public key given the secret key.

sign_detached
ubyte[sig_bytes] sign_detached(in ubyte[] message, in ref ubyte[secretkey_bytes] sk)

Generate a detached sphincs256 signature for message.

Parameters

n

Bitlength of hashes in HORST and WOTS.

m

Bitlength of the message hash.

n_levels

Number of subtree-layers of the hyper-tree.

subtree_height

Number of levels of a subtree.

hash_n_n

A hash function mapping n-bit strings to n-bit strings. hash_n_n: {0,1}^n -> {0,1}^n

hash_2n_n

A hash function mapping 2 n-bit strings to n-bit strings. hash_2n_n: {0,1}^n x {0,1}^n -> {0,1}^n

prg

A pseudo random generator function.

Meta