Dear All,

Can somebody tell me how one can implement "signInit" "signUpdate" and
"signFinal" via the engine?
To be more precise, I have just begun writing my own engine. I see that all
one needs is to define function pointers to the various calls. For RSA
engine, implementing Signing, one must use RSA_METHOD struct:

 typedef struct rsa_meth_st
 {

        const char *name;


        int (*rsa_pub_enc)(int flen, unsigned char *from,
          unsigned char *to, RSA *rsa, int padding);

        int (*rsa_pub_dec)(int flen, unsigned char *from,
          unsigned char *to, RSA *rsa, int padding);


        int (*rsa_priv_enc)(int flen, unsigned char *from,
          unsigned char *to, RSA *rsa, int padding);

        int (*rsa_priv_dec)(int flen, unsigned char *from,
          unsigned char *to, RSA *rsa, int padding);


        int (*rsa_mod_exp)(BIGNUM *r0, BIGNUM *I, RSA *rsa);


        int (*bn_mod_exp)(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
          const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);

        int (*init)(RSA *rsa);

        int (*finish)(RSA *rsa);


        int flags;


        char *app_data; /* ?? */


        int (*rsa_sign)(int type, unsigned char *m, unsigned int m_len,
           unsigned char *sigret, unsigned int *siglen, RSA *rsa);

        int (*rsa_verify)(int type, unsigned char *m, unsigned int m_len,
           unsigned char *sigbuf, unsigned int siglen, RSA *rsa);

 } RSA_METHOD;

However, I don't see any SignInit, SignUpdate pointers like in the
EVP_CIPHER or EVP_MD structs.

I need to redirect the SignInit, SignUpdate to our library.

Please advise.

Thanks.

Reply via email to