Make DH_METHOD opaque
[openssl.git] / crypto / dh / dh_locl.h
index 5d51e591fe253eddddc41ac43218b61ba152ff56..80d09d04e3f96be2f7296ad50251aac614cf3274 100644 (file)
@@ -36,3 +36,21 @@ struct dh_st {
     ENGINE *engine;
     CRYPTO_RWLOCK *lock;
 };
+
+struct dh_method {
+    char *name;
+    /* Methods here */
+    int (*generate_key) (DH *dh);
+    int (*compute_key) (unsigned char *key, const BIGNUM *pub_key, DH *dh);
+    /* Can be null */
+    int (*bn_mod_exp) (const DH *dh, BIGNUM *r, const BIGNUM *a,
+                       const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,
+                       BN_MONT_CTX *m_ctx);
+    int (*init) (DH *dh);
+    int (*finish) (DH *dh);
+    int flags;
+    char *app_data;
+    /* If this is non-NULL, it will be used to generate parameters */
+    int (*generate_params) (DH *dh, int prime_len, int generator,
+                            BN_GENCB *cb);
+};