Files
nostr/crypto/p8k/ecdh_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

14 lines
318 B
Go

//go:build !linux || android || purego
package secp
import (
"fmt"
"runtime"
)
// ECDH always returns an error on non-Linux platforms
func (c *Context) ECDH(pubkey []byte, seckey []byte) (output []byte, err error) {
return nil, fmt.Errorf("ECDH not supported on %s - use pure Go implementation", runtime.GOOS)
}