Skip to content

Add the C exports and the Python bindings #24

Description

@tcoratger

Depends on signing and the SSZ encoding landing first.

The Python package is how test vectors get generated and how other implementations can call this specification. The shape is already set by Bls/Exports.lean with bindings/python/bls.c, and by the KZG equivalents: inputs and outputs are ByteArray, booleans come back as UInt8, and the wrapper reads every size at module-init time through the eth_xmss_const_* accessors that already exist in Xmss/Constants.lean, so no size is hardcoded in C.

Export the low-level pieces as well as key generation, signing and verification — the raw hash, the tweaked hash, and the message encoding. That costs a few lines and it is what lets someone whose signing vector fails work out which layer diverged, instead of staring at a 1208-byte mismatch.

Three files to touch besides the Lean: a new bindings/python/xmss.c, a wrapper module under bindings/python/eth_cryptography_specs/xmss/, and setup.py, which globs the Lean object files automatically but names the C sources one by one.

Goes in EthCryptographySpecs/Xmss/Exports.lean plus the binding files.

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