diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..7ed03b2 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,43 @@ +name: Tests + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + testing: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install Dart + uses: dart-lang/setup-dart@v1 + with: + sdk: 'stable' + + - name: Install dependencies + run: dart pub get + + - name: Run tests + run: dart test --coverage=coverage + + - name: Install lcov + run: sudo apt-get install -y lcov + + - name: Generate coverage report + run: | + dart pub global activate coverage + dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --report-on=lib + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: coverage/lcov.info + flags: unittests + name: codecov-umbrella + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index 9949e58..8bd7765 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Tests](https://github.com/JannesNebendahl/dilithium/actions/workflows/dart.yml/badge.svg)](https://github.com/JannesNebendahl/dilithium/actions/workflows/dart.yml) +[![codecov](https://codecov.io/github/JannesNebendahl/dilithium/graph/badge.svg?token=22U0DA66BD)](https://codecov.io/github/JannesNebendahl/dilithium) Dart implementation of the [Dilithium](https://www.pq-crystals.org/dilithium/) signature scheme, which supports all 3 security levels (2, 3, 5) ## Usage @@ -34,8 +36,8 @@ In order to instantiate the keys from a byte representation, the `.deserialize(s Uint8List encodedPublicKey = keyPair.publicKey.serialize(); Uint8List encodedPrivateKey = keyPair.privateKey.serialize(); -DilithiumPublicKey reinstantiatedPublicKey = DilithiumPublicKey.deserialize(DilithiumParameterSpec.LEVEL3, encodedPublicKey); -DilithiumPrivateKey reinstantiatedPrivateKey = DilithiumPrivateKey.deserialize(DilithiumParameterSpec.LEVEL3, encodedPrivateKey); +final reinstantiatedPk = DilithiumPublicKey.deserialize(DilithiumParameterSpec.LEVEL3, encodedPublicKey); +final reinstantiatedSk = DilithiumPrivateKey.deserialize(DilithiumParameterSpec.LEVEL3, encodedPrivateKey); ``` ## What is Dilithium