I have a question about the message that is being encrypted and signed. Say, two users called Tom and Mary, both have a pair of private key and public key. Tom sends a message through a system that will encrypt and sign the message. 2 kinds of message will be sent 1. encrypted message and, 2. hash function of the message, public key of Tom and Mary, secret Key (which is chosen by Tom)
I would like to ask after Mary got the message, she could recover the message by the public key of tom. but how could she recover the hash function so that she could make sure this 2 kinds of message are signed by Tom?
Thanks!