2018-08-07 13:31:06 +00:00
|
|
|
// Copyright 2015 Jeffrey Wilcke, Felix Lange, Gustav Simonsson. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be found in
|
|
|
|
// the LICENSE file.
|
2016-06-14 16:17:44 +00:00
|
|
|
|
2021-06-28 06:53:50 +00:00
|
|
|
// +build !gofuzz
|
|
|
|
// +build cgo
|
|
|
|
|
2016-06-14 16:17:44 +00:00
|
|
|
package secp256k1
|
|
|
|
|
|
|
|
import "C"
|
|
|
|
import "unsafe"
|
|
|
|
|
|
|
|
// Callbacks for converting libsecp256k1 internal faults into
|
|
|
|
// recoverable Go panics.
|
|
|
|
|
|
|
|
//export secp256k1GoPanicIllegal
|
|
|
|
func secp256k1GoPanicIllegal(msg *C.char, data unsafe.Pointer) {
|
|
|
|
panic("illegal argument: " + C.GoString(msg))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export secp256k1GoPanicError
|
|
|
|
func secp256k1GoPanicError(msg *C.char, data unsafe.Pointer) {
|
|
|
|
panic("internal error: " + C.GoString(msg))
|
|
|
|
}
|