github.com/onflow/flow-go/crypto@v0.24.8/bls_no_relic.go (about) 1 //go:build !relic 2 // +build !relic 3 4 package crypto 5 6 import ( 7 "github.com/onflow/flow-go/crypto/hash" 8 ) 9 10 // The functions below are the non-Relic versions of the public APIs 11 // requiring the Relic library. 12 // All BLS functionalities in the package require the Relic dependency, 13 // and therefore the "relic" build tag. 14 // Building without the "relic" tag is successful, but and calling one of the 15 // BLS functions results in a runtime panic. This allows projects depending on the 16 // crypto library to build successfully with or without the "relic" tag. 17 18 const relic_panic = "function is not supported when building without \"relic\" Go build tag" 19 20 const ( 21 SignatureLenBLSBLS12381 = 48 22 ) 23 24 // bls.go functions 25 func NewExpandMsgXOFKMAC128(tag string) hash.Hasher { 26 panic(relic_panic) 27 } 28 29 func BLSInvalidSignature() Signature { 30 panic(relic_panic) 31 } 32 33 // bls_multisig.go functions 34 func BLSGeneratePOP(sk PrivateKey) (Signature, error) { 35 panic(relic_panic) 36 } 37 38 func BLSVerifyPOP(pk PublicKey, s Signature) (bool, error) { 39 panic(relic_panic) 40 } 41 42 func AggregateBLSSignatures(sigs []Signature) (Signature, error) { 43 panic(relic_panic) 44 } 45 46 func AggregateBLSPrivateKeys(keys []PrivateKey) (PrivateKey, error) { 47 panic(relic_panic) 48 } 49 50 func AggregateBLSPublicKeys(keys []PublicKey) (PublicKey, error) { 51 panic(relic_panic) 52 } 53 54 func IdentityBLSPublicKey() PublicKey { 55 panic(relic_panic) 56 } 57 58 func IsBLSAggregateEmptyListError(err error) bool { 59 panic(relic_panic) 60 } 61 62 func IsInvalidSignatureError(err error) bool { 63 panic(relic_panic) 64 } 65 66 func IsNotBLSKeyError(err error) bool { 67 panic(relic_panic) 68 } 69 70 func IsBLSSignatureIdentity(s Signature) bool { 71 panic(relic_panic) 72 } 73 74 func RemoveBLSPublicKeys(aggKey PublicKey, keysToRemove []PublicKey) (PublicKey, error) { 75 panic(relic_panic) 76 } 77 78 func VerifyBLSSignatureOneMessage(pks []PublicKey, s Signature, 79 message []byte, kmac hash.Hasher) (bool, error) { 80 panic(relic_panic) 81 } 82 83 func VerifyBLSSignatureManyMessages(pks []PublicKey, s Signature, 84 messages [][]byte, kmac []hash.Hasher) (bool, error) { 85 panic(relic_panic) 86 } 87 88 func BatchVerifyBLSSignaturesOneMessage(pks []PublicKey, sigs []Signature, 89 message []byte, kmac hash.Hasher) ([]bool, error) { 90 panic(relic_panic) 91 } 92 93 func SPOCKProve(sk PrivateKey, data []byte, kmac hash.Hasher) (Signature, error) { 94 panic(relic_panic) 95 } 96 97 func SPOCKVerifyAgainstData(pk PublicKey, proof Signature, data []byte, kmac hash.Hasher) (bool, error) { 98 panic(relic_panic) 99 } 100 101 func SPOCKVerify(pk1 PublicKey, proof1 Signature, pk2 PublicKey, proof2 Signature) (bool, error) { 102 panic(relic_panic) 103 } 104 105 // bls_threshold.go functions 106 func NewBLSThresholdSignatureParticipant( 107 groupPublicKey PublicKey, 108 sharePublicKeys []PublicKey, 109 threshold int, 110 myIndex int, 111 myPrivateKey PrivateKey, 112 message []byte, 113 dsTag string, 114 ) (ThresholdSignatureParticipant, error) { 115 panic(relic_panic) 116 } 117 118 func NewBLSThresholdSignatureInspector( 119 groupPublicKey PublicKey, 120 sharePublicKeys []PublicKey, 121 threshold int, 122 message []byte, 123 dsTag string, 124 ) (ThresholdSignatureInspector, error) { 125 panic(relic_panic) 126 } 127 128 func BLSReconstructThresholdSignature(size int, threshold int, 129 shares []Signature, signers []int) (Signature, error) { 130 panic(relic_panic) 131 } 132 133 func EnoughShares(threshold int, sharesNumber int) (bool, error) { 134 panic(relic_panic) 135 } 136 137 func BLSThresholdKeyGen(size int, threshold int, seed []byte) ([]PrivateKey, 138 []PublicKey, PublicKey, error) { 139 panic(relic_panic) 140 } 141 142 // dkg.go functions 143 func NewFeldmanVSS(size int, threshold int, myIndex int, 144 processor DKGProcessor, dealerIndex int) (DKGState, error) { 145 panic(relic_panic) 146 } 147 148 func NewFeldmanVSSQual(size int, threshold int, myIndex int, 149 processor DKGProcessor, dealerIndex int) (DKGState, error) { 150 panic(relic_panic) 151 } 152 153 func NewJointFeldman(size int, threshold int, myIndex int, 154 processor DKGProcessor) (DKGState, error) { 155 panic(relic_panic) 156 }