mirror of
https://github.com/luxfi/crypto.git
synced 2026-07-27 01:54:50 +00:00
- bls.go: pure Go implementation using cloudflare/circl (!cgo) - bls_cgo.go: CGO-optimized implementation using supranational/blst (cgo) - types.go: shared constants and errors - Simplified bls12381 build tags (cgo vs !cgo) - Removed duplicate implementations (bls_new.go, internal.go) - Fixed tests to work with both implementations
25 lines
910 B
Go
25 lines
910 B
Go
// Copyright (C) 2020-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package bls
|
|
|
|
import "errors"
|
|
|
|
const (
|
|
SecretKeyLen = 32
|
|
PublicKeyLen = 48 // Compressed G1 point
|
|
SignatureLen = 96 // Compressed G2 point
|
|
)
|
|
|
|
var (
|
|
ErrNoPublicKeys = errors.New("no public keys")
|
|
ErrFailedPublicKeyDecompress = errors.New("couldn't decompress public key")
|
|
ErrInvalidPublicKey = errors.New("invalid public key")
|
|
ErrFailedPublicKeyAggregation = errors.New("couldn't aggregate public keys")
|
|
ErrFailedSignatureDecompress = errors.New("couldn't decompress signature")
|
|
ErrInvalidSignature = errors.New("invalid signature")
|
|
ErrNoSignatures = errors.New("no signatures")
|
|
ErrFailedSignatureAggregation = errors.New("couldn't aggregate signatures")
|
|
ErrFailedSecretKeyDeserialize = errors.New("couldn't deserialize secret key")
|
|
)
|