remove MIRACL Core support (#5941)
EIP-4844 requires BLST via `nim-kzg4844`; MIRACL Core is not supported. Therefore, remove support for the MIRACL Core backend. - https://github.com/status-im/nim-blscurve/pull/170
This commit is contained in:
parent
97527e2ca5
commit
a7b9efe4d6
|
@ -47,7 +47,7 @@ const
|
||||||
RawSigSize* = 96
|
RawSigSize* = 96
|
||||||
RawPubKeySize* = 48
|
RawPubKeySize* = 48
|
||||||
UncompressedPubKeySize* = 96
|
UncompressedPubKeySize* = 96
|
||||||
# RawPrivKeySize* = 48 for Miracl / 32 for BLST
|
# RawPrivKeySize* = 32 for BLST
|
||||||
|
|
||||||
type
|
type
|
||||||
ValidatorPubKey* = object ##\
|
ValidatorPubKey* = object ##\
|
||||||
|
@ -388,12 +388,8 @@ func `$`*(x: ValidatorPubKey | ValidatorSig): string =
|
||||||
|
|
||||||
func toRaw*(x: ValidatorPrivKey): array[32, byte] =
|
func toRaw*(x: ValidatorPrivKey): array[32, byte] =
|
||||||
# TODO: distinct type - see https://github.com/status-im/nim-blscurve/pull/67
|
# TODO: distinct type - see https://github.com/status-im/nim-blscurve/pull/67
|
||||||
when BLS_BACKEND == BLST:
|
static: doAssert BLS_BACKEND == BLST
|
||||||
result = SecretKey(x).exportRaw()
|
result = SecretKey(x).exportRaw()
|
||||||
else:
|
|
||||||
# Miracl exports to 384-bit arrays, but Curve order is 256-bit
|
|
||||||
let raw = SecretKey(x).exportRaw()
|
|
||||||
result[0..32-1] = raw.toOpenArray(48-32, 48-1)
|
|
||||||
|
|
||||||
template toRaw*(x: ValidatorPubKey | ValidatorSig): auto =
|
template toRaw*(x: ValidatorPubKey | ValidatorSig): auto =
|
||||||
x.blob
|
x.blob
|
||||||
|
|
|
@ -45,7 +45,7 @@ type
|
||||||
PubKeyBytes* = array[RawPubKeySize, byte]
|
PubKeyBytes* = array[RawPubKeySize, byte]
|
||||||
## This is the serialized byte representation
|
## This is the serialized byte representation
|
||||||
## of a Validator Public Key.
|
## of a Validator Public Key.
|
||||||
## Portable between Miracl/BLST
|
## Portable between backend implementations
|
||||||
## and limits serialization/deserialization call
|
## and limits serialization/deserialization call
|
||||||
|
|
||||||
PubKey0x* = distinct PubKeyBytes
|
PubKey0x* = distinct PubKeyBytes
|
||||||
|
|
|
@ -789,7 +789,7 @@ proc getValidatorInternalID(
|
||||||
db.internalIds.withValue(index.get(), internal) do:
|
db.internalIds.withValue(index.get(), internal) do:
|
||||||
return Opt.some(internal[])
|
return Opt.some(internal[])
|
||||||
|
|
||||||
let serializedPubkey = validator.toRaw() # Miracl/BLST to bytes
|
let serializedPubkey = validator.toRaw() # Backend-specific to bytes
|
||||||
var valID: ValidatorInternalID
|
var valID: ValidatorInternalID
|
||||||
let status = db.sqlGetValidatorInternalID.exec(serializedPubkey) do (res: ValidatorInternalID):
|
let status = db.sqlGetValidatorInternalID.exec(serializedPubkey) do (res: ValidatorInternalID):
|
||||||
valID = res
|
valID = res
|
||||||
|
@ -1080,7 +1080,7 @@ proc registerValidator(db: SlashingProtectionDB_v2, validator: ValidatorPubKey)
|
||||||
## Get validator from the database
|
## Get validator from the database
|
||||||
## or register it
|
## or register it
|
||||||
## Assumes the validator does not exist
|
## Assumes the validator does not exist
|
||||||
let serializedPubkey = validator.toRaw() # Miracl/BLST to bytes
|
let serializedPubkey = validator.toRaw() # Backend-specific to bytes
|
||||||
let status = db.sqlInsertValidator.exec(serializedPubkey)
|
let status = db.sqlInsertValidator.exec(serializedPubkey)
|
||||||
doAssert status.isOk()
|
doAssert status.isOk()
|
||||||
|
|
||||||
|
|
|
@ -225,9 +225,6 @@ put("aesctr_drbg.always", "-fno-lto")
|
||||||
put("hmac_drbg.always", "-fno-lto")
|
put("hmac_drbg.always", "-fno-lto")
|
||||||
put("sysrng.always", "-fno-lto")
|
put("sysrng.always", "-fno-lto")
|
||||||
|
|
||||||
# Miracl - only ECP to derive public key from private key
|
|
||||||
put("ecp_BLS12381.always", "-fno-lto")
|
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
#
|
#
|
||||||
# Spurious warnings
|
# Spurious warnings
|
||||||
|
|
Loading…
Reference in New Issue