Provide example definitions for some of the implementation-defined macros #74
Labels
Crypto API
Issue or PR related to the Cryptography API
enhancement
New feature or request
proposal
An RFC, or proposal for discussion
The Crypto API spec provides definitions for most constant-value macros, such as algorithm identifier or key type values. The spec also provides example definitions for some of the function-like macros, typically also for macros that construct or query algorithm identifier or key type values. They are provided as examples because an implementation that implements a subset of the key types or algorithms may be able to simplify the macro definitions; or an implementation that provides additional key types or algorithms might need to extend the definitions.
Many of the macros, particularly the buffer sizing macros, are tagged as implementation-defined values. This is because these might identify limits that are specific to an implementation, or can depend on the implementation strategy.
A review of these macros, however, identifies that if we make a single assumption, most of the macros related to input and output buffer sizes are only dependent on the algorithm and key parameters supported by the implementation. The 'single assumption' is that the implementation does the minimal input and output buffering that is required to support the algorithm.
It might be beneficial for the specification to provide example implementations for all such macros, based on a full implementation of all algorithms and key types, and making that single assumption. Implementers can use, simplify, modify, or ignore these example definitions as appropriate.
Would this be a worthwhile exercise?
The text was updated successfully, but these errors were encountered: