I think it would be best to modify the Signer interface as follows:
type Signer interface {
⋮
Sign(msg []byte) ([]byte, error)
SignNum(msg big.Int, hFunc hash.Hash) ([]byte, error)
⋮
}
Sign takes in long messages such as human-readable strings. It then performs a hash-to-fr on the message, and passes it on to SignNum with nil as hFunc. Just like the current logic for Sign, when hFunc==nil, the input is considered pre-hashed and not hashed again. The hash used for hashing to Fr is a conventional one, but that would not create an issue on the SNARK side because any human-readable string can be reasonably expected to be known at SNARK compile time.
I think it would be best to modify the
Signerinterface as follows:Signtakes in long messages such as human-readable strings. It then performs a hash-to-fr on the message, and passes it on toSignNumwithnilashFunc. Just like the current logic forSign, whenhFunc==nil, the input is considered pre-hashed and not hashed again. The hash used for hashing to Fr is a conventional one, but that would not create an issue on the SNARK side because any human-readable string can be reasonably expected to be known at SNARK compile time.