diff --git a/.github/workflows/lms.yml b/.github/workflows/lms.yml index e4edd51d..568e5ce6 100644 --- a/.github/workflows/lms.yml +++ b/.github/workflows/lms.yml @@ -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 diff --git a/scripts/lms-demo.sh b/scripts/lms-demo.sh new file mode 100644 index 00000000..25ac3e2d --- /dev/null +++ b/scripts/lms-demo.sh @@ -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 diff --git a/scripts/sst-demo.sh b/scripts/sst-demo.sh new file mode 100644 index 00000000..f5b5add8 --- /dev/null +++ b/scripts/sst-demo.sh @@ -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