bn128 pairing implemented

This commit is contained in:
arnaucube
2018-11-24 01:11:28 +01:00
parent 3dfb1e5875
commit d55d875d7a
15 changed files with 745 additions and 176 deletions

View File

@@ -3,7 +3,6 @@ package shamirsecretsharing
import (
"bytes"
"crypto/rand"
"fmt"
"math/big"
"testing"
@@ -31,14 +30,14 @@ func TestCreate(t *testing.T) {
sharesToUse = append(sharesToUse, shares[0])
secr := LagrangeInterpolation(sharesToUse, p)
fmt.Print("original secret: ")
fmt.Println(k)
fmt.Print("p: ")
fmt.Println(p)
fmt.Print("shares: ")
fmt.Println(shares)
fmt.Print("secret result: ")
fmt.Println(secr)
// fmt.Print("original secret: ")
// fmt.Println(k)
// fmt.Print("p: ")
// fmt.Println(p)
// fmt.Print("shares: ")
// fmt.Println(shares)
// fmt.Print("secret result: ")
// fmt.Println(secr)
if !bytes.Equal(k.Bytes(), secr.Bytes()) {
t.Errorf("reconstructed secret not correspond to original secret")
}