Skip to content

Commit

Permalink
First stable version for pipelined AES
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelZohner committed Jan 28, 2016
1 parent 54ab27e commit 7add229
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/ot-based/ot-psi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; i<numbaseOTs; i++ )
{
memcpy(keyMtx + i * crypt->get_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; i<numbaseOTs * 2; i++ )
{
memcpy(keyMtx + i * crypt->get_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);

Expand Down

0 comments on commit 7add229

Please sign in to comment.