github.com/theQRL/go-zond@v0.2.1/crypto/pqcrypto/signature.go (about) 1 package pqcrypto 2 3 import ( 4 "fmt" 5 6 "github.com/theQRL/go-qrllib/dilithium" 7 ) 8 9 func Sign(digestHash []byte, d *dilithium.Dilithium) ([]byte, error) { 10 if len(digestHash) != DigestLength { 11 return nil, fmt.Errorf("hash is required to be exactly %d bytes (%d)", DigestLength, len(digestHash)) 12 } 13 signature, err := d.Sign(digestHash) 14 if err != nil { 15 return nil, err 16 } 17 return signature[:], nil 18 }