1. Jun 17, 2023
  2. May 10, 2023
  3. May 02, 2023
    • Eric Gouriou's avatar
      Zvksed Proof of Concept · 9f8bff9c
      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: default avatarAlbert Jakieła <aja@semihalf.com>
      Signed-off-by: default avatarEric Gouriou <ego@rivosinc.com>
      9f8bff9c
    • Eric Gouriou's avatar
      Zvksh Proof of Concept · 48754493
      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: default avatarEric Gouriou <ego@rivosinc.com>
      Signed-off-by: default avatarAlbert Jakieła <aja@semihalf.com>
      Signed-off-by: default avatarKornel Duleba <mindal@semihalf.com>
      Signed-off-by: default avatarEric Gouriou <ego@rivosinc.com>
      48754493
    • Eric Gouriou's avatar
      Zvknha/Zvknhb Proof of Concept · 585b90f1
      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: default avatarKornel Dulęba <mindal@semihalf.com>
      Signed-off-by: default avatarEric Gouriou <ego@rivosinc.com>
      585b90f1
    • Eric Gouriou's avatar
      Zvkg Proof of Concept · 0b0571b5
      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: default avatarEric Gouriou <ego@rivosinc.com>
      Signed-off-by: default avatarKornel Duleba <mindal@semihalf.com>
      0b0571b5
    • Eric Gouriou's avatar
      Zvkned+Zvbb+Zvbc AES-GCM Proof of Concept · 0d96309a
      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: default avatarKornel Dulęba <mindal@semihalf.com>
      Signed-off-by: default avatarEric Gouriou <ego@rivosinc.com>
      0d96309a
    • Eric Gouriou's avatar
      Zvkned AES-CBC Proof of Concept · b9f50ba9
      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: default avatarKornel Dulęba <mindal@semihalf.com>
      Signed-off-by: default avatarStanislaw Kardach <kda@semihalf.com>
      Signed-off-by: default avatarEric Gouriou <ego@rivosinc.com>
      b9f50ba9
    • Eric Gouriou's avatar
      Zvbc Proof of Concept · 0526475d
      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: default avatarStanislaw Kardach <kda@semihalf.com>
      Signed-off-by: default avatarEric Gouriou <ego@rivosinc.com>
      0526475d
    • Eric Gouriou's avatar
      Zvbb Proof of Concept · 66844f82
      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: default avatarStanislaw Kardach <kda@semihalf.com>
      Signed-off-by: default avatarEric Gouriou <ego@rivosinc.com>
      66844f82
    • Eric Gouriou's avatar
      Introduce a NIST KAT test generator · 9634ac9d
      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: default avatarEric Gouriou <ego@rivosinc.com>
      Signed-off-by: default avatarKornel Dulęba <mindal@semihalf.com>
      Signed-off-by: default avatarEric Gouriou <ego@rivosinc.com>
      9634ac9d
  4. Apr 26, 2023
  5. Apr 25, 2023
  6. Apr 24, 2023
  7. Apr 15, 2023
  8. Apr 14, 2023
  9. Apr 07, 2023
  10. Apr 03, 2023
  11. Mar 23, 2023
  12. Mar 22, 2023