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:330:
#include <nettle/ecc.h> #include <nettle/ecdsa.h> /*! @class ECC_Curve *! *! Elliptic Curve Definition */ PIKECLASS ECC_Curve {
+
/*! @decl inherit __builtin.Nettle.ECC_Curve
+
*/
+
INHERIT "__builtin.Nettle.ECC_Curve";
+
CVAR const struct ecc_curve *curve; CVAR int field_size; DECLARE_STORAGE; /*! @decl void create(int(0..) family, int(0..) field_size, int(0..) revision) *! *! Initialize the curve. */ PIKEFUN void create(int(0..) family, int(0..) field_size, int(0..) revision)
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";
+
/*!
@decl inherit ECC
_
Curve::Point
+
*/
+
EXTRA
+
{
+
/* Perform an inherit of the Point class that our parent
+
* contains via its inherit of
_
_
builtin.Nettle.
ECC_Curve.
+
*/
+
struct program *parent_prog = Pike_compiler->previous->new_program;
+
struct object *parent_obj = Pike_compiler->previous->fake_object;
+
int parent_
Point
_fun_num =
+
really_low_find_shared_string_identifier(MK_STRING(
"
Point"),
+
parent_prog,
+
SEE_PROTECTED|SEE_PRIVATE)
;
+
if (parent_Point_fun_num >= 0) {
+
struct program *parent_Point_prog =
+
low_program_from_function(parent_obj, parent_Point_fun_num);
+
if (parent_Point_prog) {
+
parent_Point_fun_num =
+
really_low_reference_inherited_identifier(Pike_compiler->previous,
+
0, parent_Point_fun_num);
+
low_inherit(parent_Point_prog, 0,
+
parent_Point_fun_num,
+
1 + 42, 0, NULL);
+
}
+
}
+
}
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:680:
push_object(rx = fast_clone_object(get_auto_bignum_program())); push_object(ry = fast_clone_object(get_auto_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(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.
-
*/
+
} /*! @endclass Point */ /*! @class ECDSA *! *! Elliptic Curve Digital Signing Algorithm */ PIKECLASS ECDSA program_flags PROGRAM_USES_PARENT|PROGRAM_NEEDS_PARENT|PROGRAM_CLEAR_STORAGE;