From 957efddd4cb6f5954dc3a916a797a58ceab9c88e Mon Sep 17 00:00:00 2001 From: Alexander Wagner Date: Thu, 12 Sep 2024 11:17:38 +0200 Subject: [PATCH] WIP tests --- .github/workflows/lms.yml | 24 ++++++++++++++++++++++++ scripts/lms-demo.sh | 5 +++++ scripts/sst-demo.sh | 10 ++++++++++ 3 files changed, 39 insertions(+) create mode 100644 scripts/lms-demo.sh create mode 100644 scripts/sst-demo.sh diff --git a/.github/workflows/lms.yml b/.github/workflows/lms.yml index e4edd51d..08ecc7c6 100644 --- a/.github/workflows/lms.yml +++ b/.github/workflows/lms.yml @@ -144,3 +144,27 @@ jobs: package: ${{ github.workflow }} target: ${{ matrix.target }} features: ${{ matrix.features }} + + # Demo scripts + demos: + 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 + - run: sh scripts/sst-demo.sh diff --git a/scripts/lms-demo.sh b/scripts/lms-demo.sh new file mode 100644 index 00000000..c2915a69 --- /dev/null +++ b/scripts/lms-demo.sh @@ -0,0 +1,5 @@ +# touch message.txt + +cargo run --release --example lms-demo -- genkey mykey 10/2 --seed 012345670123456701234567012345670123456701234567 +cargo run --release --example lms-demo -- sign mykey message.txt +cargo run --release --example lms-demo -- verify mykey message.txt diff --git a/scripts/sst-demo.sh b/scripts/sst-demo.sh new file mode 100644 index 00000000..b9dc108f --- /dev/null +++ b/scripts/sst-demo.sh @@ -0,0 +1,10 @@ +# touch message.txt + +cargo run --release --example sst-demo -- prepare_keygen mykey 10/8,5/2 --ssts=1/8 --auxsize=2048 \ + --seed=c912a74bc8c5fc1b2a73b96e6ce1eb2317dc9aa49806b30e --init_tree_ident +seq 2 8 | xargs -i{} cargo run --release --example sst-demo -- prepare_keygen mykey 10/8,5/2 --ssts={}/8 --auxsize=2048 \ + --seed=1eb2317dc9aa49806b30e578436d0f659b1f5c912a74bc8c +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