mirror of
https://github.com/luxfi/chains.git
synced 2026-10-30 14:45:33 +00:00
The Go side of the secp256k1 Metal anchor is built only under cgo && lux_cevm_native && darwin. Its C file carried no constraint at all, so every other build still saw a C source in a package it was compiling without cgo, and refused: "C source files not allowed when not using cgo or SWIG". That took out `go build ./...` for the whole repository, not just this package. A file and its other half now agree about when they exist. Under the tag the anchor is still compiled in — go list reports it in CFiles — and without it, neither half is. Co-authored-by: Hanzo Dev <[email protected]>
18 lines
612 B
C
18 lines
612 B
C
// Copyright (C) 2025-2026, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
//
|
|
// Anchor for the secp256k1 Metal driver symbol. See cpp/ecrecover.cpp in
|
|
// luxcpp/crypto for the dispatch logic that resolves this symbol via dlsym.
|
|
|
|
//go:build cgo && lux_cevm_native && darwin
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
extern int secp256k1_ecrecover_address_batch_metal(
|
|
const uint8_t* inputs, size_t n,
|
|
uint8_t* out_addr, uint8_t* out_st, const char* metallib_path);
|
|
|
|
void* const lux_cevm_secp256k1_metal_anchor =
|
|
(void*)&secp256k1_ecrecover_address_batch_metal;
|