tohexstr() documentation says the target buffer size should be at least len / 2 + 1 when it is len * 2 + 1. This makes the GOST unit test to fail on my OS X configured with native PKCS#11 (and of course for an unrelated reason :-). Fix is obvious and should be done in all versions as this function definition occurs more than once...