|
@@ -3,6 +3,7 @@
|
|
|
#include "rdpf.hpp"
|
|
|
#include "bitutils.hpp"
|
|
|
#include "aes.hpp"
|
|
|
+#include "prg.hpp"
|
|
|
|
|
|
// Construct a DPF of the given depth to be used for random-access
|
|
|
// memory reads and writes. The DPF is construction collaboratively by
|
|
@@ -26,7 +27,16 @@ void rdpf_gen(MPCTIO &tio, yield_t &yield,
|
|
|
AES_128_Key_Expansion(prgkey, key);
|
|
|
__m128i left, right;
|
|
|
AES_ECB_encrypt(left, set_lsb(seed, 0), prgkey);
|
|
|
- printf("left: "); for(int i=0;i<16;++i) { printf("%02x", ((unsigned char *)&left)[15-i]); } printf("\n");
|
|
|
AES_ECB_encrypt(right, set_lsb(seed, 1), prgkey);
|
|
|
- printf("rght: "); for(int i=0;i<16;++i) { printf("%02x", ((unsigned char *)&right)[15-i]); } printf("\n");
|
|
|
+
|
|
|
+ __m128i nleft, nright, oleft, oright;
|
|
|
+ prg(nleft, seed, 0);
|
|
|
+ prg(nright, seed, 1);
|
|
|
+ prgboth(oleft, oright, seed);
|
|
|
+ printf("left : "); for(int i=0;i<16;++i) { printf("%02x", ((unsigned char *)&left)[15-i]); } printf("\n");
|
|
|
+ printf("nleft: "); for(int i=0;i<16;++i) { printf("%02x", ((unsigned char *)&nleft)[15-i]); } printf("\n");
|
|
|
+ printf("oleft: "); for(int i=0;i<16;++i) { printf("%02x", ((unsigned char *)&oleft)[15-i]); } printf("\n");
|
|
|
+ printf("rght : "); for(int i=0;i<16;++i) { printf("%02x", ((unsigned char *)&right)[15-i]); } printf("\n");
|
|
|
+ printf("nrght: "); for(int i=0;i<16;++i) { printf("%02x", ((unsigned char *)&nright)[15-i]); } printf("\n");
|
|
|
+ printf("orght: "); for(int i=0;i<16;++i) { printf("%02x", ((unsigned char *)&oright)[15-i]); } printf("\n");
|
|
|
}
|