Lines Matching refs:encoder
30 OSSL_ENCODER *encoder = NULL; in ossl_encoder_new() local
32 if ((encoder = OPENSSL_zalloc(sizeof(*encoder))) == NULL) in ossl_encoder_new()
34 if (!CRYPTO_NEW_REF(&encoder->base.refcnt, 1)) { in ossl_encoder_new()
35 OSSL_ENCODER_free(encoder); in ossl_encoder_new()
39 return encoder; in ossl_encoder_new()
42 int OSSL_ENCODER_up_ref(OSSL_ENCODER *encoder) in OSSL_ENCODER_up_ref() argument
46 CRYPTO_UP_REF(&encoder->base.refcnt, &ref); in OSSL_ENCODER_up_ref()
50 void OSSL_ENCODER_free(OSSL_ENCODER *encoder) in OSSL_ENCODER_free() argument
54 if (encoder == NULL) in OSSL_ENCODER_free()
57 CRYPTO_DOWN_REF(&encoder->base.refcnt, &ref); in OSSL_ENCODER_free()
60 OPENSSL_free(encoder->base.name); in OSSL_ENCODER_free()
61 ossl_property_free(encoder->base.parsed_propdef); in OSSL_ENCODER_free()
62 ossl_provider_free(encoder->base.prov); in OSSL_ENCODER_free()
63 CRYPTO_FREE_REF(&encoder->base.refcnt); in OSSL_ENCODER_free()
64 OPENSSL_free(encoder); in OSSL_ENCODER_free()
202 OSSL_ENCODER *encoder = NULL; in encoder_from_algorithm() local
206 if ((encoder = ossl_encoder_new()) == NULL) in encoder_from_algorithm()
208 encoder->base.id = id; in encoder_from_algorithm()
209 if ((encoder->base.name = ossl_algorithm_get1_first_name(algodef)) == NULL) { in encoder_from_algorithm()
210 OSSL_ENCODER_free(encoder); in encoder_from_algorithm()
213 encoder->base.algodef = algodef; in encoder_from_algorithm()
214 if ((encoder->base.parsed_propdef in encoder_from_algorithm()
216 OSSL_ENCODER_free(encoder); in encoder_from_algorithm()
223 if (encoder->newctx == NULL) in encoder_from_algorithm()
224 encoder->newctx = in encoder_from_algorithm()
228 if (encoder->freectx == NULL) in encoder_from_algorithm()
229 encoder->freectx = in encoder_from_algorithm()
233 if (encoder->get_params == NULL) in encoder_from_algorithm()
234 encoder->get_params = in encoder_from_algorithm()
238 if (encoder->gettable_params == NULL) in encoder_from_algorithm()
239 encoder->gettable_params = in encoder_from_algorithm()
243 if (encoder->set_ctx_params == NULL) in encoder_from_algorithm()
244 encoder->set_ctx_params = in encoder_from_algorithm()
248 if (encoder->settable_ctx_params == NULL) in encoder_from_algorithm()
249 encoder->settable_ctx_params = in encoder_from_algorithm()
253 if (encoder->does_selection == NULL) in encoder_from_algorithm()
254 encoder->does_selection = in encoder_from_algorithm()
258 if (encoder->encode == NULL) in encoder_from_algorithm()
259 encoder->encode = OSSL_FUNC_encoder_encode(fns); in encoder_from_algorithm()
262 if (encoder->import_object == NULL) in encoder_from_algorithm()
263 encoder->import_object = in encoder_from_algorithm()
267 if (encoder->free_object == NULL) in encoder_from_algorithm()
268 encoder->free_object = in encoder_from_algorithm()
278 if (!((encoder->newctx == NULL && encoder->freectx == NULL) in encoder_from_algorithm()
279 || (encoder->newctx != NULL && encoder->freectx != NULL) in encoder_from_algorithm()
280 || (encoder->import_object != NULL && encoder->free_object != NULL) in encoder_from_algorithm()
281 || (encoder->import_object == NULL && encoder->free_object == NULL)) in encoder_from_algorithm()
282 || encoder->encode == NULL) { in encoder_from_algorithm()
283 OSSL_ENCODER_free(encoder); in encoder_from_algorithm()
289 OSSL_ENCODER_free(encoder); in encoder_from_algorithm()
293 encoder->base.prov = prov; in encoder_from_algorithm()
294 return encoder; in encoder_from_algorithm()
463 const OSSL_PROVIDER *OSSL_ENCODER_get0_provider(const OSSL_ENCODER *encoder) in OSSL_ENCODER_get0_provider() argument
465 if (!ossl_assert(encoder != NULL)) { in OSSL_ENCODER_get0_provider()
470 return encoder->base.prov; in OSSL_ENCODER_get0_provider()
473 const char *OSSL_ENCODER_get0_properties(const OSSL_ENCODER *encoder) in OSSL_ENCODER_get0_properties() argument
475 if (!ossl_assert(encoder != NULL)) { in OSSL_ENCODER_get0_properties()
480 return encoder->base.algodef->property_definition; in OSSL_ENCODER_get0_properties()
484 ossl_encoder_parsed_properties(const OSSL_ENCODER *encoder) in ossl_encoder_parsed_properties() argument
486 if (!ossl_assert(encoder != NULL)) { in ossl_encoder_parsed_properties()
491 return encoder->base.parsed_propdef; in ossl_encoder_parsed_properties()
494 int ossl_encoder_get_number(const OSSL_ENCODER *encoder) in ossl_encoder_get_number() argument
496 if (!ossl_assert(encoder != NULL)) { in ossl_encoder_get_number()
501 return encoder->base.id; in ossl_encoder_get_number()
504 const char *OSSL_ENCODER_get0_name(const OSSL_ENCODER *encoder) in OSSL_ENCODER_get0_name() argument
506 return encoder->base.name; in OSSL_ENCODER_get0_name()
509 const char *OSSL_ENCODER_get0_description(const OSSL_ENCODER *encoder) in OSSL_ENCODER_get0_description() argument
511 return encoder->base.algodef->algorithm_description; in OSSL_ENCODER_get0_description()
514 int OSSL_ENCODER_is_a(const OSSL_ENCODER *encoder, const char *name) in OSSL_ENCODER_is_a() argument
516 if (encoder->base.prov != NULL) { in OSSL_ENCODER_is_a()
517 OSSL_LIB_CTX *libctx = ossl_provider_libctx(encoder->base.prov); in OSSL_ENCODER_is_a()
520 return ossl_namemap_name2num(namemap, name) == encoder->base.id; in OSSL_ENCODER_is_a()
526 void (*user_fn)(OSSL_ENCODER *encoder, void *arg);
538 void (*user_fn)(OSSL_ENCODER *encoder, in OSSL_ENCODER_do_all_provided() argument
557 int OSSL_ENCODER_names_do_all(const OSSL_ENCODER *encoder, in OSSL_ENCODER_names_do_all() argument
561 if (encoder == NULL) in OSSL_ENCODER_names_do_all()
564 if (encoder->base.prov != NULL) { in OSSL_ENCODER_names_do_all()
565 OSSL_LIB_CTX *libctx = ossl_provider_libctx(encoder->base.prov); in OSSL_ENCODER_names_do_all()
568 return ossl_namemap_doall_names(namemap, encoder->base.id, fn, data); in OSSL_ENCODER_names_do_all()
575 OSSL_ENCODER_gettable_params(OSSL_ENCODER *encoder) in OSSL_ENCODER_gettable_params() argument
577 if (encoder != NULL && encoder->gettable_params != NULL) { in OSSL_ENCODER_gettable_params()
578 void *provctx = ossl_provider_ctx(OSSL_ENCODER_get0_provider(encoder)); in OSSL_ENCODER_gettable_params()
580 return encoder->gettable_params(provctx); in OSSL_ENCODER_gettable_params()
585 int OSSL_ENCODER_get_params(OSSL_ENCODER *encoder, OSSL_PARAM params[]) in OSSL_ENCODER_get_params() argument
587 if (encoder != NULL && encoder->get_params != NULL) in OSSL_ENCODER_get_params()
588 return encoder->get_params(params); in OSSL_ENCODER_get_params()
592 const OSSL_PARAM *OSSL_ENCODER_settable_ctx_params(OSSL_ENCODER *encoder) in OSSL_ENCODER_settable_ctx_params() argument
594 if (encoder != NULL && encoder->settable_ctx_params != NULL) { in OSSL_ENCODER_settable_ctx_params()
595 void *provctx = ossl_provider_ctx(OSSL_ENCODER_get0_provider(encoder)); in OSSL_ENCODER_settable_ctx_params()
597 return encoder->settable_ctx_params(provctx); in OSSL_ENCODER_settable_ctx_params()
633 OSSL_ENCODER *encoder = OSSL_ENCODER_INSTANCE_get_encoder(encoder_inst); in OSSL_ENCODER_CTX_set_params() local
636 if (encoderctx == NULL || encoder->set_ctx_params == NULL) in OSSL_ENCODER_CTX_set_params()
638 if (!encoder->set_ctx_params(encoderctx, params)) in OSSL_ENCODER_CTX_set_params()