Lines Matching refs:encoder
40 OSSL_ENCODER *encoder = NULL; in ossl_encoder_new() local
42 if ((encoder = OPENSSL_zalloc(sizeof(*encoder))) == NULL) in ossl_encoder_new()
44 if (!CRYPTO_NEW_REF(&encoder->base.refcnt, 1)) { in ossl_encoder_new()
45 OSSL_ENCODER_free(encoder); in ossl_encoder_new()
49 return encoder; in ossl_encoder_new()
52 int OSSL_ENCODER_up_ref(OSSL_ENCODER *encoder) in OSSL_ENCODER_up_ref() argument
56 CRYPTO_UP_REF(&encoder->base.refcnt, &ref); in OSSL_ENCODER_up_ref()
60 void OSSL_ENCODER_free(OSSL_ENCODER *encoder) in OSSL_ENCODER_free() argument
64 if (encoder == NULL) in OSSL_ENCODER_free()
67 CRYPTO_DOWN_REF(&encoder->base.refcnt, &ref); in OSSL_ENCODER_free()
70 OPENSSL_free(encoder->base.name); in OSSL_ENCODER_free()
71 ossl_property_free(encoder->base.parsed_propdef); in OSSL_ENCODER_free()
72 ossl_provider_free(encoder->base.prov); in OSSL_ENCODER_free()
73 CRYPTO_FREE_REF(&encoder->base.refcnt); in OSSL_ENCODER_free()
74 OPENSSL_free(encoder); in OSSL_ENCODER_free()
212 OSSL_ENCODER *encoder = NULL; in encoder_from_algorithm() local
216 if ((encoder = ossl_encoder_new()) == NULL) in encoder_from_algorithm()
218 encoder->base.id = id; in encoder_from_algorithm()
219 if ((encoder->base.name = ossl_algorithm_get1_first_name(algodef)) == NULL) { in encoder_from_algorithm()
220 OSSL_ENCODER_free(encoder); in encoder_from_algorithm()
223 encoder->base.algodef = algodef; in encoder_from_algorithm()
224 if ((encoder->base.parsed_propdef in encoder_from_algorithm()
226 OSSL_ENCODER_free(encoder); in encoder_from_algorithm()
233 if (encoder->newctx == NULL) in encoder_from_algorithm()
234 encoder->newctx = in encoder_from_algorithm()
238 if (encoder->freectx == NULL) in encoder_from_algorithm()
239 encoder->freectx = in encoder_from_algorithm()
243 if (encoder->get_params == NULL) in encoder_from_algorithm()
244 encoder->get_params = in encoder_from_algorithm()
248 if (encoder->gettable_params == NULL) in encoder_from_algorithm()
249 encoder->gettable_params = in encoder_from_algorithm()
253 if (encoder->set_ctx_params == NULL) in encoder_from_algorithm()
254 encoder->set_ctx_params = in encoder_from_algorithm()
258 if (encoder->settable_ctx_params == NULL) in encoder_from_algorithm()
259 encoder->settable_ctx_params = in encoder_from_algorithm()
263 if (encoder->does_selection == NULL) in encoder_from_algorithm()
264 encoder->does_selection = in encoder_from_algorithm()
268 if (encoder->encode == NULL) in encoder_from_algorithm()
269 encoder->encode = OSSL_FUNC_encoder_encode(fns); in encoder_from_algorithm()
272 if (encoder->import_object == NULL) in encoder_from_algorithm()
273 encoder->import_object = in encoder_from_algorithm()
277 if (encoder->free_object == NULL) in encoder_from_algorithm()
278 encoder->free_object = in encoder_from_algorithm()
288 if (!((encoder->newctx == NULL && encoder->freectx == NULL) in encoder_from_algorithm()
289 || (encoder->newctx != NULL && encoder->freectx != NULL) in encoder_from_algorithm()
290 || (encoder->import_object != NULL && encoder->free_object != NULL) in encoder_from_algorithm()
291 || (encoder->import_object == NULL && encoder->free_object == NULL)) in encoder_from_algorithm()
292 || encoder->encode == NULL) { in encoder_from_algorithm()
293 OSSL_ENCODER_free(encoder); in encoder_from_algorithm()
299 OSSL_ENCODER_free(encoder); in encoder_from_algorithm()
303 encoder->base.prov = prov; in encoder_from_algorithm()
304 return encoder; in encoder_from_algorithm()
473 const OSSL_PROVIDER *OSSL_ENCODER_get0_provider(const OSSL_ENCODER *encoder) in OSSL_ENCODER_get0_provider() argument
475 if (!ossl_assert(encoder != NULL)) { in OSSL_ENCODER_get0_provider()
480 return encoder->base.prov; in OSSL_ENCODER_get0_provider()
483 const char *OSSL_ENCODER_get0_properties(const OSSL_ENCODER *encoder) in OSSL_ENCODER_get0_properties() argument
485 if (!ossl_assert(encoder != NULL)) { in OSSL_ENCODER_get0_properties()
490 return encoder->base.algodef->property_definition; in OSSL_ENCODER_get0_properties()
494 ossl_encoder_parsed_properties(const OSSL_ENCODER *encoder) in ossl_encoder_parsed_properties() argument
496 if (!ossl_assert(encoder != NULL)) { in ossl_encoder_parsed_properties()
501 return encoder->base.parsed_propdef; in ossl_encoder_parsed_properties()
504 int ossl_encoder_get_number(const OSSL_ENCODER *encoder) in ossl_encoder_get_number() argument
506 if (!ossl_assert(encoder != NULL)) { in ossl_encoder_get_number()
511 return encoder->base.id; in ossl_encoder_get_number()
514 const char *OSSL_ENCODER_get0_name(const OSSL_ENCODER *encoder) in OSSL_ENCODER_get0_name() argument
516 return encoder->base.name; in OSSL_ENCODER_get0_name()
519 const char *OSSL_ENCODER_get0_description(const OSSL_ENCODER *encoder) in OSSL_ENCODER_get0_description() argument
521 return encoder->base.algodef->algorithm_description; in OSSL_ENCODER_get0_description()
524 int OSSL_ENCODER_is_a(const OSSL_ENCODER *encoder, const char *name) in OSSL_ENCODER_is_a() argument
526 if (encoder->base.prov != NULL) { in OSSL_ENCODER_is_a()
527 OSSL_LIB_CTX *libctx = ossl_provider_libctx(encoder->base.prov); in OSSL_ENCODER_is_a()
530 return ossl_namemap_name2num(namemap, name) == encoder->base.id; in OSSL_ENCODER_is_a()
536 void (*user_fn)(OSSL_ENCODER *encoder, void *arg);
548 void (*user_fn)(OSSL_ENCODER *encoder, in OSSL_ENCODER_do_all_provided() argument
567 int OSSL_ENCODER_names_do_all(const OSSL_ENCODER *encoder, in OSSL_ENCODER_names_do_all() argument
571 if (encoder == NULL) in OSSL_ENCODER_names_do_all()
574 if (encoder->base.prov != NULL) { in OSSL_ENCODER_names_do_all()
575 OSSL_LIB_CTX *libctx = ossl_provider_libctx(encoder->base.prov); in OSSL_ENCODER_names_do_all()
578 return ossl_namemap_doall_names(namemap, encoder->base.id, fn, data); in OSSL_ENCODER_names_do_all()
585 OSSL_ENCODER_gettable_params(OSSL_ENCODER *encoder) in OSSL_ENCODER_gettable_params() argument
587 if (encoder != NULL && encoder->gettable_params != NULL) { in OSSL_ENCODER_gettable_params()
588 void *provctx = ossl_provider_ctx(OSSL_ENCODER_get0_provider(encoder)); in OSSL_ENCODER_gettable_params()
590 return encoder->gettable_params(provctx); in OSSL_ENCODER_gettable_params()
595 int OSSL_ENCODER_get_params(OSSL_ENCODER *encoder, OSSL_PARAM params[]) in OSSL_ENCODER_get_params() argument
597 if (encoder != NULL && encoder->get_params != NULL) in OSSL_ENCODER_get_params()
598 return encoder->get_params(params); in OSSL_ENCODER_get_params()
602 const OSSL_PARAM *OSSL_ENCODER_settable_ctx_params(OSSL_ENCODER *encoder) in OSSL_ENCODER_settable_ctx_params() argument
604 if (encoder != NULL && encoder->settable_ctx_params != NULL) { in OSSL_ENCODER_settable_ctx_params()
605 void *provctx = ossl_provider_ctx(OSSL_ENCODER_get0_provider(encoder)); in OSSL_ENCODER_settable_ctx_params()
607 return encoder->settable_ctx_params(provctx); in OSSL_ENCODER_settable_ctx_params()
643 OSSL_ENCODER *encoder = OSSL_ENCODER_INSTANCE_get_encoder(encoder_inst); in OSSL_ENCODER_CTX_set_params() local
646 if (encoderctx == NULL || encoder->set_ctx_params == NULL) in OSSL_ENCODER_CTX_set_params()
648 if (!encoder->set_ctx_params(encoderctx, params)) in OSSL_ENCODER_CTX_set_params()