Skip to content

Commit

Permalink
Add GitHub Actions workflow (#7)
Browse files Browse the repository at this point in the history
Travis CI does not run anymore.

The GitHub Actions workflow builds and runs, but the nss encrypt fails
at runtime with error code `-8190` - and `PR_GetErrorText` does not
return text for it.

I don't see how to fix it so suggest we merge as-is (the other tests are
run and results are output for them), or to drop nss.
=> PR discussion concluded to merge and davide planning to investigate.
  • Loading branch information
Kissaki authored Mar 15, 2024
2 parents 603759c + b1d8b4a commit 93a4985
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 33 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install dependencies
run: sudo apt-get install libtool libnss3-dev libssl-dev libwolfssl-dev
- name: Checkout libsodium
run: |
mkdir libsodium
cd libsodium
git init
git fetch https://github.com/jedisct1/libsodium.git 3c49e89c19d06d9967180dda887fb15ae2e0fa40
git checkout FETCH_HEAD
git clone -n https://github.com/jedisct1/libsodium.git
- name: Build libsodium
run: |
cd libsodium
./autogen.sh -s
./configure --enable-opt
make -j $(nproc)
make check
sudo make install
sudo ldconfig
- name: Build
run: |
mkdir build
cd build
cmake ..
make -j $(nproc)
- name: CPUInfo
run: cat /proc/cpuinfo
- name: Run
run: ./build/crypto_benchmark
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

42 changes: 40 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,48 @@ Crypto benchmark is a tool for benchmarking modern [AEAD](https://en.wikipedia.o
Due to the use of the old AES-128-OCB algorithm and its slow implementation in [Mumble](https://github.com/mumble-voip/mumble), we decided to determine the best cipher and library for the VoIP communicator.


## Build status
## Result Snapshot (2024, GitHub Actions)

```
$ ./build/crypto_benchmark
[NSS] running AES-256-GCM benchmark...
nss_encrypt(): PK11_Encrypt() failed with error -8190
[NSS] encryption failed!
[NSS] decrypted message doesn't match original, encryption/decryption failure!
[NSS] running ChaCha20-Poly1305 benchmark...
[NSS] 7.172393 seconds for 1000000 iterations, 4096 bytes message
[OpenSSL] running AES-256-GCM benchmark...
[OpenSSL] 2.525026 seconds for 1000000 iterations, 4096 bytes message
[OpenSSL] running AES-256-OCB benchmark...
[OpenSSL] 1.819613 seconds for 1000000 iterations, 4096 bytes message
[OpenSSL] running ChaCha20-Poly1305 benchmark...
[OpenSSL] 4.273006 seconds for 1000000 iterations, 4096 bytes message
[libsodium] running AEGIS-128L benchmark...
[libsodium] 0.647157 seconds for 1000000 iterations, 4096 bytes message
[libsodium] running AEGIS-256 benchmark...
[libsodium] 1.020494 seconds for 1000000 iterations, 4096 bytes message
[libsodium] running AES-256-GCM benchmark...
[libsodium] 4.991140 seconds for 1000000 iterations, 4096 bytes message
[libsodium] running ChaCha20-Poly1305 benchmark...
[libsodium] 6.304524 seconds for 1000000 iterations, 4096 bytes message
[wolfCrypt] running AES-256-GCM benchmark...
[wolfCrypt] Iteration 154518/1000000 (15%), elapsed time: 10.001149
[wolfCrypt] Iteration 309435/1000000 (30%), elapsed time: 20.002294
[wolfCrypt] Iteration 463682/1000000 (46%), elapsed time: 30.003333
[wolfCrypt] Iteration 617833/1000000 (61%), elapsed time: 40.004157
[wolfCrypt] Iteration 772525/1000000 (77%), elapsed time: 50.005194
[wolfCrypt] Iteration 926175/1000000 (92%), elapsed time: 60.006379
[wolfCrypt] 64.802514 seconds for 1000000 iterations, 4096 bytes message
[wolfCrypt] running ChaCha20-Poly1305 benchmark...
[wolfCrypt] Iteration 369566/1000000 (36%), elapsed time: 10.001228
[wolfCrypt] Iteration 739908/1000000 (73%), elapsed time: 20.002314
[wolfCrypt] 27.040796 seconds for 1000000 iterations, 4096 bytes message
Error: Process completed with exit code 1.
```

## Result Snapshot (2022, Travis CI)
We build the project using [Travis CI](https://travis-ci.com), on Ubuntu 18.04, using GCC and Clang compilers, on AMD64 and ARM64 platforms. Current status: [![Build Status](https://travis-ci.com/mumble-voip/crypto-benchmark.svg?branch=master)](https://travis-ci.com/mumble-voip/crypto-benchmark)

## Screenshot / demo
```
$ ./crypto_benchmark
[NSS] running AES-256-GCM benchmark...
Expand Down

0 comments on commit 93a4985

Please sign in to comment.