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

version» Context lines:

pike.git/src/post_modules/Nettle/hogweed.cmod:358:    Pike_error("The curve has already been initialized!\n");    }       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;    break; -  + #endif /* HAVE_CURVE_NETTLE_SECP_192R1 */ + #ifdef HAVE_CURVE_NETTLE_SECP_224R1    case 224:    THIS->curve = &nettle_secp_224r1;    break; -  + #endif /* HAVE_CURVE_NETTLE_SECP_224R1 */ + #ifdef HAVE_CURVE_NETTLE_SECP_256R1    case 256:    THIS->curve = &nettle_secp_256r1;    break; -  + #endif /* HAVE_CURVE_NETTLE_SECP_256R1 */ + #ifdef HAVE_CURVE_NETTLE_SECP_384R1    case 384:    THIS->curve = &nettle_secp_384r1;    break; -  + #endif /* HAVE_CURVE_NETTLE_SECP_384R1 */ + #ifdef HAVE_CURVE_NETTLE_SECP_521R1    case 521:    THIS->curve = &nettle_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;    }    THIS->field_size = field_size;
pike.git/src/post_modules/Nettle/hogweed.cmod:951:      #endif /* HAVE_NETTLE_ECDSA_H */      /*! @endmodule Nettle    */      void   hogweed_init(void)   {    INIT; +  + #ifdef HAVE_NETTLE_ECDSA_H + #ifdef HAVE_CURVE_NETTLE_SECP_192R1 +  ADD_INT_CONSTANT("SECP192R1", 192, 0); + #endif /* HAVE_CURVE_NETTLE_SECP_192R1 */ + #ifdef HAVE_CURVE_NETTLE_SECP_224R1 +  ADD_INT_CONSTANT("SECP224R1", 224, 0); + #endif /* HAVE_CURVE_NETTLE_SECP_224R1 */ + #ifdef HAVE_CURVE_NETTLE_SECP_256R1 +  ADD_INT_CONSTANT("SECP256R1", 256, 0); + #endif /* HAVE_CURVE_NETTLE_SECP_256R1 */ + #ifdef HAVE_CURVE_NETTLE_SECP_384R1 +  ADD_INT_CONSTANT("SECP384R1", 384, 0); + #endif /* HAVE_CURVE_NETTLE_SECP_384R1 */ + #ifdef HAVE_CURVE_NETTLE_SECP_521R1 +  ADD_INT_CONSTANT("SECP521R1", 521, 0); + #endif /* HAVE_CURVE_NETTLE_SECP_521R1 */ + #endif /* HAVE_NETTLE_ECDSA_H */   }      void   hogweed_exit(void)   {    EXIT;   }      #endif