func Init() { result := int(C.sodium_init()) if result != 0 { panic(fmt.Sprintf("Sodium initialization failed, result code %d.", result)) } }
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)) }
// 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() } }
// initialize sodium func init() { status := C.sodium_init() if status == -1 { log.Fatalf("failed to initialize libsodium status=%d", status) } }
func init() { C.sodium_init() EdDSAPrivateLength = C.crypto_sign_SECRETKEYBYTES EdDSAPublicLength = C.crypto_sign_PUBLICKEYBYTES EdDSASignatureLength = C.crypto_sign_BYTES }
func init() { C.sodium_init() ECDHKeyLength = C.crypto_scalarmult_BYTES }
func InitSodium() { result := int(C.sodium_init()) if result != 0 { panic(fmt.Sprintf("Sodium init failed, errcode %d.", result)) } }
func init() { C.sodium_init() }
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()) }