pike.git
/
src
/
post_modules
/
Nettle
/
hogweed.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/post_modules/Nettle/hogweed.cmod:547:
/*! @class Point *! *! A point on an elliptic curve. */ PIKECLASS Point program_flags PROGRAM_USES_PARENT|PROGRAM_NEEDS_PARENT|PROGRAM_CLEAR_STORAGE; { CVAR struct ecc_point point;
+
INHERIT "__builtin.Nettle.Point";
+
INIT { const struct ecc_curve *curve = (((const struct Nettle_ECC_Curve_struct *)parent_storage(1, Nettle_ECC_Curve_program))->curve); if (!curve) Pike_error("No curve selected.\n"); ecc_point_init(&THIS->point, curve); } EXIT {
pike.git/src/post_modules/Nettle/hogweed.cmod:679:
push_object(rx = fast_clone_object(bignum_program)); push_object(ry = fast_clone_object(bignum_program)); ecc_point_get(&r, (mpz_ptr)rx->storage, (mpz_ptr)ry->storage); ecc_point_clear(&r); ecc_scalar_clear(&s); apply_external(1, Nettle_ECC_Curve_Point_program_fun_num, 2); }
-
/*! @decl void create(
object(
Gmp.mpz
)
|int x,
object(
Gmp.mpz
)
|int y)
+
/*! @decl void create(Gmp.mpz|int x, Gmp.mpz|int y)
+
*! @decl void create(Stdio.Buffer|string(7bit) data)
*! *! Initialize to the selected point on the curve. *! *! @note *! Throws errors if the point isn't on the curve. */
-
PIKEFUN void create(object(Gmp.mpz)|int x, object(Gmp.mpz)|int y)
-
flags ID_PROTECTED;
-
{
-
apply_current(f_Nettle_ECC_Curve_Point_set_fun_num, args);
+
}
-
}
+
/*! @endclass Point */ /*! @class ECDSA *! *! Elliptic Curve Digital Signing Algorithm */ PIKECLASS ECDSA program_flags PROGRAM_USES_PARENT|PROGRAM_NEEDS_PARENT|PROGRAM_CLEAR_STORAGE; {