Documentation
¶
Index ¶
Constants ¶
View Source
const ( ModeMLDSA44 uint8 = 0x44 ModeMLDSA65 uint8 = 0x65 ModeMLDSA87 uint8 = 0x87 )
ML-DSA mode bytes
View Source
const ( MLDSA44VerifyGas uint64 = 75_000 // Fastest, smallest keys MLDSA65VerifyGas uint64 = 100_000 // Medium MLDSA87VerifyGas uint64 = 150_000 // Slowest, largest keys MLDSAVerifyPerByteGas uint64 = 10 // Cost per byte of message )
Gas costs for ML-DSA verification (per mode)
View Source
const ( // ML-DSA-44 MLDSA44PublicKeySize = 1312 MLDSA44SignatureSize = 2420 // ML-DSA-65 MLDSA65PublicKeySize = 1952 MLDSA65SignatureSize = 3309 // ML-DSA-87 MLDSA87PublicKeySize = 2592 MLDSA87SignatureSize = 4627 )
ML-DSA key and signature sizes per mode
View Source
const ConfigKey = "mldsaConfig"
ConfigKey is the key used in json config files to specify this precompile config. must be unique across all precompiles.
Variables ¶
View Source
var ( // Singleton instance MLDSAVerifyPrecompile = &mldsaVerifyPrecompile{} ErrInvalidInputLength = errors.New("invalid input length") ErrUnsupportedMode = errors.New("unsupported ML-DSA mode") )
View Source
var ContractMLDSAVerifyAddress = common.HexToAddress("0x0200000000000000000000000000000000000006")
ContractMLDSAVerifyAddress is the address of the ML-DSA verify precompile
View Source
var Module = modules.Module{ ConfigKey: ConfigKey, Address: ContractMLDSAVerifyAddress, Contract: MLDSAVerifyPrecompile, Configurator: &configurator{}, }
Module is the precompile module. It is used to register the precompile contract.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.8.18
type Config struct {
precompileconfig.Upgrade
}
Config implements the precompileconfig.Config interface
func NewDisableConfig ¶ added in v0.8.18
NewDisableConfig returns a config that disables the ML-DSA precompile
func (*Config) Equal ¶ added in v0.8.18
func (c *Config) Equal(cfg precompileconfig.Config) bool
Equal returns true if the provided config is equivalent
func (*Config) Verify ¶ added in v0.8.18
func (c *Config) Verify(chainConfig precompileconfig.ChainConfig) error
Verify returns an error if the config is invalid
Click to show internal directories.
Click to hide internal directories.