9 class OTNP:
public OT<OTNP> {
public:
19 gTbl = eb_curve_get_tab();
26 eb_t pk0, pk1, *gr0 =
new eb_t[length], *gr1 =
new eb_t[length];
32 for(
int i = 0; i < length; ++i) {
33 eb_newl(gr0[i], gr1[i]);
36 for(
int i = 0; i < length; ++i) {
39 eb_sub_norm(pk1, C, pk0);
40 eb_mul_fix_norm(gr0[i], gTbl, r0);
41 eb_mul_fix_norm(gr1[i], gTbl, r1);
42 eb_mul_norm(pk0, pk0, r0);
43 eb_mul_norm(pk1, pk1, r1);
48 for(
int i = 0 ; i < length; ++i) {
58 for(
int i =0; i < length; ++i)
59 eb_freel(gr0[i], gr1[i]);
67 bn_t * k =
new bn_t[length];
70 eb_newl(E[0], E[1], pk[0], pk[1]);
71 for(
int i = 0; i < length; ++i) {
76 for(
int i = 0; i< length; ++i) {
78 eb_mul_fix_norm(pk[1], gTbl, k[i]);
79 eb_sub_norm(pk[0], C, pk[1]);
81 eb_mul_fix_norm(pk[0], gTbl, k[i]);
86 for(
int i = 0; i < length; ++i) {
89 int ind = b[i] ? 1 : 0;
90 eb_mul_norm(E[ind], E[ind], k[i]);
93 for(
int i = 0; i < length; ++i) {
96 eb_freel(pk[0], pk[1], E[0], E[1]);
void send_data(const void *data, int nbyte)
Definition: io_channel.h:14
void recv_data(void *data, int nbyte)
Definition: io_channel.h:17
__m128i block
Definition: block.h:8
OTNP(NetIO *io)
Definition: np.h:15
block xorBlocks(block x, block y)
Definition: block.h:35
Definition: net_io_channel.h:22
void recv_impl(block *data, const bool *b, int length)
Definition: np.h:66
void recv_eb(eb_t *eb, size_t num)
Definition: io_channel.h:150
void send_eb(const eb_t *eb, size_t num)
Definition: io_channel.h:140
const char fix_key[]
Definition: block.h:130
bn_t q
Definition: np.h:13
block KDF(eb_t in)
Definition: utils_ec.hpp:20
int cnt
Definition: np.h:10
NetIO * io
Definition: ot.h:9
void initialize_relic()
Definition: utils_ec.hpp:8
void send_impl(const block *data0, const block *data1, int length)
Definition: np.h:24
void random_bn(T t, L... l)
Definition: prg.h:87
eb_t C
Definition: np.h:11
const eb_t * gTbl
Definition: np.h:12
void random_eb(T t, L... l)
Definition: prg.h:113
PRG prg
Definition: np.h:14
eb_t g
Definition: np.h:11