Handbook of elliptic and hyperelliptic curve cryptography