Brad
Brad

Reputation: 11515

Signing a payload which is already hashed in pynacl

I am switching an application from Python cryptography.io library to pynacl.

The application currently calculates digests of the data, then has the crypto libraries sign the digest.

But pynacl's signing code always requires the full data to be passed in to the sign methods, and it is difficult to do this with the way the code is structured (and may impossible in cases, such as a very large file that cannot be read into memory).

So the two questions are:

  1. Is there a way to simple pass a pre-calcuated digest of my data to a sign function with pynacl and have it just sign with that?
  2. Would there be a security problem in merelty passing the digest of my data as the message, instead of the data directly? (And if so - and recomendations or restrictions on the algorithm or hash size to use with EC25518?)

Upvotes: 1

Views: 122

Answers (0)

Related Questions