-
Notifications
You must be signed in to change notification settings - Fork 708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RSA 8192 is supported only for verification, not for signing #843
Comments
The maximum size of the public modulus for private key operations is 4096. The maximum key size for public key operations is 4096 bits. In theory we could raise it but it would bloat the stack size requirement for everybody if we did, so I'm inclined not to unless there's a really strong motivation. I recommend you switch to a 4096-bit or smaller key. |
Hm, this is not ideal. Is this documented yet? |
https://docs.rs/ring/0.14.6/ring/signature/struct.RsaKeyPair.html "The public modulus must be no larger than 4096 bits."
The current Cargo feature that causes heap allocation to be used is Note modulus limits differ between signing and verifying, but the limit is actually higher for verification. The max size for public key operations (like verification) that use the stack is 8192 bits, while the max size for private key operations (like singing) that use the heap is 4096 bits. I don't know the reason for this disparity, I would have thought it would be the other way.
I don't think this is true. Raising
Agreed, I don't know of any real use case for RSA keys greater than 4096 bits. We should make the key limits the same regardless, it doesn't make a whole lot of sense for ring to verity signatures it cannot create. So we should either:
@briansmith given the important work done and in-progress for #219 and #102, we should decide exactly what RSA key lengths to support across the board. |
I mean, it would affect the stack size requirements for everybody doing signing with RSA. We need to find a strong use case to justify adding RSA 8192 signing support, and probably a commercial sponsor for that effort. It would have a big effect on the fundamental implementation of RSA signing--not just the current implementation, but the much improved implementation that's coming at some unspecified point in time in the future. |
Hi
I can not load 8k RSA keys with rustls.
Since there is no size limit in the source code that I can see, is it possible that the buffer exceeds a stack frame somewhere?
If so how can I work around that? I am totally fine with allowing allocations to the heap if it solves the problem.
Cheers,
Stefan
The text was updated successfully, but these errors were encountered: