File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
contracts/utils/cryptography Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ library RSA {
3232 * IMPORTANT: Although this function allows for it, using n of length 1024 bits is considered unsafe.
3333 * Consider using at least 2048 bits.
3434 *
35+ * WARNING: PKCS#1 v1.5 allows for replayability given the message may contain arbitrary optional parameters in the
36+ * DigestInfo. Consider using an onchain nonce or unique identifier to include in the message to prevent replay attacks.
37+ *
3538 * @param digest the digest to verify
3639 * @param s is a buffer containing the signature
3740 * @param e is the exponent of the public key
@@ -48,7 +51,7 @@ library RSA {
4851 return false ;
4952 }
5053
51- // verify that s < n
54+ // Verify that s < n to ensure there's only one valid signature for a given message
5255 for (uint256 i = 0 ; i < length; i += 0x20 ) {
5356 uint256 p = Math.min (i, length - 0x20 );
5457 bytes32 sp = _unsafeReadBytes32 (s, p);
You can’t perform that action at this time.
0 commit comments