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

version» Context lines:

pike.git/src/post_modules/Nettle/hogweed.cmod:325:      #endif /* dsa_params_init */      #if defined(HAVE_NETTLE_ECDSA_H) && (defined(HAVE_CURVE_NETTLE_SECP_192R1) || defined(HAVE_CURVE_NETTLE_SECP_224R1) || defined(HAVE_CURVE_NETTLE_SECP_256R1) || defined(HAVE_CURVE_NETTLE_SECP_384R1) || defined(HAVE_CURVE_NETTLE_SECP_521R1))   #include <nettle/ecc-curve.h>      #include <nettle/ecc.h>      #include <nettle/ecdsa.h>    + #ifdef NEED_WRAPPER_FOR_CURVE_NETTLE_SECP_192R1 + static const struct ecc_curve *nettle_get_secp_192r1(void) { +  return &nettle_secp_192r1; + } + #endif /* NEED_WRAPPER_FOR_CURVE_NETTLE_SECP_192R1 */ + #ifdef NEED_WRAPPER_FOR_CURVE_NETTLE_SECP_224R1 + static const struct ecc_curve *nettle_get_secp_224r1(void) { +  return &nettle_secp_224r1; + } + #endif /* NEED_WRAPPER_FOR_CURVE_NETTLE_SECP_224R1 */ + #ifdef NEED_WRAPPER_FOR_CURVE_NETTLE_SECP_256R1 + static const struct ecc_curve *nettle_get_secp_256r1(void) { +  return &nettle_secp_256r1; + } + #endif /* NEED_WRAPPER_FOR_CURVE_NETTLE_SECP_256R1 */ + #ifdef NEED_WRAPPER_FOR_CURVE_NETTLE_SECP_384R1 + static const struct ecc_curve *nettle_get_secp_384r1(void) { +  return &nettle_secp_384r1; + } + #endif /* NEED_WRAPPER_FOR_CURVE_NETTLE_SECP_384R1 */ + #ifdef NEED_WRAPPER_FOR_CURVE_NETTLE_SECP_521R1 + static const struct ecc_curve *nettle_get_secp_521r1(void) { +  return &nettle_secp_521r1; + } + #endif /* NEED_WRAPPER_FOR_CURVE_NETTLE_SECP_521R1 */ +    /*! @class ECC_Curve    *!    *! Elliptic Curve Definition    */   PIKECLASS ECC_Curve   {    /*! @decl inherit __builtin.Nettle.ECC_Curve    */    INHERIT "__builtin.Nettle.ECC_Curve";   
pike.git/src/post_modules/Nettle/hogweed.cmod:359:    }       switch(family) {    case 1:    if (revision != 1)    Pike_error("Unsupported revision.\n");    switch(field_size)    {    case 192:   #ifdef HAVE_CURVE_NETTLE_SECP_192R1 -  THIS->curve = &nettle_secp_192r1; +  THIS->curve = nettle_get_secp_192r1();    break;   #endif /* HAVE_CURVE_NETTLE_SECP_192R1 */   #ifdef HAVE_CURVE_NETTLE_SECP_224R1    case 224: -  THIS->curve = &nettle_secp_224r1; +  THIS->curve = nettle_get_secp_224r1();    break;   #endif /* HAVE_CURVE_NETTLE_SECP_224R1 */   #ifdef HAVE_CURVE_NETTLE_SECP_256R1    case 256: -  THIS->curve = &nettle_secp_256r1; +  THIS->curve = nettle_get_secp_256r1();    break;   #endif /* HAVE_CURVE_NETTLE_SECP_256R1 */   #ifdef HAVE_CURVE_NETTLE_SECP_384R1    case 384: -  THIS->curve = &nettle_secp_384r1; +  THIS->curve = nettle_get_secp_384r1;    break;   #endif /* HAVE_CURVE_NETTLE_SECP_384R1 */   #ifdef HAVE_CURVE_NETTLE_SECP_521R1    case 521: -  THIS->curve = &nettle_secp_521r1; +  THIS->curve = nettle_get_secp_521r1();    break;   #endif /* HAVE_CURVE_NETTLE_SECP_521R1 */    default:    Pike_error("Invalid curve\n");    break;    }    break;    default:    Pike_error("Unknown curve family.\n");    break;
pike.git/src/post_modules/Nettle/hogweed.cmod:401:    THIS->field_size = field_size;    }       /*! @decl string(7bit) name()    *!    *! Returns the name of the curve.    */    PIKEFUN string(7bit) name()    {   #ifdef HAVE_CURVE_NETTLE_SECP_192R1 -  if (THIS->curve == &nettle_secp_192r1) { +  if (THIS->curve == nettle_get_secp_192r1()) {    ref_push_string(MK_STRING("SECP_192R1"));    return;    }   #endif /* HAVE_CURVE_NETTLE_SECP_192R1 */   #ifdef HAVE_CURVE_NETTLE_SECP_224R1 -  if (THIS->curve == &nettle_secp_224r1) { +  if (THIS->curve == nettle_get_secp_224r1()) {    ref_push_string(MK_STRING("SECP_224R1"));    return;    }   #endif /* HAVE_CURVE_NETTLE_SECP_224R1 */   #ifdef HAVE_CURVE_NETTLE_SECP_256R1 -  if (THIS->curve == &nettle_secp_256r1) { +  if (THIS->curve == nettle_get_secp_256r1()) {    ref_push_string(MK_STRING("SECP_256R1"));    return;    }   #endif /* HAVE_CURVE_NETTLE_SECP_256R1 */   #ifdef HAVE_CURVE_NETTLE_SECP_384R1 -  if (THIS->curve == &nettle_secp_384r1) { +  if (THIS->curve == nettle_get_secp_384r1()) {    ref_push_string(MK_STRING("SECP_384R1"));    return;    }   #endif /* HAVE_CURVE_NETTLE_SECP_384R1 */   #ifdef HAVE_CURVE_NETTLE_SECP_521R1 -  if (THIS->curve == &nettle_secp_521r1) { +  if (THIS->curve == nettle_get_secp_521r1()) {    ref_push_string(MK_STRING("SECP_521R1"));    return;    }   #endif /* HAVE_CURVE_NETTLE_SECP_521R1 */    ref_push_string(MK_STRING("UNKNOWN"));    }       /*! @decl int size()    *!    *! @returns