40 #include <sys/types.h>
42 #include <openssl/evp.h>
44 #include "cipher-chachapoly.h"
45 #include "cipher-aesctr.h"
47 #define CIPHER_ENCRYPT 1
48 #define CIPHER_DECRYPT 0
57 #define CFLAG_CBC (1<<0)
58 #define CFLAG_CHACHAPOLY (1<<1)
59 #define CFLAG_AESCTR (1<<2)
60 #define CFLAG_NONE (1<<3)
61 #define CFLAG_INTERNAL CFLAG_NONE
63 const EVP_CIPHER *(*evptype)(void);
71 void ssh_aes_ctr_thread_destroy(EVP_CIPHER_CTX *ctx);
72 void ssh_aes_ctr_thread_reconstruction(EVP_CIPHER_CTX *ctx);
73 struct sshcipher *cipher_by_name(
const char *);
74 const char *cipher_warning_message(
const struct sshcipher_ctx *);
75 int ciphers_valid(
const char *);
76 char *cipher_alg_list(
char,
int);
77 const char *compression_alg_list(
int);
78 int cipher_init(
struct sshcipher_ctx **,
const struct sshcipher *,
79 const u_char *, u_int,
const u_char *, u_int,
int);
80 int cipher_crypt(
struct sshcipher_ctx *, u_int, u_char *,
const u_char *,
82 int cipher_get_length(
struct sshcipher_ctx *, u_int *, u_int,
83 const u_char *, u_int);
84 void cipher_free(
struct sshcipher_ctx *);
85 u_int cipher_blocksize(
const struct sshcipher *);
86 u_int cipher_keylen(
const struct sshcipher *);
87 u_int cipher_seclen(
const struct sshcipher *);
88 u_int cipher_authlen(
const struct sshcipher *);
89 u_int cipher_ivlen(
const struct sshcipher *);
90 u_int cipher_is_cbc(
const struct sshcipher *);
91 void cipher_reset_multithreaded(
void);
92 const char *cipher_ctx_name(
const struct sshcipher_ctx *);
94 u_int cipher_ctx_is_plaintext(
struct sshcipher_ctx *);
96 int cipher_get_keyiv(
struct sshcipher_ctx *, u_char *,
size_t);
97 int cipher_set_keyiv(
struct sshcipher_ctx *,
const u_char *,
size_t);
98 int cipher_get_keyiv_len(
const struct sshcipher_ctx *);