pike.git / src / post_modules / Nettle / hogweed.cmod

version» Context lines:

pike.git/src/post_modules/Nettle/hogweed.cmod:442:    }    }       /*! @decl int size()    *!    *! @returns    *! Returns the size in bits for a single coordinate on the curve.    */    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)    *!    *! @param rnd    *! Randomness function to use as source.    *!    *! @returns    *! Returns a random scalar suitable to use as an @[ECDSA] private key    *! or as an ECDH exponent.    */