github.com/luckypickle/go-ethereum-vet@v1.14.2/crypto/secp256k1/panic_cb.go (about)

     1  // Copyright 2015 Jeffrey Wilcke, Felix Lange, Gustav Simonsson. All rights reserved.
     2  // Use of this source code is governed by a BSD-style license that can be found in
     3  // the LICENSE file.
     4  
     5  //go:build !gofuzz && cgo
     6  // +build !gofuzz,cgo
     7  
     8  package secp256k1
     9  
    10  import "C"
    11  import "unsafe"
    12  
    13  // Callbacks for converting libsecp256k1 internal faults into
    14  // recoverable Go panics.
    15  
    16  //export vetSecp256k1GoPanicIllegal
    17  func vetSecp256k1GoPanicIllegal(msg *C.char, data unsafe.Pointer) {
    18  	panic("illegal argument: " + C.GoString(msg))
    19  }
    20  
    21  //export vetSecp256k1GoPanicError
    22  func vetSecp256k1GoPanicError(msg *C.char, data unsafe.Pointer) {
    23  	panic("internal error: " + C.GoString(msg))
    24  }