Branch: Tag:

2015-01-28

2015-01-28 17:33:04 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Nettle.ECC_Curve: Survive Nettle 2.7.1.

ecc_bit_size() is a very new function in Nettle...

449:    */    PIKEFUN int size()    { + #ifdef HAVE_NETTLE_ECC_BIT_SIZE    push_int(ecc_bit_size(THIS->curve)); -  + #else +  if (THIS->curve == &nettle_secp_192r1) { +  push_int(192); +  } else if (THIS->curve == &nettle_secp_224r1) { +  push_int(224); +  } else if (THIS->curve == &nettle_secp_256r1) { +  push_int(256); +  } else if (THIS->curve == &nettle_secp_384r1) { +  push_int(384); +  } else if (THIS->curve == &nettle_secp_521r1) { +  push_int(521); +  } else { +  push_int(0);    } -  + #endif +  }       /*! @decl Gmp.mpz new_scalar(function(int(0..):string(8bit)) rnd)    *!