-
Notifications
You must be signed in to change notification settings - Fork 18k
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
crypto/elliptic: bake 88 kB p256Precomputed table into binary on iOS #44992
Comments
/cc @FiloSottile |
From my side, there's no problem with compiling it in. In general, this is a binary size vs memory use concern. It would get linked into anything that uses crypto/tls or net/http. |
If most uses of TLS are going to compute this table anyway, then precomputing is a net win. Do most TLS uses end up needing this table? |
This proposal has been added to the active column of the proposals project |
Yes, a pretty good portion of TLS connections will use it. Do we want to special-case iOS where this is a net win, or everywhere even if it will make binaries bigger? I would prefer not to have the complexity of supporting both modes, but it would not be particularly hard. |
If most TLS connections need it anyway, then sure let's try doing the table on all platforms and see how it goes. |
Based on the discussion above, this proposal seems like a likely accept. |
No change in consensus, so accepted. 🎉 |
Change https://golang.org/cl/315189 mentions this issue: |
The crypto/elliptic package, on amd64 and arm64, has an 88kB table that's lazily computed via
crypto/elliptic/p256_asm.go
:That 43 * 32 * 8 * 8 bytes == 88 KB, which resides in the heap.
On iOS, in certain contexts (App Extensions: https://developer.apple.com/app-extensions/), the memory limits can be quite low, like 15 MB total non-pageable memory.
88 KB is enough to show up in profiles.
If the 88 KB were baked into the binary, however, it wouldn't count against the limit.
Can we just always bake it into the binary on iOS at least?
The text was updated successfully, but these errors were encountered: