Documentation ¶
Index ¶
- Constants
- func ExtractMessage(signatureMessage []uint8) []uint8
- func ExtractSignature(signatureMessage []uint8) []uint8
- func GetDilithiumAddressFromPK(pk [CryptoPublicKeyBytes]uint8) [common.AddressSize]uint8
- func GetDilithiumDescriptor() uint8
- func IsValidDilithiumAddress(address [common.AddressSize]uint8) bool
- func Open(signatureMessage []uint8, pk *[CryptoPublicKeyBytes]uint8) []uint8
- func Verify(message []uint8, signature [CryptoBytes]uint8, pk *[CryptoPublicKeyBytes]uint8) bool
- type Dilithium
- func (d *Dilithium) GetAddress() [common.AddressSize]uint8
- func (d *Dilithium) GetHexSeed() string
- func (d *Dilithium) GetMnemonic() string
- func (d *Dilithium) GetPK() [CryptoPublicKeyBytes]uint8
- func (d *Dilithium) GetSK() [CryptoSecretKeyBytes]uint8
- func (d *Dilithium) GetSeed() [common.SeedSize]uint8
- func (d *Dilithium) Seal(message []uint8) ([]uint8, error)
- func (d *Dilithium) Sign(message []uint8) ([CryptoBytes]uint8, error)
Constants ¶
View Source
const ( CryptoPublicKeyBytes = SeedBytes + K*PolyT1PackedBytes CryptoSecretKeyBytes = 3*SeedBytes + L*PolyETAPackedBytes + K*PolyETAPackedBytes + K*PolyT0PackedBytes // CryptoBytes is the signature size in bytes CryptoBytes = SeedBytes + L*PolyZPackedBytes + PolyVecHPackedBytes Shake128Rate = 168 Shake256Rate = 136 Stream128BlockBytes = Shake128Rate Stream256BlockBytes = Shake256Rate PolyUniformNBlocks = (768 + Stream128BlockBytes - 1) / Stream128BlockBytes PolyUniformETANBlocks = (136 + Stream256BlockBytes - 1) / Stream256BlockBytes PolyUniformGamma1NBlocks = (PolyZPackedBytes + Stream256BlockBytes - 1) / Stream256BlockBytes SeedBytes = 32 CRHBytes = 64 // hash of public key N = 256 Q = 8380417 QInv = 58728449 // -q^(-1) mod 2^32 D = 13 K = 8 L = 7 ETA = 2 TAU = 60 BETA = 120 GAMMA1 = 1 << 19 GAMMA2 = (Q - 1) / 32 OMEGA = 75 // Polynomial sizes PolyT1PackedBytes = 320 PolyT0PackedBytes = 416 PolyETAPackedBytes = 96 PolyZPackedBytes = 640 PolyVecHPackedBytes = OMEGA + K PolyW1PackedBytes = 128 )
Variables ¶
This section is empty.
Functions ¶
func ExtractMessage ¶
ExtractMessage extracts message from Signature attached with message.
func ExtractSignature ¶
ExtractSignature extracts signature from Signature attached with message.
func GetDilithiumAddressFromPK ¶
func GetDilithiumAddressFromPK(pk [CryptoPublicKeyBytes]uint8) [common.AddressSize]uint8
func GetDilithiumDescriptor ¶
func GetDilithiumDescriptor() uint8
func IsValidDilithiumAddress ¶
func IsValidDilithiumAddress(address [common.AddressSize]uint8) bool
func Open ¶
func Open(signatureMessage []uint8, pk *[CryptoPublicKeyBytes]uint8) []uint8
Open the sealed message m. Returns the original message sealed with signature. In case the signature is invalid, nil is returned.
func Verify ¶
func Verify(message []uint8, signature [CryptoBytes]uint8, pk *[CryptoPublicKeyBytes]uint8) bool
Types ¶
type Dilithium ¶
type Dilithium struct {
// contains filtered or unexported fields
}
func NewDilithiumFromHexSeed ¶
func NewDilithiumFromSeed ¶
func (*Dilithium) GetAddress ¶
func (d *Dilithium) GetAddress() [common.AddressSize]uint8
func (*Dilithium) GetHexSeed ¶
func (*Dilithium) GetMnemonic ¶
func (*Dilithium) GetPK ¶
func (d *Dilithium) GetPK() [CryptoPublicKeyBytes]uint8
func (*Dilithium) GetSK ¶
func (d *Dilithium) GetSK() [CryptoSecretKeyBytes]uint8
Click to show internal directories.
Click to hide internal directories.