Skip to content

Add XMSS test vectors #25

Description

@tcoratger

Depends on the C exports and the Python bindings landing first.

Cross-implementation test vectors, following the layout already used by BLS and KZG: generators under bindings/python/tests/xmss/ that call the spec through the Python bindings and write tests/xmss/<handler>/<case>/data.yaml through dumper.write_case, with one format.md per handler describing the fields.

Handlers worth covering, and the cases that earn their place:

  • the raw hash: the RFC 7693 test vectors, the empty input, and 63, 64 and 65 bytes;
  • the tweaked hash: one case per tweak type, plus cases showing that changing the type, the position, the index or the public parameter changes the output;
  • the message encoding: one admissible encoding, one rejected because a spare bit is set, one rejected because the digits miss 195;
  • key generation: epoch 0, a middle epoch, epoch 2^32 - 1; the same seed twice giving the same key; and two different epoch ranges giving different roots;
  • signing: valid at the start, middle and end of a range; the same inputs twice giving the same signature; an epoch outside the range;
  • verification: a valid signature, then one tampered chain value, one tampered sibling, one tampered randomizer, a wrong epoch, a wrong message, and public keys and signatures of the wrong length.

The negative cases are the point. A test suite that only contains valid signatures passes against an implementation that accepts everything.

One more step that is easy to skip and shouldn't be: run the same inputs through leanEthereum/leanVM once, diff the outputs, and record in format.md which commit of that repository was used. Without it the vectors prove only that this specification agrees with itself.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions