Currently different functions arrange their parameters without any apparent system as how to arrange them consistently. Some rules are required to make this consistent.
It might be useful to follow the conventions that libsodium follows.
Some suggestions:
output first, followed by input
public key first, then private key
optional parameters at the end (optional outputs after regular inputs)
strings/data are followed by their length (when not using buffer_t)
if a function works on a struct, pass the pointer first (like a self parameter for class methods)
same for IDs that represent some object
Naming conventions:
Functions:
molch_end_conversation instead of molch_conversation_end (verb first)
but start with the 'class' that the function belongs to (molch in the example above)
Currently different functions arrange their parameters without any apparent system as how to arrange them consistently. Some rules are required to make this consistent.
It might be useful to follow the conventions that libsodium follows.
Some suggestions:
self
parameter for class methods)Naming conventions:
molch_end_conversation
instead ofmolch_conversation_end
(verb first)molch
in the example above)