Files
nostr/crypto/p8k/recovery_other.go
mleku 511bba3a12 Add cross-platform support for crypto/p8k package
- Split all p8k files into *_linux.go and *_other.go variants
- Linux files use purego to load libsecp256k1.so dynamically
- Other platforms (darwin, windows, android, js/wasm) use stub that
  forces fallback to pure Go p256k1.mleku.dev implementation
- Add !android to Linux build tags since Android matches linux but
  purego requires CGO on Android
- Extract shared constants to constants.go (no build tags)
- Enables cross-compilation for macOS, Windows, and Android without
  requiring libsecp256k1 or CGO

Build tags:
- Linux: //go:build linux && !android && !purego
- Other: //go:build !linux || android || purego

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 11:14:46 +00:00

29 lines
1.0 KiB
Go

//go:build !linux || android || purego
package secp
import (
"fmt"
"runtime"
)
// SignRecoverable always returns an error on non-Linux platforms
func (c *Context) SignRecoverable(msg32 []byte, seckey []byte) (sig []byte, err error) {
return nil, fmt.Errorf("recovery not supported on %s", runtime.GOOS)
}
// SerializeRecoverableSignatureCompact always returns an error on non-Linux platforms
func (c *Context) SerializeRecoverableSignatureCompact(sig []byte) (output64 []byte, recid int32, err error) {
return nil, 0, fmt.Errorf("recovery not supported on %s", runtime.GOOS)
}
// ParseRecoverableSignatureCompact always returns an error on non-Linux platforms
func (c *Context) ParseRecoverableSignatureCompact(input64 []byte, recid int32) (sig []byte, err error) {
return nil, fmt.Errorf("recovery not supported on %s", runtime.GOOS)
}
// Recover always returns an error on non-Linux platforms
func (c *Context) Recover(sig []byte, msg32 []byte) (pubkey []byte, err error) {
return nil, fmt.Errorf("recovery not supported on %s", runtime.GOOS)
}