Skip to content

Commit

Permalink
WIP tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aewag committed Sep 12, 2024
1 parent 17819d1 commit 1f4cdda
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/lms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,49 @@ jobs:
package: ${{ github.workflow }}
target: ${{ matrix.target }}
features: ${{ matrix.features }}

# Demo scripts
demo-lms:
needs: set-msrv
strategy:
matrix:
rust:
- stable
features:
- default

runs-on: ubuntu-latest
defaults:
run:
# Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml
working-directory: .
steps:
- uses: actions/checkout@v4
- uses: RustCrypto/actions/cargo-cache@master
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- run: sh scripts/lms-demo.sh

# Demo scripts
demo-sst:
needs: set-msrv
strategy:
matrix:
rust:
- stable
features:
- default

runs-on: ubuntu-latest
defaults:
run:
# Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml
working-directory: .
steps:
- uses: actions/checkout@v4
- uses: RustCrypto/actions/cargo-cache@master
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- run: sh scripts/sst-demo.sh
6 changes: 6 additions & 0 deletions scripts/lms-demo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
touch message.txt

random="$(dd if=/dev/urandom bs=24 count=1 status=none | hexdump -v -e '/1 "%02X"'; echo)"
cargo run --release --example lms-demo -- genkey mykey 10/2 --seed $random &&
cargo run --release --example lms-demo -- sign mykey message.txt &&
cargo run --release --example lms-demo -- verify mykey message.txt
14 changes: 14 additions & 0 deletions scripts/sst-demo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# touch message.txt

random="$(dd if=/dev/urandom bs=24 count=1 status=none | hexdump -v -e '/1 "%02X"'; echo)"
cargo run --release --example sst-demo -- prepare_keygen mykey 10/8,5/2 --ssts=1/8 \
--auxsize=2048 --seed $random --init_tree_ident
for se_idx in $(seq 2 8);
do
random="$(dd if=/dev/urandom bs=24 count=1 status=none | hexdump -v -e '/1 "%02X"'; echo)"
cargo run --release --example sst-demo -- prepare_keygen mykey 10/8,5/2 --ssts=$se_idx/8 \
--auxsize=2048 --seed $random
done
cargo run --release --example sst-demo -- finalize_keygen mykey 5 &&
cargo run --release --example sst-demo -- sign mykey.5 message.txt &&
cargo run --release --example sst-demo -- verify mykey.5 message.txt

0 comments on commit 1f4cdda

Please sign in to comment.