Exemple #1
0
func Init() {
	result := int(C.sodium_init())
	if result != 0 {
		panic(fmt.Sprintf("Sodium initialization failed, result code %d.",
			result))
	}
}
Exemple #2
0
func init() {

	if i := C.sodium_init(); i == -1 {
		panic(fmt.Sprintf("Sodium initialization failed, error code is %d", i))
	}

}
func main() {
	result := int(C.sodium_init())
	if result != 0 {
		panic("failed to initialize sodium")
	}
	fmt.Printf("\nstarted matchmaker on port %d\n\n", Port)
	r := mux.NewRouter()
	r.HandleFunc("/match/{protocolId:[0-9]+}/{clientId:[0-9]+}", MatchHandler)
	log.Fatal(http.ListenAndServeTLS(":"+strconv.Itoa(Port), "server.pem", "server.key", r))
}
Exemple #4
0
// initialize sodium
func init() {
	status := C.sodium_init()
	if status == -1 {
		log.Fatalf("failed to initialize libsodium status=%d", status)
	}

	if os.Getenv("SODIUM_TEST") == "1" {
		version_ptr := C.sodium_version_string()
		log.Println("Intialized Sodium", C.GoString(version_ptr))
		TestAll()
	}
}
Exemple #5
0
// initialize sodium
func init() {
	status := C.sodium_init()
	if status == -1 {
		log.Fatalf("failed to initialize libsodium status=%d", status)
	}
}
Exemple #6
0
func init() {
	C.sodium_init()
	EdDSAPrivateLength = C.crypto_sign_SECRETKEYBYTES
	EdDSAPublicLength = C.crypto_sign_PUBLICKEYBYTES
	EdDSASignatureLength = C.crypto_sign_BYTES
}
Exemple #7
0
func init() {
	C.sodium_init()
	ECDHKeyLength = C.crypto_scalarmult_BYTES
}
Exemple #8
0
func InitSodium() {
	result := int(C.sodium_init())
	if result != 0 {
		panic(fmt.Sprintf("Sodium init failed, errcode %d.", result))
	}
}
Exemple #9
0
func init() {
	C.sodium_init()
}
Exemple #10
0
func init() {
	C.sodium_init()
	_AEADKeyLength = int(C.crypto_aead_chacha20poly1305_keybytes())
	_AEADNonceLength = int(C.crypto_aead_chacha20poly1305_npubbytes())
	_AEADOverheadBytes = int(C.crypto_aead_chacha20poly1305_abytes())
}