github.com/theQRL/go-zond@v0.1.1/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  	return signature[:], err
    15  }