Define a S2N convention for function arguments
Problem:
We do-not have a S2N convention for function arguments. In some cases we do (input_1, input_2...input_n, ouput_1, output_2,...output_n) and in other cases we do the opposite (ouput_1, output_2,...output_n, input_1, input_2...input_n).
I believe we should set a s2n standard convention for function arguments as C doesn't specify a defined behavior for it.
The reason for it is ease of use, developer experience and readability of APIs. If we use (input_1, input_2...input_n, ouput_1, output_2,...output_n) in some places and (ouput_1, output_2,...output_n, input_1, input_2...input_n) in other locations, the developer is left to analyze the name of the argument (not all our function argument names are intuitive) to determine the inputs and outputs or as in most cases refer to the logic.
Related to https://github.com/aws/s2n-tls/pull/2608#discussion_r582188408
Solution:
Define a s2n standard for the function arguments and make the changes to the non-public s2n-tls functions.
- Does this change what S2N sends over the wire? No
- Does this change any public APIs? No.
- Which versions of TLS will this impact? n/a
To-do: check in the existing s2n API guideline and then extend that with a paragraph about argument ordering