Optimisation: got rid of about 10% of the 32-bit divisions by using ec_enc_uint