Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some vector crypto extensions are listed, but many aren't, what does that mean? #201

Open
tariqkurd-repo opened this issue Feb 17, 2025 · 4 comments

Comments

@tariqkurd-repo
Copy link

This is taken from the vector crypto specification: https://github.com/riscv/riscv-crypto/releases/download/v20230620/riscv-crypto-spec-vector.pdf as linked from the confluence page https://lf-riscv.atlassian.net/wiki/spaces/HOME/pages/16154655/Vector+Crypto+Standardization+Status+Summary

Image

The highlighted extensions aren't mentioned in the RVA23 profile at all, but the others are.
What does it mean for the ones which aren't highlighted? Can they be implemented whilst remaining compatible? Would implementing any of them require Sstrict to be absent, as they might be considered to be non-conforming?

@ved-rivos
Copy link
Contributor

The Zvkng and Zvksg represent a bundle of extensions:

  • Zvkng = Zvkn + Zvkg = (Zvkned + Zvknhb + Zvkb + Zvkt) + Zvkg
  • Zvksg = Zvks + Zvkg = (Zvksed + Zvksh + Zvkb + Zvkt) + Zvkg

A non-conforming extension is a non-standard extensions that uses standard or reserved encoding space.

@tariqkurd-repo
Copy link
Author

tariqkurd-repo commented Feb 18, 2025

Thanks @ved-rivos that helps, but I still find it very hard to find out which extensions are actually required by a profile as extensions are often wrapped up into other extensions. I doubt I'm the only one with this problem.

So RVA23 lists:

Zvbb
Zvbc
Zvkng = Zvkn + Zvkg = (Zvkned + Zvknhb + Zvkb + Zvkt) + Zvkg
Zvksg = Zvks + Zvkg = (Zvksed + Zvksh + Zvkb + Zvkt) + Zvkg
Zvkt

So if I go down the original list again:

Zvkng - Expanded - Localized Option
Zvksg - Expanded - Localized Option

Zvbb - RVA23 - Mandatory
Zvkt - RVA23 - Mandatory
Zvbc - RVA23 - Development Option
Zvkg - RVA23 - Localized Option (inherited from Zkng)
Zvkned - RVA23 - Localized Option (inherited from Zkng)
Zvknhb - RVA23 - Localized Option (inherited from Zkng)
Zvksed - RVA23 - Localized Option (inherited from Zvksg via Zvks)
Zvksh - RVA23 - Localized Option (inherited from Zvksg via Zvks)
Zvkn - RVA23 - Localized Option (inherited from Zkng via Zvkn)
Zvks - RVA23 - Localized Option (inherited from Zksg)

Zvkb - not in the frozen spec - seems to be a subset of Zvbb so is mandatory?

Zvksc - not in RVA23
Zvknc - not in RVA23
Zvknha - not in RVA23

Zvknha is very hard to find in the ISA spec as it's listed as Zvknh[ab], you have to know to search for Zvknh[ab]

Is my list correct?

In the past there was a spreadsheet showing exactly which extensions are in which profile - is that still available somewhere?
The information required to derive all this is present but very hard to access, which is the point of this issue.

Can we please have a simple table in each profile showing which extensions (including all leaf extensions) are actually required, optional etc. on the RVA23 github page?

@ved-rivos
Copy link
Contributor

ved-rivos commented Feb 18, 2025

Zvksc = Zvks + Zvbc.
Zvknc = Zvkn + Zvbc.
Zvkb is intended to be a subset of Zvbb.
Zvknhb provides SHA-256 and SHA-512; Zvknha provides SHA-256.

@tariqkurd-repo
Copy link
Author

tariqkurd-repo commented Mar 3, 2025

Following this up - there's a mistake in RVB23

Image

It says that Zvkg is not available in RVA23, but it is as part of Zvkng and Zvksg
The challenge of working out which extensions include which others without a tree diagram, and mapping them onto the profles is really difficult. I'm not surprised there's a mistake in it.

It is my belief that of all the Zvk* crypto extensions only Zvbc, Zvknc, Zvksc are optional in RVB23. All the others are optional in both RVA23 and RVB23. Confirmation of that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants