diff options
Diffstat (limited to 'cli/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/panic_cb.go')
| -rw-r--r-- | cli/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/panic_cb.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/cli/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/panic_cb.go b/cli/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/panic_cb.go new file mode 100644 index 0000000..a30b04f --- /dev/null +++ b/cli/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/panic_cb.go @@ -0,0 +1,24 @@ +// 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. + +//go:build !gofuzz && cgo +// +build !gofuzz,cgo + +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)) +} |
