go-ethereum/crypto/secp256k1/panic_cb.go
HAOYUatHZ b22944a621
Revert "Substitute secp256k1 library for the L1 version (#22)" (#290)
* Revert "Substitute secp256k1 library for the L1 version (#22)"

This reverts commit 59df2d7ebb.

* goimports -local github.com/scroll-tech/go-ethereum -w .

* go mod tidy
2023-04-19 15:54:20 +08:00

24 lines
665 B
Go

// 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))
}