diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 25d65b6..394a9d6 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -27,8 +27,8 @@ jobs: submodules: recursive # Runs a set of commands using the runners shell - #- name: build boost - # run: python3 build.py --setup --boost --par=4 + # - name: build boost + # run: python3 build.py --setup --boost --par=4 # - name: build relic # run: python3 build.py --setup --relic --par=4 @@ -37,7 +37,7 @@ jobs: # run: python3 build.py --setup --sodium --par=4 - name: build cryptoTools - run: python3 build.py --par=4 #-DENABLE_RELIC=ON -D ENABLE_SODIUM=ON -DENABLE_CIRCUITS=ON + run: python3 build.py --par=4 -DENABLE_RELIC=ON -D ENABLE_SODIUM=ON -DENABLE_CIRCUITS=ON - name: unit tests run: ./out/build/linux/frontend_cryptoTools/frontend_cryptoTools -u diff --git a/cryptoTools/Crypto/AES.h b/cryptoTools/Crypto/AES.h index d65453d..6fc93b8 100644 --- a/cryptoTools/Crypto/AES.h +++ b/cryptoTools/Crypto/AES.h @@ -313,7 +313,7 @@ namespace osuCrypto { } template - void AES::ecbEncCounterMode(block baseIdx, u64 blockLength, block* ciphertext) const + inline void AES::ecbEncCounterMode(block baseIdx, u64 blockLength, block* ciphertext) const { constexpr u64 step = 8; diff --git a/cryptoTools/Crypto/PRNG.cpp b/cryptoTools/Crypto/PRNG.cpp index 7ea1dbc..e6bea77 100644 --- a/cryptoTools/Crypto/PRNG.cpp +++ b/cryptoTools/Crypto/PRNG.cpp @@ -70,13 +70,14 @@ namespace osuCrypto { if (mBytesIdx == mBufferByteCapacity) { - if (lengthu8 >= 8 * sizeof(block)) + while (lengthu8 >= 8 * sizeof(block)) { - span b((block*)destu8, lengthu8 / sizeof(block)); + oc::AlignedArray b; mAes.ecbEncCounterMode(mBlockIdx, b.size(), b.data()); + memcpy(destu8, &b, sizeof(b)); mBlockIdx += b.size(); - step = b.size() * sizeof(block); + step = sizeof(b); destu8 += step; lengthu8 -= step;