Esempio n. 1
0
func TestSmallConfigHealthyNistQR512(t *testing.T) {
	suite := nist.NewAES128SHA256QR512()
	RoundsPerView := 100
	if err := runTreeSmallConfig(sign.MerkleTree, RoundsPerView, suite, 0); err != nil {
		t.Fatal(err)
	}
}
Esempio n. 2
0
// All Returns a map of all suites
func All() Suites {
	s := make(Suites)
	s.add(nist.NewAES128SHA256P256())
	s.add(nist.NewAES128SHA256QR512())
	s.add(ed25519.NewAES128SHA256Ed25519(false))
	s.add(edwards.NewAES128SHA256Ed25519(false))
	return s
}
Esempio n. 3
0
/**
 * initialize anonClient and encrypted parameters
 */
func initServer() {
	// load controller ip and port
	config := util.ReadConfig()
	ServerAddr, err := net.ResolveUDPAddr("udp", config["coordinator_ip"]+":"+config["coordinator_port"])
	util.CheckErr(err)
	// initialize suite
	suite := nist.NewAES128SHA256QR512()
	a := suite.Secret().Pick(random.Stream)
	A := suite.Point().Mul(nil, a)
	dissentClient = &client.DissentClient{ServerAddr, nil, client.CONFIGURATION, suite, a, A, suite.Point(), nil}
}
/**
 * initialize anon server
 * set ip, port and encryption parameters
 */
func initAnonServer() {
	config = util.ReadConfig()
	// load controller ip and port
	ServerAddr, err := net.ResolveUDPAddr("udp", config["coordinator_ip"]+":"+config["coordinator_port"])
	util.CheckErr(err)
	// initialize suite
	suite := nist.NewAES128SHA256QR512()
	a := suite.Secret().Pick(random.Stream)
	A := suite.Point().Mul(nil, a)
	RoundKey := suite.Secret().Pick(random.Stream)
	anonServer = &server.AnonServer{ServerAddr, nil, suite, a, A, suite.Point(), nil,
		false, ServerAddr, ServerAddr, make(map[string]abstract.Point), nil, RoundKey}
}
Esempio n. 5
0
/**
 * initialize coordinator
 */
func initCoordinator() {
	config := util.ReadConfig()
	fmt.Println(config)
	ServerAddr, err := net.ResolveUDPAddr("udp", "127.0.0.1:"+config["local_port"])
	util.CheckErr(err)
	suite := nist.NewAES128SHA256QR512()
	a := suite.Secret().Pick(random.Stream)
	A := suite.Point().Mul(nil, a)

	anonCoordinator = &coordinator.Coordinator{ServerAddr, nil, nil,
		coordinator.CONFIGURATION, suite, a, A, nil, make(map[string]*net.UDPAddr),
		make(map[string]abstract.Point), make(map[string][]byte), nil, nil,
		make(map[string]int), make(map[string]abstract.Point)}
}
Esempio n. 6
0
func GetSuite(suite string) abstract.Suite {
	var s abstract.Suite
	switch {
	case suite == "nist256":
		s = nist.NewAES128SHA256P256()
	case suite == "nist512":
		s = nist.NewAES128SHA256QR512()
	case suite == "ed25519":
		s = ed25519.NewAES128SHA256Ed25519(true)
	default:
		s = nist.NewAES128SHA256P256()
	}
	return s
}
Esempio n. 7
0
func ProtobufDecodePointList(bytes []byte) []abstract.Point {
	var aPoint abstract.Point
	var tPoint = reflect.TypeOf(&aPoint).Elem()
	suite := nist.NewAES128SHA256QR512()
	cons := protobuf.Constructors{
		tPoint: func() interface{} { return suite.Point() },
	}

	var msg PointList
	if err := protobuf.DecodeWithConstructors(bytes, &msg, cons); err != nil {
		log.Fatal(err)
	}
	return msg.Points
}