Skip to content

Generate Poseidon round parameters and constants #50

@s1fr0

Description

@s1fr0

Problem

We would like to have a self-contained poseidon module that works natively with arkworks traits, so that round parameters and constants are generated directly from the field characteristic and not hard-coded as now are. This will further enable current and future zerokit modules that use it to access the same Poseidon implementation.

In order to achieve such goal, we can progressively refactor the poseidon implementation currently present in the rln module.

The main required steps should be:

  • Implement GrainLFSR in order to generate constants from hard-coded round parameters (i.e., the tuples (t, RF, RP)) and field characteristic;
  • Pass arkworks PrimeField trait to Poseidon, so that the latter can be instantiated using different curves;
  • Generate in-code round parameters, i.e. port generate_params_poseidon.sage
  • Implement algorithm 1-2-3 from reference implementation to check security of randomly generated MDS matrices. Before implementing these algorithms, we hard-code the number of randomly generated unsecure matrices that should be skipped during generation (value taken from reference implementation);
  • Move the poseidon implementation to a separate module, e.g. under utils. This step can be done at any moment.

Acceptance Criteria

  • Implement all the above steps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    track:zerokitZerokit track (Applied ZK/Explorations)

    Type

    No type

    Projects

    Status

    Later/Icebox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions