Botan 3.4.0
Crypto and TLS for C&
commoncrypto.h
Go to the documentation of this file.
1/*
2* Utils for calling CommonCrypto
3* (C) 2018 Jose Pereira
4*
5* Botan is released under the Simplified BSD License (see license.txt)
6*/
7
8#ifndef BOTAN_INTERNAL_COMMONCRYPTO_H_
9#define BOTAN_INTERNAL_COMMONCRYPTO_H_
10
11#include <botan/exceptn.h>
12#include <botan/pk_ops_fwd.h>
13#include <botan/secmem.h>
14#include <memory>
15#include <string>
16#include <string_view>
17
18namespace Botan {
19
20class Cipher_Mode;
21class BlockCipher;
22class HashFunction;
23enum class Cipher_Dir : int;
24typedef int32_t CCCryptorStatus;
25
27 public:
28 CommonCrypto_Error(std::string_view what);
29
30 CommonCrypto_Error(std::string_view what, int32_t status);
31
32 ErrorType error_type() const noexcept override { return ErrorType::CommonCryptoError; }
33
34 int error_code() const noexcept override { return m_rc; }
35
36 private:
37 static std::string ccryptorstatus_to_string(CCCryptorStatus status);
38
39 int32_t m_rc;
40};
41
42/* Cipher Modes */
43
44std::unique_ptr<Cipher_Mode> make_commoncrypto_cipher_mode(std::string_view name, Cipher_Dir direction);
45
46/* Block Ciphers */
47
48std::unique_ptr<BlockCipher> make_commoncrypto_block_cipher(std::string_view name);
49
50/* Hash */
51
52std::unique_ptr<HashFunction> make_commoncrypto_hash(std::string_view name);
53
54} // namespace Botan
55
56#endif
ErrorType error_type() const noexcept override
int error_code() const noexcept override
std::string name
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
Definition compiler.h:31
std::unique_ptr< Cipher_Mode > make_commoncrypto_cipher_mode(std::string_view name, Cipher_Dir direction)
std::unique_ptr< BlockCipher > make_commoncrypto_block_cipher(std::string_view name)
std::unique_ptr< HashFunction > make_commoncrypto_hash(std::string_view name)
ErrorType
Definition exceptn.h:20
int32_t CCCryptorStatus