Nikos Mavrogiannopoulos nmav@gnutls.org writes:
I see that there's some inconsistency of using "nettle_random_func random" vs "nettle_random_func *random", the latter variant is the preferred form.
If this is because of me, feel free to correct it. It must have been a typo.
I don't think you introduced that. I changed the typedef from
typedef void (*nettle_random_func)(void *ctx, unsigned length, uint8_t *dst);
to
typedef void nettle_random_func(void *ctx, unsigned length, uint8_t *dst);
some versions ago (and similarly for other typedefs for function type). And I tried to update all uses at the time, but I'm afraid I didn't get them all (rsa_encrypt, rsa_generate_keypair). And then we got it wrong for the recent rsa_decrypt_tr. So I'll fix them as I find them. Technically, that may be an API change, but I think it's very unlikely to cause any problems.
- Should I rename it to _pkcs1_signature_prefix, in order to (i) make it more clear it's an internal function, and (ii) make applications depending on the old behaviour break in a more predictable fashion?
I'd say this is a good option. If you care about backwards compatibility then the old function could also be present.
The possibility of keeping the old one hadn't occured to me, but that's a good suggestion. It's easy to do, and nice to users. Maybe I should also read up on how to tell gcc that it is considered both internal and obsolete.
Regards, /Niels