Module kat_treemath

Module kat_treemath 

Source
Available on (32-bit or 64-bit) and (crate features test-utils) only.
Expand description

§Known Answer Tests for treemath

This test file generates and read test vectors for tree math. See https://github.com/mlswg/mls-implementations/blob/master/test-vectors.md for more description on the test vectors.

§Parameter:

Number of leaves n_leaves.

§Format:

{
    "cipher_suite": /* uint16 */,
    "root": /* uint32 */,
    "left": [ /* array of option<uint32> */ ],
    "right": [ /* array of option<uint32> */ ],
    "parent": [ /* array of option<uint32> */ ],
    "sibling": [ /* array of option<uint32> */ ]
}

Any value that is invalid is represented as null.

§Verification:

  • n_nodes is the number of nodes in the tree with n_leaves leaves
  • root is the root node index of the tree
  • left[i] is the node index of the left child of the node with index i in a tree with n_leaves leaves
  • right[i] is the node index of the right child of the node with index i in a tree with n_leaves leaves
  • parent[i] is the node index of the parent of the node with index i in a tree with n_leaves leaves
  • sibling[i] is the node index of the sibling of the node with index i in a tree with n_leaves leaves

Structs§

TreeMathTestVector

Enums§

TmTestVectorError
TreeMath test vector error

Functions§

generate_test_vector
run_test_vector