documented fix
[gnutls.git] / lib / gnutls_cipher_int.h
blob89d7966370191ca6915ad8dad7b915f1b797ae93
1 /*
2 * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2010 Free
3 * Software Foundation, Inc.
5 * Author: Nikos Mavrogiannopoulos
7 * This file is part of GnuTLS.
9 * The GnuTLS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1 of
12 * the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22 * USA
26 #ifndef GNUTLS_CIPHER_INT
27 #define GNUTLS_CIPHER_INT
29 #include <gnutls/crypto.h>
31 extern int crypto_cipher_prio;
32 extern gnutls_crypto_cipher_st _gnutls_cipher_ops;
34 typedef int (*cipher_encrypt_func) (void *hd, const void *plaintext, size_t,
35 void *ciphertext, size_t);
36 typedef int (*cipher_decrypt_func) (void *hd, const void *ciphertext, size_t,
37 void *plaintext, size_t);
38 typedef void (*cipher_deinit_func) (void *hd);
40 typedef struct
42 void *handle;
43 cipher_encrypt_func encrypt;
44 cipher_decrypt_func decrypt;
45 cipher_deinit_func deinit;
46 } cipher_hd_st;
48 int _gnutls_cipher_init (cipher_hd_st *, gnutls_cipher_algorithm_t cipher,
49 const gnutls_datum_t * key,
50 const gnutls_datum_t * iv);
51 int _gnutls_cipher_encrypt (const cipher_hd_st * handle, void *text,
52 int textlen);
53 int _gnutls_cipher_decrypt (const cipher_hd_st * handle, void *ciphertext,
54 int ciphertextlen);
55 int _gnutls_cipher_encrypt2 (const cipher_hd_st * handle, const void *text,
56 int textlen, void *ciphertext,
57 int ciphertextlen);
58 int _gnutls_cipher_decrypt2 (const cipher_hd_st * handle,
59 const void *ciphertext, int ciphertextlen,
60 void *text, int textlen);
61 void _gnutls_cipher_deinit (cipher_hd_st * handle);
63 #endif /* GNUTLS_CIPHER_INT */