Skip to content

Commit fd5af39

Browse files
committed
Add Riscv32 testing
add gh actions badge in readme no-std hex
1 parent ddffc61 commit fd5af39

File tree

6 files changed

+30
-7
lines changed

6 files changed

+30
-7
lines changed

.github/workflows/runtest.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,5 @@ jobs:
3838
shell: bash
3939

4040
- name: Test
41-
run: |
42-
chmod 777 ./ci/run-docker.sh
43-
./ci/run-docker.sh ${{ inputs.arch }} ${{ inputs.target }} ${{ inputs.extra-features }}
41+
run: ./ci/run-docker.sh ${{ inputs.arch }} ${{ inputs.target }} ${{ inputs.extra-features }}
4442
shell: bash

.github/workflows/rust.yml

+10
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,16 @@ jobs:
145145
target-features: +zkne,+zknd
146146
extra-features: --features=nightly
147147

148+
test-riscv32:
149+
name: Test of RiscV-32
150+
uses: ./.github/workflows/runtest.yml
151+
with:
152+
arch: riscv32
153+
target: riscv32imac-unknown-none-elf
154+
channel: nightly
155+
target-features: +zkne,+zknd
156+
extra-features: --features=nightly -Zbuild-std
157+
148158
test-software:
149159
strategy:
150160
matrix:

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ constant-time = []
1919
cfg-if = "1.0.0"
2020

2121
[dev-dependencies]
22-
hex = "0.4.3"
22+
hex = { version = "0.4.3", default-features = false }
2323
lazy_static = "1.5.0"

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![Actions Status](https://github.com/sayantn/aes/actions/workflows/rust.yml/badge.svg)](https://github.com/sayantn/aes/actions)
2+
13
This is a pure-Rust platform-agnostic [AES](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197-upd1.pdf) library, that
24
is focused on reusability and optimal performance.
35

ci/docker/riscv32

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM ubuntu:24.04
2+
RUN apt-get update && apt-get install -y --no-install-recommends \
3+
gcc \
4+
ca-certificates \
5+
libc6-dev \
6+
gcc-riscv64-linux-gnu \
7+
libc6-dev-riscv64-cross \
8+
qemu-user \
9+
make \
10+
file
11+
12+
ENV CARGO_TARGET_RISCV32IMAC_UNKNOWN_NONE_ELF_LINKER=riscv64-linux-gnu-gcc \
13+
CARGO_TARGET_RISCV32IMAC_UNKNOWN_NONE_ELF_RUNNER="qemu-riscv32 -L /usr/riscv64-linux-gnu -cpu rv32,zk=true"

ci/run-docker.sh

100644100755
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#!/usr/bin/env sh
1+
#!/usr/bin/env bash
22

33
set -ex
44

55
if [ $# -lt 2 ]; then
6-
>&2 echo "Usage: $0 <ARCH> <TARGET> [<FEATURE>]"
6+
>&2 echo "Usage: $0 <ARCH> <TARGET> [<FEATURE>] [<BUILD-STD>]"
77
exit 1
88
fi
99

@@ -25,4 +25,4 @@ docker run \
2525
--workdir /checkout \
2626
--privileged \
2727
aes \
28-
sh -c "HOME=/tmp PATH=\$PATH:/rust/bin exec cargo test --target ${2} ${3-}"
28+
sh -c "HOME=/tmp PATH=\$PATH:/rust/bin exec cargo test --target ${2} ${3-} ${4-}"

0 commit comments

Comments
 (0)