param_build_set.h 2.0 KB

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