Commit 129dade7 authored by Thomas Hoffmann's avatar Thomas Hoffmann
Browse files

Remove hardcoded value

parent 9c10de80
...@@ -56,13 +56,12 @@ func NewProtocol(params *Params) (sKey *big.Int, pr Protocol, err error) { ...@@ -56,13 +56,12 @@ func NewProtocol(params *Params) (sKey *big.Int, pr Protocol, err error) {
} }
func (p *Protocol) Encode(m int) (c *big.Int) { func (p *Protocol) Encode(m int) (c *big.Int) {
SLen := 4 //TODO: Define actual value
S := make([]int, p.params.m) S := make([]int, p.params.m)
for i := 0; i < p.params.m; i++ { for i := 0; i < p.params.m; i++ {
S[i] = i S[i] = i
} }
mRand.Shuffle(p.params.m, func(i,j int) {S[i],S[j] = S[j], S[i]}) mRand.Shuffle(p.params.m, func(i,j int) {S[i],S[j] = S[j], S[i]})
S = S[:SLen-1] S = S[:p.params.m]
c = big.NewInt(int64(m)) c = big.NewInt(int64(m))
for i := range S { for i := range S {
c = c.Add(c, p.pubKey[S[i]]) c = c.Add(c, p.pubKey[S[i]])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment