Documentation ¶
Index ¶
Constants ¶
const ( D_PBLC = 0x8080 D_MESG = 0x8181 D_LEAF = 0x8282 D_INTR = 0x8383 )
domain separation fields enumerators indicating the message to hash
- D_PBLC = 0x8080 when computing the hash of all of the iterates in the LM-OTS algorithm
- D_MESG = 0x8181 when computing the hash of the message in the LM-OTS algorithms
- D_LEAF = 0x8282 when computing the hash of the leaf of an LMS tree
- D_INTR = 0x8383 when computing the hash of an interior node of an LMS tree
const ( LMOTS_SHAKE256_N32_W2 = iota LMOTS_SHAKE256_N32_W4 )
typecodes as prefix secret key, public key and signature it takes form of "LMOTS_SHAKE{shake}_N{n}_W{w}" where shake is the version of the shake hash to use and n is the byte length of output fetching from the hash function every time w is the bit width of the Winternitz coefficient
const N = 32
N is the security level measured in the bytes length of output of the hash function in use
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LMOpts ¶
type LMOpts struct { // big-endian order bytes for LMOTS_SHAKE{shake}_N{n}_W{w} // typecodes defined in params.go Typecode [4]byte // key pair identifier I [key_id_len]byte // index of the current key pair KeyIdx uint32 }
LMOpts wraps options for key generations, signing and verification
type MetaOpts ¶
type MetaOpts struct {
// contains filtered or unexported fields
}
MetaOpts is a container for the parameter set specification of LM-OTS
var METAOPTS_DEFAULT *MetaOpts
this one is set as default in current implementation
var METAOPTS_SHAKE256_N32_W2, METAOPTS_SHAKE256_N32_W4 *MetaOpts
METAOPTS_SHAKE256_N32_W2: specialized options for n=32, w=2 METAOPTS_SHAKE256_N32_W4: specialized options for n=32, w=4 users should only run the library with one of these provided options otherwise, the correctness of the implementation is unpredictable ALL THESE OPTIONS SHOULD BE **READONLY**
type PrivateKey ¶
PrivateKey as a container for private key, it also embeds its corresponding public key
func GenerateKey ¶
func GenerateKey(opts *LMOpts, rng io.Reader) (*PrivateKey, error)
GenerateKey generates a key pair
func (*PrivateKey) Equal ¶
func (sk *PrivateKey) Equal(rhs *PrivateKey) bool
Equal checks if this key equals to the given one