When using void pointers in calculations, the behaviour is undefined. Arithmetic operations on 'void *' is a GNU C extension, which defines the 'sizeof(void)' to be 1.
add talloc0 function (malloc and zero fill)
check return values of arithmetic openssl BN_* functions
check return values of BN_bin2bn function
remove useless BN_init calls right after BN_new
fix 2 small memory leaks