mirror of
https://github.com/luxfi/accel.git
synced 2026-10-30 17:03:45 +00:00
The lux_hqc_native opt-in tag made native HQC off-by-default, so plain 'go build' silently shipped the stub and HQC needed -tags to work. That was the wrong call. Native is now THE default cgo path (code_cpu.go, //go:build cgo) linking libluxgpu_hqc from the installed lux-gpu keg; only CGO_ENABLED=0 (code_nocgo.go) uses the stub. No tag needed. Verified: CGO=1 go build/test/bench ./ops/code/ runs native HQC with zero tags (lux-gpu installed at /opt/homebrew/opt/lux-gpu); CGO=0 still compiles the stub. Full accel suite green (7/7, no tags). Co-authored-by: Hanzo Dev <[email protected]>
62 lines
1.4 KiB
Go
62 lines
1.4 KiB
Go
// Copyright (C) 2024-2026, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
//go:build !cgo
|
|
|
|
// Pure-Go stub for the CPU path, used only in no-cgo builds
|
|
// (CGO_ENABLED=0). The default build (cgo) links the native HQC
|
|
// reference via code_cpu.go; this stub exists solely so the package
|
|
// still compiles when cgo is disabled, returning a clean error rather
|
|
// than dragging the luxcpp static-lib dependency into a pure-Go build.
|
|
|
|
package code
|
|
|
|
// All entry points return ErrNativeHQCUnavailable (defined in code.go):
|
|
// native HQC is not linked in a no-cgo build. Build with cgo (the
|
|
// default) to link libluxgpu_hqc.
|
|
|
|
func hqcKeypairCPU(mode Mode, pks, sks, seeds []byte, count int) error {
|
|
_ = mode
|
|
_ = pks
|
|
_ = sks
|
|
_ = seeds
|
|
_ = count
|
|
return ErrNativeHQCUnavailable
|
|
}
|
|
|
|
func hqcEncapsCPU(mode Mode, cts, sss, pks, seeds []byte, count int) error {
|
|
_ = mode
|
|
_ = cts
|
|
_ = sss
|
|
_ = pks
|
|
_ = seeds
|
|
_ = count
|
|
return ErrNativeHQCUnavailable
|
|
}
|
|
|
|
func hqcDecapsCPU(mode Mode, sss, cts, sks []byte, count int) error {
|
|
_ = mode
|
|
_ = sss
|
|
_ = cts
|
|
_ = sks
|
|
_ = count
|
|
return ErrNativeHQCUnavailable
|
|
}
|
|
|
|
func gf2PolymulCPU(mode Mode, c, a, b []uint64, count int) error {
|
|
_ = mode
|
|
_ = c
|
|
_ = a
|
|
_ = b
|
|
_ = count
|
|
return ErrNativeHQCUnavailable
|
|
}
|
|
|
|
func rsDecodeCPU(mode Mode, msgs, cdws []byte, count int) error {
|
|
_ = mode
|
|
_ = msgs
|
|
_ = cdws
|
|
_ = count
|
|
return ErrNativeHQCUnavailable
|
|
}
|