Giter Club home page Giter Club logo

Comments (5)

wangxiao1254 avatar wangxiao1254 commented on July 30, 2024

Actually, why there will be T rounds in each thread? I thought there should be O(1) round in each thread and all threads are in parallel.

from emp-zk.

weikengchen avatar weikengchen commented on July 30, 2024

Let me correct that it would be T / threads rounds but still O(T).

The reason is that after splitting the job of T into each thread, each thread does the T / threads one by one.

for (auto i = start; i < end; ++i) {
	if(party == ALICE) {
		ggm_tree[i] = sparse_vector+i*leave_n;
		senders[i]->compute(ggm_tree[i], secret_share_x, triple_yz[i]);
		senders[i]->template send<OTPre<IO>>(ot, ios[start/width], i);
		if(is_malicious) senders[i]->consistency_check_msg_gen(check_VW_buf[i], ios[start/width]);
		ios[start/width]->flush();
	} else {
		recvers[i]->template recv<OTPre<IO>>(ot, ios[start/width], i);
		ggm_tree[i] = sparse_vector+i*leave_n;
		recvers[i]->compute(ggm_tree[i], triple_yz[i]);
		if(is_malicious) recvers[i]->consistency_check_msg_gen(check_chialpha_buf[i], check_VW_buf[i], ios[start/width], triple_yz[i]);
		ios[start/width]->flush();
	}
}

Ideally, this should still be O(1) round, since we should have the sender always be sending and the receiver always be receiving. In that case, the "round" disappears, as it is merely a stream.

But the problem is that, in this step:

if(is_malicious) senders[i]->consistency_check_msg_gen(check_VW_buf[i], ios[start/width]);

The sender is trying to receive something from the receiver, so the sender is now waiting for the receiver to get back.

For that to happen, the sender needs to wait for the receiver to receive the GGM tree data in

senders[i]->template send<OTPre<IO>>(ot, ios[start/width], i);

So the sender at least waits for the network latency. This is bad because recall that each thread does the job one by one, so each thread essentially waits for network_latency * T / threads.

from emp-zk.

weikengchen avatar weikengchen commented on July 30, 2024

In other words, ideally, when the sender finishes sending the GGM tree info, the sender should immediately go to the next tree and start computing the GGM tree, but now, the sender actually sits there and waits for the challenge for some RTT, not doing the next tree.

from emp-zk.

weikengchen avatar weikengchen commented on July 30, 2024

Adding for reference, in SPCOT SENDer side,

void consistency_check_msg_gen(__uint128_t& V, IO *io2) {
	block seed;

	/************/
	io2->recv_data(&seed, sizeof(block));
	/************/

	__uint128_t *chi = new __uint128_t[leave_n];
	Hash hash;
	__uint128_t digest = mod(_mm_extract_epi64(hash.hash_for_block(&seed, sizeof(block)), 0));
	uni_hash_coeff_gen(chi, digest, leave_n);

	// V = \sum{chi_i*v_i}
	V = vector_inn_prdt_sum_red(chi, (__uint128_t*)ggm_tree, leave_n);

	delete[] chi;
}

It is receiving.

from emp-zk.

wangxiao1254 avatar wangxiao1254 commented on July 30, 2024

You are right! got it!

from emp-zk.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.