Some actual method functions (not enough yet to use the EC library, though),
[openssl.git] / crypto / ec / ecp_recp.c
index 4bc2b7ebc507df6c857f5c75e03084338b94964b..b2a8da92b0295d070f814b48b125cb4b2a684561 100644 (file)
@@ -1,4 +1,3 @@
-/* TODO */
 /* crypto/ec/ecp_recp.c */
 /* ====================================================================
  * Copyright (c) 1998-2001 The OpenSSL Project.  All rights reserved.
 
 const EC_METHOD *EC_GFp_recp_method(void)
        {
-       static const EC_METHOD ret =
-               {
-                       0 /* XXX */
-               };
+       static const EC_METHOD ret = {
+               ec_GFp_recp_group_init,
+               ec_GFp_recp_group_set_curve_GFp,
+               ec_GFp_recp_group_finish,
+               ec_GFp_recp_group_clear_finish,
+               ec_GFp_recp_group_copy,
+               ec_GFp_simple_group_set_generator,
+               /* TODO: 'set' and 'get' functions for EC_GROUPs */
+               ec_GFp_simple_point_init,
+               ec_GFp_simple_point_finish,
+               ec_GFp_simple_point_clear_finish,
+               ec_GFp_simple_point_copy,
+               /* TODO: 'set' and 'get' functions for EC_POINTs */
+               ec_GFp_simple_point2oct,
+               ec_GFp_simple_oct2point,
+               ec_GFp_simple_add,
+               ec_GFp_simple_dbl,
+               ec_GFp_simple_is_at_infinity,
+               ec_GFp_simple_is_on_curve,
+               ec_GFp_simple_make_affine,
+               ec_GFp_recp_field_mul,
+               ec_GFp_recp_field_sqr,
+               ec_GFp_recp_field_encode,
+               ec_GFp_recp_field_decode };
 
        return &ret;
        }
+
+
+int ec_GFp_recp_group_init(EC_GROUP *group)
+       {
+       int ok;
+
+       ok = ec_GFp_simple_group_init(group);
+       group->field_data = NULL;
+       return ok;
+       }
+
+
+int ec_GFp_recp_group_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
+/* TODO */
+
+
+void ec_GFp_recp_group_finish(EC_GROUP *group);
+/* TODO */
+
+
+void ec_GFp_recp_group_clear_finish(EC_GROUP *group);
+/* TODO */
+
+
+int ec_GFp_recp_group_copy(EC_GROUP *dest, const EC_GROUP *src);
+/* TODO */
+
+
+int ec_GFp_recp_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
+/* TODO */
+
+
+int ec_GFp_recp_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, BN_CTX *ctx);
+/* TODO */
+
+
+int ec_GFp_recp_field_encode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, BN_CTX *ctx);
+/* TODO */
+
+
+int ec_GFp_recp_field_decode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, BN_CTX *ctx);
+/* TODO */