import { Buffer32 } from '@aztec/foundation/buffer';
import { keccak256, makeEthSignDigest } from '@aztec/foundation/crypto';
export var SignatureDomainSeparator;
(function (SignatureDomainSeparator) {
    SignatureDomainSeparator[SignatureDomainSeparator["blockProposal"] = 0] = "blockProposal";
    SignatureDomainSeparator[SignatureDomainSeparator["blockAttestation"] = 1] = "blockAttestation";
})(SignatureDomainSeparator || (SignatureDomainSeparator = {}));
/**
 * Get the hashed payload for the signature of the `Signable`
 * @param s - The `Signable` to sign
 * @returns The hashed payload for the signature of the `Signable`
 */
export function getHashedSignaturePayload(s, domainSeparator) {
    return Buffer32.fromBuffer(keccak256(s.getPayloadToSign(domainSeparator)));
}
/**
 * Get the hashed payload for the signature of the `Signable` as an Ethereum signed message EIP-712
 * @param s - the `Signable` to sign
 * @returns The hashed payload for the signature of the `Signable` as an Ethereum signed message
 */
export function getHashedSignaturePayloadEthSignedMessage(s, domainSeparator) {
    const payload = getHashedSignaturePayload(s, domainSeparator);
    return makeEthSignDigest(payload);
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lnbmF0dXJlX3V0aWxzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3AycC9zaWduYXR1cmVfdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQ3BELE9BQU8sRUFBRSxTQUFTLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUV4RSxNQUFNLENBQU4sSUFBWSx3QkFHWDtBQUhELFdBQVksd0JBQXdCO0lBQ2xDLHlGQUFpQixDQUFBO0lBQ2pCLCtGQUFvQixDQUFBO0FBQ3RCLENBQUMsRUFIVyx3QkFBd0IsS0FBeEIsd0JBQXdCLFFBR25DO0FBTUQ7Ozs7R0FJRztBQUNILE1BQU0sVUFBVSx5QkFBeUIsQ0FBQyxDQUFXLEVBQUUsZUFBeUM7SUFDOUYsT0FBTyxRQUFRLENBQUMsVUFBVSxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsZ0JBQWdCLENBQUMsZUFBZSxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzdFLENBQUM7QUFFRDs7OztHQUlHO0FBQ0gsTUFBTSxVQUFVLHlDQUF5QyxDQUN2RCxDQUFXLEVBQ1gsZUFBeUM7SUFFekMsTUFBTSxPQUFPLEdBQUcseUJBQXlCLENBQUMsQ0FBQyxFQUFFLGVBQWUsQ0FBQyxDQUFDO0lBQzlELE9BQU8saUJBQWlCLENBQUMsT0FBTyxDQUFDLENBQUM7QUFDcEMsQ0FBQyJ9