1e1051a39Sopenharmony_ci/*
2e1051a39Sopenharmony_ci * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
3e1051a39Sopenharmony_ci *
4e1051a39Sopenharmony_ci * Licensed under the Apache License 2.0 (the "License").  You may not use
5e1051a39Sopenharmony_ci * this file except in compliance with the License.  You can obtain a copy
6e1051a39Sopenharmony_ci * in the file LICENSE in the source distribution or at
7e1051a39Sopenharmony_ci * https://www.openssl.org/source/license.html
8e1051a39Sopenharmony_ci */
9e1051a39Sopenharmony_ci
10e1051a39Sopenharmony_ci#ifndef OSSL_INTERNAL_PARAM_BUILD_SET_H
11e1051a39Sopenharmony_ci# define OSSL_INTERNAL_PARAM_BUILD_SET_H
12e1051a39Sopenharmony_ci# pragma once
13e1051a39Sopenharmony_ci
14e1051a39Sopenharmony_ci# include <openssl/safestack.h>
15e1051a39Sopenharmony_ci# include <openssl/param_build.h>
16e1051a39Sopenharmony_ci# include "internal/cryptlib.h"
17e1051a39Sopenharmony_ci
18e1051a39Sopenharmony_citypedef union {
19e1051a39Sopenharmony_ci    OSSL_UNION_ALIGN;
20e1051a39Sopenharmony_ci} OSSL_PARAM_ALIGNED_BLOCK;
21e1051a39Sopenharmony_ci
22e1051a39Sopenharmony_ci# define OSSL_PARAM_ALIGN_SIZE  sizeof(OSSL_PARAM_ALIGNED_BLOCK)
23e1051a39Sopenharmony_ci
24e1051a39Sopenharmony_cisize_t ossl_param_bytes_to_blocks(size_t bytes);
25e1051a39Sopenharmony_civoid ossl_param_set_secure_block(OSSL_PARAM *last, void *secure_buffer,
26e1051a39Sopenharmony_ci                                 size_t secure_buffer_sz);
27e1051a39Sopenharmony_ci
28e1051a39Sopenharmony_ciint ossl_param_build_set_int(OSSL_PARAM_BLD *bld, OSSL_PARAM *p,
29e1051a39Sopenharmony_ci                             const char *key, int num);
30e1051a39Sopenharmony_ciint ossl_param_build_set_long(OSSL_PARAM_BLD *bld, OSSL_PARAM *p,
31e1051a39Sopenharmony_ci                              const char *key, long num);
32e1051a39Sopenharmony_ciint ossl_param_build_set_utf8_string(OSSL_PARAM_BLD *bld, OSSL_PARAM *p,
33e1051a39Sopenharmony_ci                                     const char *key, const char *buf);
34e1051a39Sopenharmony_ciint ossl_param_build_set_octet_string(OSSL_PARAM_BLD *bld, OSSL_PARAM *p,
35e1051a39Sopenharmony_ci                                      const char *key,
36e1051a39Sopenharmony_ci                                      const unsigned char *data,
37e1051a39Sopenharmony_ci                                      size_t data_len);
38e1051a39Sopenharmony_ciint ossl_param_build_set_bn(OSSL_PARAM_BLD *bld, OSSL_PARAM *p,
39e1051a39Sopenharmony_ci                            const char *key, const BIGNUM *bn);
40e1051a39Sopenharmony_ciint ossl_param_build_set_bn_pad(OSSL_PARAM_BLD *bld, OSSL_PARAM *p,
41e1051a39Sopenharmony_ci                                const char *key, const BIGNUM *bn,  size_t sz);
42e1051a39Sopenharmony_ciint ossl_param_build_set_multi_key_bn(OSSL_PARAM_BLD *bld, OSSL_PARAM *p,
43e1051a39Sopenharmony_ci                                      const char *names[],
44e1051a39Sopenharmony_ci                                      STACK_OF(BIGNUM_const) *stk);
45e1051a39Sopenharmony_ci
46e1051a39Sopenharmony_ci#endif  /* OSSL_INTERNAL_PARAM_BUILD_SET_H */
47