mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-11 09:40:38 +00:00
Move implementation by module table earlier
Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
parent
dae0ad439f
commit
3f7e42a750
@ -420,6 +420,20 @@ Make sure that such mechanisms preserve the guarantees when buffers overlap.
|
||||
|
||||
## Detailed design
|
||||
|
||||
### Implementation by module
|
||||
|
||||
Module | Input protection strategy | Output protection strategy | Notes
|
||||
---|---|---|---
|
||||
Hash and MAC | Careful access | Careful access | Low risk of multiple-access as the input and output are raw unformatted data.
|
||||
Cipher | Copying | Copying |
|
||||
AEAD | Copying (careful access for additional data) | Copying |
|
||||
Key derivation | Careful access | Careful access |
|
||||
Asymmetric signature | Careful access | Copying | Inputs to signatures are passed to a hash. This will no longer hold once PureEdDSA support is implemented.
|
||||
Asymmetric encryption | Copying | Copying |
|
||||
Key agreement | Copying | Copying |
|
||||
PAKE | Copying | Copying |
|
||||
Key import / export | Copying | Copying | Keys may be imported and exported in DER format, which is a structured format and therefore susceptible to read-read inconsistencies and potentially write-read inconsistencies.
|
||||
|
||||
### Copying functions
|
||||
|
||||
As discussed above, it is simpler to use a single unified API for copying. Therefore, we create the following functions:
|
||||
@ -443,20 +457,6 @@ This function would first copy the `buffers->out` buffer to the user-supplied ou
|
||||
|
||||
Some PSA functions may not use these convenience functions as they may have local optimizations that reduce memory usage. For example, ciphers may be able to use a single intermediate buffer for both input and output.
|
||||
|
||||
### Implementation by module
|
||||
|
||||
Module | Input protection strategy | Output protection strategy | Notes
|
||||
---|---|---|---
|
||||
Hash and MAC | Careful access | Careful access | Low risk of multiple-access as the input and output are raw unformatted data.
|
||||
Cipher | Copying | Copying |
|
||||
AEAD | Copying (careful access for additional data) | Copying |
|
||||
Key derivation | Careful access | Careful access |
|
||||
Asymmetric signature | Careful access | Copying | Inputs to signatures are passed to a hash. This will no longer hold once PureEdDSA support is implemented.
|
||||
Asymmetric encryption | Copying | Copying |
|
||||
Key agreement | Copying | Copying |
|
||||
PAKE | Copying | Copying |
|
||||
Key import / export | Copying | Copying | Keys may be imported and exported in DER format, which is a structured format and therefore susceptible to read-read inconsistencies and potentially write-read inconsistencies.
|
||||
|
||||
### Validation of copying
|
||||
|
||||
As discussed above, the best strategy for validation of copies appears to be validation by memory poisoning.
|
||||
|
Loading…
x
Reference in New Issue
Block a user