Arbitrary parameters → parameter descriptors #
Different cryptographic objects and operations may be parametrized, and this could even vary between implementations, so there must be a way for plugins to specify them.
One could say that the existence of parameters is entirely driven by plugins.
And yet, there’s also a need to not only specify their existence, but also what kind of data their payload should be
With Le’Sec, plugins get tools to specify, in detail, exactly how the values of the parameters they accept should be layed out in memory. The rest is left into the hands of the calling application.
In the end, passing parameter values is simple, it’s just a pointer to data that is properly layed out, for the plugin to simply read.
The trick is for the application to make other calls, to retrieve a descriptor array for all applicable parameters, and ensure that the parameter values it wants to pass are layed out as instructed by that descriptor array.