diff --git a/.github/workflows/runtest.yml b/.github/workflows/runtest.yml index 970c7dd..72fdb88 100644 --- a/.github/workflows/runtest.yml +++ b/.github/workflows/runtest.yml @@ -38,7 +38,5 @@ jobs: shell: bash - name: Test - run: | - chmod 777 ./ci/run-docker.sh - ./ci/run-docker.sh ${{ inputs.arch }} ${{ inputs.target }} ${{ inputs.extra-features }} + run: ./ci/run-docker.sh ${{ inputs.arch }} ${{ inputs.target }} ${{ inputs.extra-features }} shell: bash \ No newline at end of file diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f80d8f4..75500bc 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -145,6 +145,16 @@ jobs: target-features: +zkne,+zknd extra-features: --features=nightly + test-riscv32: + name: Test of RiscV-32 + uses: ./.github/workflows/runtest.yml + with: + arch: riscv32 + target: riscv32imac-unknown-none-elf + channel: nightly + target-features: +zkne,+zknd + extra-features: --features=nightly -Zbuild-std + test-software: strategy: matrix: diff --git a/Cargo.toml b/Cargo.toml index 54dc9df..f228e4d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,5 +19,5 @@ constant-time = [] cfg-if = "1.0.0" [dev-dependencies] -hex = "0.4.3" +hex = { version = "0.4.3", default-features = false } lazy_static = "1.5.0" diff --git a/README.md b/README.md index d275b82..db16cc0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Actions Status](https://github.com/sayantn/aes/actions/workflows/rust.yml/badge.svg)](https://github.com/sayantn/aes/actions) + This is a pure-Rust platform-agnostic [AES](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197-upd1.pdf) library, that is focused on reusability and optimal performance. diff --git a/ci/docker/riscv32 b/ci/docker/riscv32 new file mode 100644 index 0000000..b84ad77 --- /dev/null +++ b/ci/docker/riscv32 @@ -0,0 +1,13 @@ +FROM ubuntu:24.04 +RUN apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + ca-certificates \ + libc6-dev \ + gcc-riscv64-linux-gnu \ + libc6-dev-riscv64-cross \ + qemu-user \ + make \ + file + +ENV CARGO_TARGET_RISCV32IMAC_UNKNOWN_NONE_ELF_LINKER=riscv64-linux-gnu-gcc \ + CARGO_TARGET_RISCV32IMAC_UNKNOWN_NONE_ELF_RUNNER="qemu-riscv32 -L /usr/riscv64-linux-gnu -cpu rv32,zk=true" diff --git a/ci/run-docker.sh b/ci/run-docker.sh old mode 100644 new mode 100755 index 8db70d7..5e7dc2a --- a/ci/run-docker.sh +++ b/ci/run-docker.sh @@ -1,9 +1,9 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash set -ex if [ $# -lt 2 ]; then - >&2 echo "Usage: $0 []" + >&2 echo "Usage: $0 [] []" exit 1 fi @@ -25,4 +25,4 @@ docker run \ --workdir /checkout \ --privileged \ aes \ - sh -c "HOME=/tmp PATH=\$PATH:/rust/bin exec cargo test --target ${2} ${3-}" + sh -c "HOME=/tmp PATH=\$PATH:/rust/bin exec cargo test --target ${2} ${3-} ${4-}"