mkdir build
cd build
cmake ..
make
./../out/ecmh
This project implement a elliptic curve multiset hash scheme.
-
init
method support init from avector<int>
or avector<string>
. -
add
method andoperator+=
support add new element from a singleint/string
or avector<int/string>
. -
erase
method andoperator-=
are similar as above. -
hash2point
method use try then increase apporach. Specifically, we first hash an element$x$ into a hashvalue$h(x)$ (by default using sm3). Then$h(x)$ is used as the x coordinate of elliptic curve(by default using sm2). We use openssl functionEC_POINT_set_compressed_coordinates
set the elliptic point. If the point is not on the curve, we simply increase x coordinate and try again. -
hashValue
gives the hash value of the multiset, viz the elliptic point hex value.