Skip to content

Signature preparation #8

@singpolyma

Description

@singpolyma

Different algorithms have different preparation requirements for creating signatures (at least, in normal use). Crypto.Classes.Signing currently provides a low-level sign which takes just the already-prepared ByteString. The same goes for verify. This is fine, and definitely should remain.

I would like to propose adding a new function to the Signing class makeSignature that takes a transformation function (Bytestring -> ByteString usually will be a hash function), a ByteString of (possible empty) padding, and Either a public key or a private key. And, of course, a ByteString message. So:

`makeSignature :: (Error e) => (ByteString -> ByteString) -> ByteString -> Either p v -> ByteString -> Either e ByteString

That's enough information for the preparations commonly associated with RSA and DSA, and I expect most others, though I may be wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions