【发布时间】:2017-11-04 19:14:30
【问题描述】:
假设我们有一组整数。有没有办法将它们散列成一个值,这样,只使用散列,我们就可以测试给定的数字是否在原始集合中?
我追求的是一种零知识证明,我可以在不知道原始集合是什么的情况下证明一个数字属于原始集合。
// hash a set of integers
int Hash(Set<int> values) { ... }
// return true, iff n was in the
// original set that formed the hash
int Test(int hash, int n) { ... }
// given a set of integers..
Set<int> theSet = {1,4,5,7};
// is it possible to create a "hash"..
int theHash = Hash(theSet);
// such that, using only the hash, we can test
// if a number was in the original set?
AssertTrue(Test(theHash, 4));
AssertFalse(Test(theHash, 6));
【问题讨论】:
-
你可能想看看布隆过滤器,它是这样的:en.wikipedia.org/wiki/Bloom_filter
标签: hash encoding number-theory