Skip to content

Implement Zknh #300

Description

@TheDeepestSpace

Spec: https://docs.riscv.org/reference/isa/v20260120/unpriv/scalar-crypto.html#zknh

This is an extension for speeding up operations on SHA2-family hashing algos. It has a bunch of operations related to calculating components of the hashing algorithm which software can then use to perform the complete hashing process for example for SHA256 or SHA512.

This is split into the following steps:

  • Decoder module (to reside in src/ext/zknh/decoder.sv and to be named ext__zkbh__decoder); this implements the decoding mechanism of the extension and produces a signal specifying the type of operation to perform
  • Logic module (to reside in src/ext/zknh/logic.sv and to be named ext__zkbh__logic); this implements the actual semantics of the operation per specification (see "Operation" section of each instruction); it will accept the logic selector from the decoder specifying which instruction to execute
  • Integrate the decoder and logic modules into the corresponding stages, gated by UTOSS_RISCV__ENABLE_ZKNH_EXT macro which needs to be introduced into the makefile for both sims and de1-soc synth
  • Test the extension by enabling Zbkb via RISCOF to make sure it runs the arch-tests.

Generally, the microarchitecutre here will be simialr to that of B's subextensions, so check those out for inspiration.

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

    deTasks related to design engineeringgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions