-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Review/remove uses of MBEDTLS_PRIVATE
in programs
#4683
Comments
Downgrading to M, as a lot of the issues have been fixed. Also, beware that the subtasks of this are in the same epic, and thus the perceived amount of work to do is potentially doubled. |
Having looked at the use of accessors in programs the following are being used. RSA
The estimation is that not a lot is needed for it. The (N) and (E) should not be accessed and the programs need to be refactored around it, and the len has already an accessor at:
ECP
This is a bit more tricky as discussed already in #78045 But the guidance is that the programs will need to refactored and expect that no every single member or curve coordinate is being printed in stdout. d and Q should not be exposed but we are misssing a way for the user/app to extract the public key. |
Note: there are also uses of |
Good point about |
Since 3.0, |
Here's the output of the "normal" ECDH block in full config:
And the output of the
The output of the
Looking at the code:
|
When it comes to ECC computations, broadly speaking there are three things:
This maps to high-level operations as follows:
As a developer, I'd like the benchmark output to allow me to quickly see the effects if I tune one kind of operation:
|
So, if I understand correctly, what you'd like to add to the default-configuration benchmark is static ECDH? Can you please file an issue and put it on the Barriers board? |
Patch incoming. |
I looked at the other programs, and most don't warrant |
In #4511 we made most struct fields private, however we took a shortcut, by allowing ourselves to use
MBEDTLS_PRIVATE
fields in programs.Most of the programs are supposed to be samples that the users can look at, get inspiration from or even copy-paste-edit, so they should demonstrate best practices and respect the boundaries of the library's public API.
There are currently 74 uses of
MBEDTLS_PRIVATE
in 18 files in theprograms
directory. Each should be reviewed and handled appropriately, for example:key_app
), perhaps leave it as is but very clearly document that it's not an example to be followedprograms/pkey/ecdh_curve25519.c
uses private fields ofecdh_context
but could use a bunch ofmbedtls_mpi
andmbedtls_ecp_point
variable instead)Break down by structures:
mbedtls_cipher_info_t
mbedtls_rsa_context
mbedtls_dhm_context
mbedtls_ecdh_context
mbedtls_ecp_keypair
,mbedtls_ecdsa_context
mbedtls_ecp_curve_info
mbedtls_x509_crt
mbedtls_x509_csr
mbedtls_net_context
The text was updated successfully, but these errors were encountered: