diff --git a/src/cubehash_impl.h b/src/cubehash_impl.h index 8480372..f4696ad 100644 --- a/src/cubehash_impl.h +++ b/src/cubehash_impl.h @@ -23,6 +23,7 @@ #include "types.h" +#include #include #define ROT(a,b,n) (((a) << (b)) | ((a) >> (n - b))) @@ -99,6 +100,13 @@ public: void process_final_incomplete_block (const byte*data, int n) { int i; + if (data == NULL && n == 0) { + //empty block, finalize + X[31] ^= 1; + rounds (F); + return; + } + assert(data != NULL && n != 0); // if only one is NULL/0, it's a bug for (i = 0; i + 4 <= n; i += 4) #if __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__