Lines Matching refs:ctx

70 static int dasync_sha1_init(EVP_MD_CTX *ctx);
71 static int dasync_sha1_update(EVP_MD_CTX *ctx, const void *data,
73 static int dasync_sha1_final(EVP_MD_CTX *ctx, unsigned char *md);
111 static int dasync_rsa_init(EVP_PKEY_CTX *ctx);
112 static void dasync_rsa_cleanup(EVP_PKEY_CTX *ctx);
113 static int dasync_rsa_paramgen_init(EVP_PKEY_CTX *ctx);
114 static int dasync_rsa_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey);
115 static int dasync_rsa_keygen_init(EVP_PKEY_CTX *ctx);
116 static int dasync_rsa_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey);
117 static int dasync_rsa_encrypt_init(EVP_PKEY_CTX *ctx);
118 static int dasync_rsa_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out,
121 static int dasync_rsa_decrypt_init(EVP_PKEY_CTX *ctx);
122 static int dasync_rsa_decrypt(EVP_PKEY_CTX *ctx, unsigned char *out,
125 static int dasync_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2);
126 static int dasync_rsa_ctrl_str(EVP_PKEY_CTX *ctx, const char *type,
134 static int dasync_aes128_cbc_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
136 static int dasync_aes128_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
138 static int dasync_aes128_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
140 static int dasync_aes128_cbc_cleanup(EVP_CIPHER_CTX *ctx);
142 static int dasync_aes256_ctr_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
144 static int dasync_aes256_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
146 static int dasync_aes256_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
148 static int dasync_aes256_ctr_cleanup(EVP_CIPHER_CTX *ctx);
150 static int dasync_aes128_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type,
152 static int dasync_aes128_cbc_hmac_sha1_init_key(EVP_CIPHER_CTX *ctx,
156 static int dasync_aes128_cbc_hmac_sha1_cipher(EVP_CIPHER_CTX *ctx,
160 static int dasync_aes128_cbc_hmac_sha1_cleanup(EVP_CIPHER_CTX *ctx);
503 static void wait_cleanup(ASYNC_WAIT_CTX *ctx, const void *key,
604 static int dasync_sha1_init(EVP_MD_CTX *ctx)
608 return EVP_MD_meth_get_init(EVP_sha1())(ctx);
611 static int dasync_sha1_update(EVP_MD_CTX *ctx, const void *data,
616 return EVP_MD_meth_get_update(EVP_sha1())(ctx, data, count);
619 static int dasync_sha1_final(EVP_MD_CTX *ctx, unsigned char *md)
623 return EVP_MD_meth_get_final(EVP_sha1())(ctx, md);
628 static int dasync_cipher_ctrl_helper(EVP_CIPHER_CTX *ctx, int type, int arg,
634 (struct dasync_pipeline_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
670 EVP_CIPHER_CTX_set_cipher_data(ctx, pipe_ctx->inner_cipher_data);
672 (ctx, type, arg, ptr);
673 EVP_CIPHER_CTX_set_cipher_data(ctx, pipe_ctx);
693 if (EVP_CIPHER_CTX_is_encrypting(ctx)) {
714 static int dasync_cipher_init_key_helper(EVP_CIPHER_CTX *ctx,
721 (struct dasync_pipeline_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
737 EVP_CIPHER_CTX_set_cipher_data(ctx, pipe_ctx->inner_cipher_data);
738 ret = EVP_CIPHER_meth_get_init(cipher)(ctx, key, iv, enc);
739 EVP_CIPHER_CTX_set_cipher_data(ctx, pipe_ctx);
744 static int dasync_cipher_helper(EVP_CIPHER_CTX *ctx, unsigned char *out,
751 (struct dasync_pipeline_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
754 EVP_CIPHER_CTX_set_cipher_data(ctx, pipe_ctx->inner_cipher_data);
760 (ctx, EVP_CTRL_AEAD_TLS1_AAD,
765 (ctx, out, in, inl);
772 (ctx, EVP_CTRL_AEAD_TLS1_AAD,
777 (ctx, pipe_ctx->outbufs[i], pipe_ctx->inbufs[i],
783 EVP_CIPHER_CTX_set_cipher_data(ctx, pipe_ctx);
787 static int dasync_cipher_cleanup_helper(EVP_CIPHER_CTX *ctx,
791 (struct dasync_pipeline_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
803 static int dasync_aes128_cbc_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
806 return dasync_cipher_ctrl_helper(ctx, type, arg, ptr, 0, EVP_aes_128_cbc());
809 static int dasync_aes128_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
812 return dasync_cipher_init_key_helper(ctx, key, iv, enc, EVP_aes_128_cbc());
815 static int dasync_aes128_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
818 return dasync_cipher_helper(ctx, out, in, inl, EVP_aes_128_cbc());
821 static int dasync_aes128_cbc_cleanup(EVP_CIPHER_CTX *ctx)
823 return dasync_cipher_cleanup_helper(ctx, EVP_aes_128_cbc());
826 static int dasync_aes256_ctr_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
829 return dasync_cipher_ctrl_helper(ctx, type, arg, ptr, 0, EVP_aes_256_ctr());
832 static int dasync_aes256_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
835 return dasync_cipher_init_key_helper(ctx, key, iv, enc, EVP_aes_256_ctr());
838 static int dasync_aes256_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
841 return dasync_cipher_helper(ctx, out, in, inl, EVP_aes_256_ctr());
844 static int dasync_aes256_ctr_cleanup(EVP_CIPHER_CTX *ctx)
846 return dasync_cipher_cleanup_helper(ctx, EVP_aes_256_ctr());
854 static int dasync_aes128_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type,
857 return dasync_cipher_ctrl_helper(ctx, type, arg, ptr, 1, EVP_aes_128_cbc_hmac_sha1());
860 static int dasync_aes128_cbc_hmac_sha1_init_key(EVP_CIPHER_CTX *ctx,
869 return dasync_cipher_init_key_helper(ctx, key, iv, enc,
873 static int dasync_aes128_cbc_hmac_sha1_cipher(EVP_CIPHER_CTX *ctx,
878 return dasync_cipher_helper(ctx, out, in, inl, EVP_aes_128_cbc_hmac_sha1());
881 static int dasync_aes128_cbc_hmac_sha1_cleanup(EVP_CIPHER_CTX *ctx)
887 return dasync_cipher_cleanup_helper(ctx, EVP_aes_128_cbc_hmac_sha1());
894 static int dasync_rsa_init(EVP_PKEY_CTX *ctx)
896 static int (*pinit)(EVP_PKEY_CTX *ctx);
900 return pinit(ctx);
903 static void dasync_rsa_cleanup(EVP_PKEY_CTX *ctx)
905 static void (*pcleanup)(EVP_PKEY_CTX *ctx);
909 pcleanup(ctx);
912 static int dasync_rsa_paramgen_init(EVP_PKEY_CTX *ctx)
914 static int (*pparamgen_init)(EVP_PKEY_CTX *ctx);
918 return pparamgen_init != NULL ? pparamgen_init(ctx) : 1;
921 static int dasync_rsa_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
927 return pparamgen != NULL ? pparamgen(ctx, pkey) : 1;
930 static int dasync_rsa_keygen_init(EVP_PKEY_CTX *ctx)
932 static int (*pkeygen_init)(EVP_PKEY_CTX *ctx);
936 return pkeygen_init != NULL ? pkeygen_init(ctx) : 1;
939 static int dasync_rsa_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
945 return pkeygen(ctx, pkey);
948 static int dasync_rsa_encrypt_init(EVP_PKEY_CTX *ctx)
950 static int (*pencrypt_init)(EVP_PKEY_CTX *ctx);
954 return pencrypt_init != NULL ? pencrypt_init(ctx) : 1;
957 static int dasync_rsa_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out,
961 static int (*pencryptfn)(EVP_PKEY_CTX *ctx, unsigned char *out,
967 return pencryptfn(ctx, out, outlen, in, inlen);
970 static int dasync_rsa_decrypt_init(EVP_PKEY_CTX *ctx)
972 static int (*pdecrypt_init)(EVP_PKEY_CTX *ctx);
976 return pdecrypt_init != NULL ? pdecrypt_init(ctx) : 1;
979 static int dasync_rsa_decrypt(EVP_PKEY_CTX *ctx, unsigned char *out,
983 static int (*pdecrypt)(EVP_PKEY_CTX *ctx, unsigned char *out,
989 return pdecrypt(ctx, out, outlen, in, inlen);
992 static int dasync_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
994 static int (*pctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2);
998 return pctrl(ctx, type, p1, p2);
1001 static int dasync_rsa_ctrl_str(EVP_PKEY_CTX *ctx, const char *type,
1004 static int (*pctrl_str)(EVP_PKEY_CTX *ctx, const char *type,
1009 return pctrl_str(ctx, type, value);