Skip to content

Commit

Permalink
fix: initialize context after reset in ossl_sha3x4 (#1339)
Browse files Browse the repository at this point in the history
* fix: initialize context after reset in ossl_sha3x4

* add Github Actions config for openssl-all
  • Loading branch information
bhess authored Jan 4, 2023
1 parent 2e42595 commit 12ad5be
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ jobs:
container: openquantumsafe/ci-alpine-amd64:latest
CMAKE_ARGS: -DOQS_USE_OPENSSL=ON -DBUILD_SHARED_LIBS=ON
PYTEST_ARGS: --ignore=tests/test_alg_info.py
- name: alpine-openssl-all
container: openquantumsafe/ci-alpine-amd64:latest
CMAKE_ARGS: -DOQS_USE_OPENSSL=ON -DBUILD_SHARED_LIBS=ON -DOQS_USE_AES_OPENSSL=ON -DOQS_USE_SHA2_OPENSSL=ON -DOQS_USE_SHA3_OPENSSL=ON
PYTEST_ARGS: --ignore=tests/test_alg_info.py
- name: alpine-noopenssl
container: openquantumsafe/ci-alpine-amd64:latest
CMAKE_ARGS: -DOQS_USE_OPENSSL=OFF
Expand Down
8 changes: 8 additions & 0 deletions src/common/sha3/ossl_sha3x4.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ void OQS_SHA3_shake128_x4_inc_ctx_reset(OQS_SHA3_shake128_x4_inc_ctx *state) {
EVP_MD_CTX_reset(s->mdctx1);
EVP_MD_CTX_reset(s->mdctx2);
EVP_MD_CTX_reset(s->mdctx3);
EVP_DigestInit_ex(s->mdctx0, EVP_shake128(), NULL);
EVP_DigestInit_ex(s->mdctx1, EVP_shake128(), NULL);
EVP_DigestInit_ex(s->mdctx2, EVP_shake128(), NULL);
EVP_DigestInit_ex(s->mdctx3, EVP_shake128(), NULL);
s->n_out = 0;
}

Expand Down Expand Up @@ -236,6 +240,10 @@ void OQS_SHA3_shake256_x4_inc_ctx_reset(OQS_SHA3_shake256_x4_inc_ctx *state) {
EVP_MD_CTX_reset(s->mdctx1);
EVP_MD_CTX_reset(s->mdctx2);
EVP_MD_CTX_reset(s->mdctx3);
EVP_DigestInit_ex(s->mdctx0, EVP_shake256(), NULL);
EVP_DigestInit_ex(s->mdctx1, EVP_shake256(), NULL);
EVP_DigestInit_ex(s->mdctx2, EVP_shake256(), NULL);
EVP_DigestInit_ex(s->mdctx3, EVP_shake256(), NULL);
s->n_out = 0;
}

Expand Down

0 comments on commit 12ad5be

Please sign in to comment.