crypto_compat.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef CRYPTO_COMPAT_H_
  2. #define CRYPTO_COMPAT_H_
  3. #include <openssl/ossl_typ.h>
  4. /**
  5. * crypto_compat_RSA_valid_size(key):
  6. * Return nonzero if ${key} has a valid size, and zero for an invalid size.
  7. */
  8. int crypto_compat_RSA_valid_size(const RSA * const);
  9. /**
  10. * crypto_compat_RSA_import(key, n, e, d, p, q, dmp1, dmq1, iqmp):
  11. * Import the given BIGNUMs into the RSA ${key}. If this function fails,
  12. * free any any BIGNUMs which have not been imported into the ${key}, but do
  13. * not free the ${key} itself.
  14. */
  15. int crypto_compat_RSA_import(RSA *, BIGNUM *, BIGNUM *, BIGNUM *,
  16. BIGNUM *, BIGNUM *, BIGNUM *, BIGNUM *, BIGNUM *);
  17. /**
  18. * crypto_compat_RSA_export(key, n, e, d, p, q, dmp1, dmq1, iqmp):
  19. * Export values from the given RSA ${key} into the BIGNUMs. ${n} and ${e}
  20. * must be non-NULL; the other values may be NULL if desired, and will
  21. * therefore not be exported.
  22. */
  23. int crypto_compat_RSA_export(RSA *, const BIGNUM **, const BIGNUM **,
  24. const BIGNUM **, const BIGNUM **, const BIGNUM **,
  25. const BIGNUM **, const BIGNUM **, const BIGNUM **);
  26. /**
  27. * crypto_compat_RSA_generate_key(void):
  28. * Generate a key pair.
  29. */
  30. RSA * crypto_compat_RSA_generate_key(void);
  31. /**
  32. * crypto_compat_free(void):
  33. * Free the shared memory allocated by OpenSSL.
  34. */
  35. void crypto_compat_free(void);
  36. #endif /* !CRYPTO_COMPAT_H_ */