163 karma · joined Feb 28, 2013 (13y ago) · 28 submissions
comment 8y ago · link · parent
comment 8y ago · link · parent
comment 8y ago · link · parent
comment 8y ago · link · parent
(c(mod p)) (mod 2) = (p * q + 2 * r + m (mod p)) (mod 2) = 2r + m (mod 2) = m
This breaks if 2*r > p. Even if you choose r to be small during encryption, the r values accumulate with each homomorphic operation and will eventually be too big. The only restriction stated is that r is "from a different interval than the private key one". This should be made more clear.comment 8y ago · link · parent
comment 8y ago · link · parent
comment 9y ago · link · parent
Also, your double hashing scheme has a bug. You identified that it's problematic if hash_b returns 0, but adding 1 to the result doesn't actually solve anything, because now you have the same problem if hash_b returns num_buckets-1.
comment 11y ago · link · parent
comment 11y ago · link · parent
The randomized variant, by the way, tends to garner roughly the same degree of "you're completely wrong" responses when given to people who know just enough about the normal Monty-hall problem not to be fooled by it.
comment 11y ago · link · parent
void iterative(int n)
{
int from[2][3] = {{0,1,2},{0,2,1}};
int to[2][3] = {{1,2,0},{2,1,0}};
for(int i=1; i<1<<n; i++)
{
int disk = __builtin_ctz(i);
int count = (i>>(1+disk))%3;
int parity = (disk^n)&1;
move(from[parity][count], to[parity][count]);
}
}comment 13y ago · link · parent