Skip to content

Commit

Permalink
Kyber Testing
Browse files Browse the repository at this point in the history
1. Add a workflow for a kyber test.
2. Fix a couple spots where a flag to use kyber wasn't getting set
   correctly.
3. Changed a check to kyber back to the original source, a local
   variable.
  • Loading branch information
ejohnstown committed May 1, 2024
1 parent d2c4284 commit ec6f046
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 2 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/kyber.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Kyber tests

on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]

jobs:
run_test:
name: Build and run
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 15
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential autoconf automake libtool \
git cmake make
- name: Install and build liboqs
run: |
git clone --depth 1 --branch 0.10.0 https://github.com/open-quantum-safe/liboqs
mkdir -p liboqs/build
cd liboqs/build
cmake -DOQS_MINIMAL_BUILD=KEM_kyber_512 -DOQS_USE_OPENSSL=0 ..
make
sudo make install
- name: Install and build wolfSSL
run: |
git clone --depth 1 https://github.com/wolfssl/wolfssl
cd wolfssl
autoreconf -ivf
./configure --enable-wolfssl --enable-kyber
make
sudo make install
- name: Install and build wolfSSH
run: |
git clone --depth 1 https://github.com/wolfssl/wolfssh
cd wolfssh
autoreconf -ivf
./configure --with-liboqs
make
- name: Run wolfssh tests
working-directory: wolfssh
run: make check
4 changes: 2 additions & 2 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -5133,7 +5133,7 @@ static int DoKexDhReply(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
if (ret == WS_SUCCESS) {
int useKeyPadding = 1;
#if !defined(WOLFSSH_NO_ECDH_NISTP256_KYBER_LEVEL1_SHA256)
doKeyPadding = !ssh->handshake->useEccKyber;
useKeyPadding = !ssh->handshake->useEccKyber;
#endif
ret = GenerateKeys(ssh, hashId, useKeyPadding);
}
Expand Down Expand Up @@ -10639,7 +10639,7 @@ int SendKexDhReply(WOLFSSH* ssh)
if (ret == WS_SUCCESS) {
int doKeyPadding = 1;
#if !defined(WOLFSSH_NO_ECDH_NISTP256_KYBER_LEVEL1_SHA256)
doKeyPadding = !ssh->handshake->useEccKyber;
doKeyPadding = !useEccKyber;
#endif
ret = GenerateKeys(ssh, hashId, doKeyPadding);
}
Expand Down

0 comments on commit ec6f046

Please sign in to comment.