Is signing a hash instead of the full data considered secure? I reference object in some of my code in hashes. The signature is itself is another object separate from the one I am signing (for obvious reason). I consider simpler to simply sign the reference to my object (its hash), but I wonder if it is considered secure.
Here's a more complete explanation:

A: Is the data object to be hash then signed
H: Is hash(a), the reference to A
S: Is the signature object which contain H and sign(H)
S and A are sent on the network so A can be verified with its signature
This is secure, and a lot of systems actually do signatures this way (for example, PGP). One reason to do this for performance. Signing a hash is much faster than signing your whole message. It is also non-trivial to hash large messages since signature functions usually operate on a bounded size input.

An attacker will have just as much difficulty forging a signature on the hash as they would forging the signature on the message itself.