RFC 8017第8.2.2节中描述的PKCS #1 v1.5签名验证操作的步骤2如下:
2. RSA verification:
a. Convert the signature S to an integer signature
representative s (see Section 4.2):
s = OS2IP (S).
b. Apply the RSAVP1 verification primitive (Section 5.2.2) to
the RSA public key (n, e) and the signature representative
s to produce an integer message representative m:
m = RSAVP1 ((n, e), s).
If RSAVP1 outputs "signature representative out of range",
output "invalid signature" and stop.
c. Convert the message representative m to an encoded message
EM of length k octets (see Section 4.1):
EM = I2OSP (m, k).
If I2OSP outputs "integer too large", output "invalid
signature" and stop.
步骤2c中提到的“整数太大”错误发生的当且仅当m \geq 256^k (参见4.1部分),其中k是RSA模数n的八进制长度。
但是,通过构造RSAVP1
原语(请参阅5.2.2部分)、0 \leq m \leq n - 1或等效的0 \leq m < n。
因为n < 256^k,所以我们有m < 256^k。
在我看来,I2OSP
不可能输出“太大的整数”。但是,如果是的话,为什么这个条件包括在规范中呢?
发布于 2023-01-05 20:37:10
事实上,如果k同意n 也就是说,如果2^{8k-8}\le n<2^{8k}#qcStackCode#
,而RSAVP1正确工作并且没有产生错误条件,那么由于问题的原因,条件I2OSP输出的“整数太大”就不会发生。
为什么这个条件包括在规范中?
我能想到:
https://crypto.stackexchange.com/questions/103601
复制相似问题