Commit 0d4a7015 authored by Anders Jensen Løvig's avatar Anders Jensen Løvig
Browse files

lol

parent 8786f516
......@@ -85,7 +85,7 @@ func NewProtocol(params *Params) (p *big.Int, pr Protocol, err error) {
return
}
func (p *Protocol) Encode(m int) (c *big.Int) {
func (p *Protocol) Encrypt(m int) (c *big.Int) {
S := make([]int, p.params.m)
for i := 0; i < p.params.m; i++ {
S[i] = i
......@@ -99,7 +99,7 @@ func (p *Protocol) Encode(m int) (c *big.Int) {
return
}
func (p *Protocol) Decode(c, sKey big.Int) int {
func (p *Protocol) Decrypt(c, sKey big.Int) int {
tmp := c.Mod(&c, &sKey)
m := tmp.Mod(tmp, big.NewInt(2))
return int(m.Int64())
......@@ -107,7 +107,7 @@ func (p *Protocol) Decode(c, sKey big.Int) int {
// Assumes x inputs are negated, so Eval can compute ¬(¬a+b) = a+¬b
func (p *Protocol) Eval(x, y []*big.Int) *big.Int {
one := p.Encode(1)
one := p.Encrypt(1)
tmp := make([]*big.Int, 3)
for i := 0; i < 3; i++ {
xi := x[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