offline pcap reading working
[netsniff-ng.git] / src / aes256ctr.h
blob287d3fe0d2c38bba06b4dfe00bbc400082737d66
1 /*
2 * netsniff-ng - the packet sniffing beast
3 * By Daniel Borkmann <daniel@netsniff-ng.org>
4 * Copyright 2011 Daniel Borkmann <dborkma@tik.ee.ethz.ch>,
5 * Swiss federal institute of technology (ETH Zurich)
6 * Subject to the GPL.
7 */
9 /*
10 * seccure - Copyright 2009 B. Poettering
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of the
15 * License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
25 * 02111-1307 USA
28 /*
29 * SECCURE Elliptic Curve Crypto Utility for Reliable Encryption
31 * http://point-at-infinity.org/seccure/
34 * seccure implements a selection of asymmetric algorithms based on
35 * elliptic curve cryptography (ECC). See the manpage or the project's
36 * homepage for further details.
38 * This code links against the GNU gcrypt library "libgcrypt" (which
39 * is part of the GnuPG project). Use the included Makefile to build
40 * the binary.
42 * Report bugs to: seccure AT point-at-infinity.org
46 #ifndef AES256CTR_H
47 #define AES256CTR_H
49 #include <gcrypt.h>
51 #define CIPHER_BLOCK_SIZE 16
52 #define CIPHER_KEY_SIZE 32
53 #define HMAC_KEY_SIZE 32
55 struct aes256ctr {
56 gcry_cipher_hd_t ch;
57 int idx;
58 char buf[CIPHER_BLOCK_SIZE];
61 extern struct aes256ctr *aes256ctr_init(const char *key);
62 extern void aes256ctr_enc(struct aes256ctr *ac, char *buf, int len);
63 #define aes256ctr_dec aes256ctr_enc
64 extern void aes256ctr_done(struct aes256ctr *ac);
65 extern int hmacsha256_init(gcry_md_hd_t * mh, const char *key, int len);
66 #define aes256cprng aes256ctr
67 #define aes256cprng_init aes256ctr_init
68 extern void aes256cprng_fillbuf(struct aes256cprng *cprng, char *buf, int len);
69 #define aes256cprng_done aes256ctr_done
71 #endif /* AES256CTR_H */