Conversation
| </li> | ||
| <li> | ||
| <p> | ||
| Let |signature| be the result of performing the signDigest operation |
There was a problem hiding this comment.
That's not specifically about the patch, it's more a small bit that annoys my reading:
in one sentence we have normalisedAlgorithm AND algorithm.
Maybe one day we should change it to
Let signature be the result of performing the signDigest operation specified by |normalisedAlgorithm| using |key| and with |data| as |digest|/|message| (I believe for the sign operation). Same is about verify/verifyDigest.
|
Sorry, I read slower than you update the patch :) |
|
Thanks for the PR!
I think it would be clearer to define a new algorithm, After all, as you say, all the other algorithms have the property that Additionally, there is a third algorithm in RFC 8032, (All of that being said, I don't think |
For Ed25519ctx I'd 100% agree since adding But for Ed25519ph because there's not only domain separation, there's actual method separation so I didn't come to a conclusion that a separate webcrypto algorithm is needed.
Not a goal as far as i'm concerned.
Agreed, I'll drop it. It was a fun exercise regardless. |
Refs: #431
Refs: WICG/webcrypto-secure-curves#5
This PR adds
signDigestandverifyDigestmethods to theSubtleCryptointerface and defines the corresponding operations for the following algorithms: RSASSA-PKCS1-v1_5, RSA-PSS, ECDSA, and Ed25519.RsaPssParamsand operate on the supplied digest.EcdsaParamsand use the supplied digest directly instead of hashing the message.Ed25519: Sign Digest and Verify Digest use Ed25519ph (RFC 8032 Section 5.1) withContextParamsfor optional context support. A note clarifies that pure Ed25519 (used bysign/verify) and Ed25519ph (used bysignDigest/verifyDigest) produce cryptographically distinct signatures that are not cross-verifiable.Digest length is validated based on the hash algorithm: for RSA algorithms it's determined from the key's
hashattribute, for ECDSA from theEcdsaParamsdictionary'shashmember, and for Ed25519 it's fixed to 64 bytes (SHA-512). InsignDigestthis is a rejection, inverifyDigestthis is an earlyreturn false.Uses existing keys and usages.
Preview | Diff