Pk sign

These changes add support for simple PK signing (without hashes) and are based on Joy's branch for HMAC signing (hmacs_rebase).