From 7add2297253d612a37c870be4b1e9bc3fb29ef06 Mon Sep 17 00:00:00 2001 From: Michael Zohner Date: Thu, 28 Jan 2016 14:57:41 +0100 Subject: [PATCH] First stable version for pipelined AES --- src/ot-based/ot-psi.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ot-based/ot-psi.cpp b/src/ot-based/ot-psi.cpp index 06303b4..f1c6e61 100644 --- a/src/ot-based/ot-psi.cpp +++ b/src/ot-based/ot-psi.cpp @@ -660,14 +660,25 @@ void InitOTReceiver(uint8_t* keyMtx, CSocket sock, crypto* crypt) uint8_t* pBuf = (uint8_t*) malloc(crypt->get_hash_bytes() * numbaseOTs * 2); bot->Sender(2, numbaseOTs, sock, pBuf); +#ifdef AES256_HASH2 + //Key expansion + uint8_t* pBufIdx = pBuf; + for(uint32_t i=0; iget_aes_key_bytes(), pBufIdx, crypt->get_aes_key_bytes()); + pBufIdx += crypt->get_hash_bytes(); + memcpy(keyMtx + i * crypt->get_aes_key_bytes() + numbaseOTs * crypt->get_aes_key_bytes(), pBufIdx, crypt->get_aes_key_bytes()); + pBufIdx += crypt->get_hash_bytes(); + } +#else //Key expansion uint8_t* pBufIdx = pBuf; for(uint32_t i=0; iget_aes_key_bytes(), pBufIdx, crypt->get_aes_key_bytes()); pBufIdx += crypt->get_hash_bytes(); - //cout << i/2 << ": " << (hex) << ((uint64_t*)keyMtx)[2*i] << ((uint64_t*)keyMtx)[2*i+1]<< (dec) << endl; } +#endif free(pBuf);