Daniel Kahn Gillmor dkg@fifthhorseman.net writes:
That is, a library might use a function by comparing the requested algorithm name as a strict prefix with the size of the keylength.
If that works with all algorithms, that's good. I recall I changed or was about to change these things for the CAST cipher a while back. "arctwo_gutmann" may also be a corner case.
const nettle_cipher* nettle_select_cipher(const char* algoname, int keylength = 0);
I think this function might fit better as an example in the documentation. (And you can't do default arguments like that in C).
There are so many queries one might want to do. Beside this example, "give me all variants of aes", or "give me all block ciphers with a given block size", so I think it's a bit premature to decide which query functions to add.
Regards, /Niels