- Jun 17, 2023
-
-
Andrew Waterman authored
This follows from the SAIL code and arguably from the instruction's mnemonic, but make it explicit for readers' benefit.
-
- May 10, 2023
-
-
Ken Dockser authored
Zvk code samples / Proof of Concept (v2)
-
kdockser authored
Bumping the rev and date.
-
kdockser authored
At the recommendation of the ARC, we have removed carryless multiply from the list of extensions included in Zvkn and Zvks. We recommendation that Zvbc is implemented in RISC-V Vector designs as it enables implementation of CRC and elliptic curve cryptography.
-
- May 02, 2023
-
-
Eric Gouriou authored
The sm4-test.c file contains a set of functions verifying and showcasing usage of instructions implementing SM4 algorithm (see [1]) defined by the Zvksed extension (see [2]). Pre-requisites: - riscv64-linux-gnu toolchain available in PATH. - Zvksed-enabled binutils-gdb available in PATH overriding the above toolchain. - Zvksed-enabled Spike available in PATH. - RISC-V Proxy kernel (riscv-pk) compiled and available in ~/RISC-V/riscv64-linux-gnu/bin/pk (can be overridden with PK make variable). The default make target will compile all examples and run them in Spike simulator. Example make invocation: # Build and run Zvksed tests with default parameters make run-sm4 # Override riscv-pk location make run-sm4 PK=/opt/prefix/riscv64-linux-gnu/bin/pk # Override target triplet and riscv-pk location make run-sm4 TARGET=riscv64-unknown-linux-gnu \ PK=/opt/prefix/riscv64-linux-gnu/bin/pk Make targets: - sm4-test - compiles the PoC code. - run-sm4 - Executes the compiled binary in Spike. - clean - Cleans the build artifacts. Make variables: - TARGET - Target triplet to use. By default riscv64-linux-gnu. - PK - Location of the riscv-pk binary. By default it's ~/RISC-V/$(TARGET)/bin/pk See Makefile for more details. [1] https://datatracker.ietf.org/doc/html/draft-ribose-cfrg-sm4-10 [2] https://github.com/riscv/riscv-crypto/releases Signed-off-by:Albert Jakieła <aja@semihalf.com> Signed-off-by:
Eric Gouriou <ego@rivosinc.com>
-
Eric Gouriou authored
The sm3-test.c file contains a set of functions verifying and showcasing usage of instructions implementing SM3 algorithm (see [1]) defined by the Zvksh extension (see [2]). Pre-requisites: - riscv64-linux-gnu toolchain available in PATH. - Zvksh-enabled binutils-gdb available in PATH overriding the above toolchain. - Zvksh-enabled Spike available in PATH. - RISC-V Proxy kernel (riscv-pk) compiled and available in ~/RISC-V/riscv64-linux-gnu/bin/pk (can be overridden with PK make variable). The default make target will compile all examples and run them in Spike simulator. Example make invocation: # Build and run Zvksh tests with default parameters make run-sm3 # Override riscv-pk location make run-sm3 PK=/opt/prefix/riscv64-linux-gnu/bin/pk # Override target triplet and riscv-pk location make run-sm3 TARGET=riscv64-unknown-linux-gnu \ PK=/opt/prefix/riscv64-linux-gnu/bin/pk Make targets: - sm3-test - compiles the PoC code. - run-sm3 - Executes the compiled binary in Spike. - clean - Cleans the build artifacts. Make variables: - TARGET - Target triplet to use. By default riscv64-linux-gnu. - PK - Location of the riscv-pk binary. By default it's ~/RISC-V/$(TARGET)/bin/pk See Makefile for more details. [1] https://datatracker.ietf.org/doc/html/draft-oscca-cfrg-sm3-00 [2] https://github.com/riscv/riscv-crypto/releases Signed-off-by:Eric Gouriou <ego@rivosinc.com> Signed-off-by:
Albert Jakieła <aja@semihalf.com> Signed-off-by:
Kornel Duleba <mindal@semihalf.com> Signed-off-by:
Eric Gouriou <ego@rivosinc.com>
-
Eric Gouriou authored
The sha-test.c file contains a set of functions verifying and showcasing usage of instructions defined by the Zvknha/Zvknhb extensions to implement the SHA-128 and SHA-256 algorithm routines. Pre-requisites: - riscv64-linux-gnu toolchain available in PATH. - zvknh[ab]-enabled binutils-gdb available in PATH overriding the above toolchain. - zvknh[ab]-enabled Spike available in PATH. - RISC-V Proxy kernel (riscv-pk) compiled and available in ~/RISC-V/riscv64-linux-gnu/bin/pk (can be overridden with PK make variable). The default make target will compile all examples and run them in Spike simulator. Example make invocation: # Build and run zvknh[ab] tests with default parameters make run-sha # Override riscv-pk location make run-sha PK=/opt/prefix/riscv64-linux-gnu/bin/pk # Override target triplet and riscv-pk location make run-sha TARGET=riscv64-unknown-linux-gnu \ PK=/opt/prefix/riscv64-linux-gnu/bin/pk Make targets: - sha-test - compiles the PoC code. - run-sha - Executes the compiled binary in Spike. - clean - Cleans the build artifacts. Make variables: - TARGET - Target triplet to use. By default riscv64-linux-gnu. - PK - Location of the riscv-pk binary. By default it's ~/RISC-V/$(TARGET)/bin/pk See Makefile for more details. Signed-off-by:Kornel Dulęba <mindal@semihalf.com> Signed-off-by:
Eric Gouriou <ego@rivosinc.com>
-
Eric Gouriou authored
The GHASH part of AES-GCM is now run twice using instructions from Zvb* and Zvkg extensions and then compared to ensure result validity. Pre-requisites: - riscv64-linux-gnu toolchain available in PATH. - Zvkg-enabled binutils-gdb available in PATH overriding the above toolchain. - Zvkg-enabled Spike available in PATH. - RISC-V Proxy kernel (riscv-pk) compiled and available in ~/RISC-V/riscv64-linux-gnu/bin/pk (can be overridden with PK make variable). The default make target will compile all examples and run them in Spike simulator. Example make invocation: # Build and run Zvkns+Zvkg tests with default parameters make run-aes-gcm # Override riscv-pk location make run-aes-gcm PK=/opt/prefix/riscv64-linux-gnu/bin/pk # Override target triplet and riscv-pk location make run-aes-gcm TARGET=riscv64-unknown-linux-gnu \ PK=/opt/prefix/riscv64-linux-gnu/bin/pk Make targets: - aes-gcm-test - compiles the PoC code. - run-aes-gcm - Executes the compiled binary in Spike. - clean - Cleans the build artifacts. Make variables: - TARGET - Target triplet to use. By default riscv64-linux-gnu. - PK - Location of the riscv-pk binary. By default it's ~/RISC-V/$(TARGET)/bin/pk See Makefile for more details. Signed-off-by:Eric Gouriou <ego@rivosinc.com> Signed-off-by:
Kornel Duleba <mindal@semihalf.com>
-
Eric Gouriou authored
The aes-gcm-test.c file contains a set of functions verifying and showcasing usage of instructions defined by the Zvkned and Zvbb/Zvbc extensions to implement AES-GCM algorithm routines. Pre-requisites: - riscv64-linux-gnu toolchain available in PATH. - zvkned, zvbb, and zvbc enabled binutils-gdb available in PATH overriding the above toolchain. - zvkned, zvbb, and zbbc enabled Spike available in PATH. - RISC-V Proxy kernel (riscv-pk) compiled and available in ~/RISC-V/riscv64-linux-gnu/bin/pk (can be overridden with PK make variable). The default make target will compile all examples and run them in Spike simulator. Example make invocation: # Build and run aes-gcm-test with default parameters make run-aes-gcm # Override riscv-pk location make run-aes-gcm PK=/opt/prefix/riscv64-linux-gnu/bin/pk # Override target triplet and riscv-pk location make run-aes-gcm TARGET=riscv64-unknown-linux-gnu \ PK=/opt/prefix/riscv64-linux-gnu/bin/pk Make targets: - aes-gcm-test - compiles the PoC code. - run-aes-gcm - Executes the compiled binary in Spike. - clean - Cleans the build artifacts. Make variables: - TARGET - Target triplet to use. By default riscv64-linux-gnu. - PK - Location of the riscv-pk binary. By default it's ~/RISC-V/$(TARGET)/bin/pk See Makefile for more details. Signed-off-by:Kornel Dulęba <mindal@semihalf.com> Signed-off-by:
Eric Gouriou <ego@rivosinc.com>
-
Eric Gouriou authored
The aes-cbc-test.c file contains a set of functions verifying and showcasing usage of instructions defined by the Zvkned extension to implement the AES-CBC algorithm routines. Pre-requisites: - riscv64-linux-gnu toolchain available in PATH. - Zvkned-enabled binutils-gdb available in PATH overriding the above toolchain. - Zvkned-enabled Spike available in PATH. - RISC-V Proxy kernel (riscv-pk) compiled and available in ~/RISC-V/riscv64-linux-gnu/bin/pk (can be overridden with PK make variable). The default make target will compile all examples and run them in Spike simulator. Example make invocation: # Build and run Zvkned tests with default parameters make run-aes-cbc # Override riscv-pk location make run-aes-cbc PK=/opt/prefix/riscv64-linux-gnu/bin/pk # Override target triplet and riscv-pk location make run-aes-cbc TARGET=riscv64-unknown-linux-gnu \ PK=/opt/prefix/riscv64-linux-gnu/bin/pk Make targets: - aes-cbc-test - compiles the PoC code. - run-aes-cbc - Executes the compiled binary in Spike. - clean - Cleans the build artifacts. Make variables: - TARGET - Target triplet to use. By default riscv64-linux-gnu. - PK - Location of the riscv-pk binary. By default it's ~/RISC-V/$(TARGET)/bin/pk See Makefile for more details. Signed-off-by:Kornel Dulęba <mindal@semihalf.com> Signed-off-by:
Stanislaw Kardach <kda@semihalf.com> Signed-off-by:
Eric Gouriou <ego@rivosinc.com>
-
Eric Gouriou authored
The zvbc-test.c file contains a set of functions verifying and showcasing usage of instructions defined by the Zvbc extension. Pre-requisites: - riscv64-linux-gnu toolchain available in PATH. - Zvbc-enabled binutils-gdb available in PATH overriding the above toolchain. - Zvbc-enabled Spike available in PATH. - RISC-V Proxy kernel (riscv-pk) compiled and available in ~/RISC-V/riscv64-linux-gnu/bin/pk (can be overridden with PK make variable). The default make target will compile all examples and run them in Spike simulator. Example make invocation: # Build and run Zvbc tests with default parameters make run-zvbc # Override riscv-pk location make run-zvbc PK=/opt/prefix/riscv64-linux-gnu/bin/pk # Override target triplet and riscv-pk location make run-zvbc TARGET=riscv64-unknown-linux-gnu \ PK=/opt/prefix/riscv64-linux-gnu/bin/pk Make targets: - zvbc-test - compiles the PoC code. - run-zvbc - Executes the compiled binary in Spike. - clean - Cleans the build artifacts. Make variables: - TARGET - Target triplet to use. By default riscv64-linux-gnu. - PK - Location of the riscv-pk binary. By default it's ~/RISC-V/$(TARGET)/bin/pk See Makefile for more details. Signed-off-by:Stanislaw Kardach <kda@semihalf.com> Signed-off-by:
Eric Gouriou <ego@rivosinc.com>
-
Eric Gouriou authored
The zvbb-test.c file contains a set of functions verifying and showcasing usage of instructions defined by the Zvbb extension. Pre-requisites: - riscv64-linux-gnu toolchain available in PATH. - Zvbb-enabled binutils-gdb available in PATH overriding the above toolchain. - Zvbb-enabled Spike available in PATH. - RISC-V Proxy kernel (riscv-pk) compiled and available in ~/RISC-V/riscv64-linux-gnu/bin/pk (can be overridden with PK make variable). The default make target will compile all examples and run them in Spike simulator. Example make invocation: # Build and run Zvbb tests with default parameters make run-zvbb # Override riscv-pk location make run-zvbb PK=/opt/prefix/riscv64-linux-gnu/bin/pk # Override target triplet and riscv-pk location make run-zvbb TARGET=riscv64-unknown-linux-gnu \ PK=/opt/prefix/riscv64-linux-gnu/bin/pk Make targets: - zvbb-test - compiles the PoC code. - run-zvbb - Executes the compiled binary in Spike. - clean - Cleans the build artifacts. Make variables: - TARGET - Target triplet to use. By default riscv64-linux-gnu. - PK - Location of the riscv-pk binary. By default it's ~/RISC-V/$(TARGET)/bin/pk See Makefile for more details. Signed-off-by:Stanislaw Kardach <kda@semihalf.com> Signed-off-by:
Eric Gouriou <ego@rivosinc.com>
-
Eric Gouriou authored
Parse the text files with test vectors and generate C headers that can later be used by a test framework. NIST KAT test vectors are used to provide ample coverage. For now parsing of AES-CBC, AES-GCM, SHA-128 and SHA-256 is supported. Signed-off-by:
Eric Gouriou <ego@rivosinc.com> Signed-off-by:
Kornel Dulęba <mindal@semihalf.com> Signed-off-by:
Eric Gouriou <ego@rivosinc.com>
-
- Apr 26, 2023
-
-
kdockser authored
-
Ken Dockser authored
[#318] making explicit in pseudo code than 5-bit imm for vwsll.vi is unsigned
-
- Apr 25, 2023
-
-
Nicolas Brunie authored
Signed-off-by:Nicolas Brunie <82109999+nibrunieAtSi5@users.noreply.github.com>
-
kdockser authored
Bumping the rev number to 0.9
-
kdockser authored
Future extensions might add vghsh.vs and carryless multiply with SEW=32 Clean-up of wording for .vs variants.
-
- Apr 24, 2023
-
-
Ken Dockser authored
Update function names and fix element width references
-
Dongjie Xie authored
- Rename aes_fwd_mixcolumns_fwd to aes_mixcolumns_fwd in vaesem.adoc - Fix function names in vaeskf1.adoc and vaeskf2.adoc - Update element width references in vsha2ms.adoc - Fix broken reference in riscv-crypto-vector-zvkn.adoc
-
- Apr 15, 2023
-
-
Rafael Sene authored
Signed-off-by:Rafael Sene <rafael@riscv.org>
-
- Apr 14, 2023
- Apr 07, 2023
-
-
Ken Dockser authored
Suggestion for small typo in riscv-crypto-vector-zvksg.adoc
-
kdockser authored
-
Nicolas Brunie authored
Signed-off-by:Nicolas Brunie <82109999+nibrunieAtSi5@users.noreply.github.com>
-
kdockser authored
These extensions combine Zvkg with each of Zvkn and Zvks, respectively. These were created for the purpose of inclusion in RVA23 and beyond.
-
- Apr 03, 2023
-
-
Eric Gouriou authored
It simply parses test vectors as defined by NIST and creates a dict. The license part of the file was left intact. Signed-off-by:
Eric Gouriou <ego@rivosinc.com> Signed-off-by:
Kornel Dulęba <mindal@semihalf.com>
-
Eric Gouriou authored
The test vectors were downloaded from offical NIST website. They're stored in form of multiple ZIP archives, e.g. KAT_AES.zip. After being unpacked test vectors from each archive are stored in a separate directory. Signed-off-by:
Eric Gouriou <ego@rivosinc.com> Signed-off-by:
Kornel Dulęba <mindal@semihalf.com> Signed-off-by:
Eric Gouriou <ego@rivosinc.com>
-
Eric Gouriou authored
Add Apache 2.0 license file. The README explains the contents of this repository and how to use it. It refers to content that will be added in later commits. The .gitignore contains references to built files that will be added in upcoming commits. Signed-off-by:
Eric Gouriou <ego@rivosinc.com> Signed-off-by:
Kornel Duleba <mindal@semihalf.com> Signed-off-by:
Stanislaw Kardach <kda@semihalf.com>
-
- Mar 23, 2023
- Mar 22, 2023
-
-
kdockser authored
inst_table_zvbb => inst_table_zvbb_zvbc as it contains bit manip and carryless multiply encodings
-
kdockser authored
Increment the rev
-
Ken Dockser authored
Updating zvkg summary
-
Ken Dockser authored
Suggesting vclz behaviour fix
-
Ken Dockser authored
vghsh behavior cleanup
-
Nicolas Brunie authored
Signed-off-by:Nicolas Brunie <82109999+nibrunieAtSi5@users.noreply.github.com>
-
Nicolas Brunie authored
Signed-off-by:Nicolas Brunie <82109999+nibrunieAtSi5@users.noreply.github.com>
-