Return to chapoly_aead.h CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / strongswan / src / libstrongswan / plugins / chapoly |
1.1 misho 1: /* 2: * Copyright (C) 2015 Martin Willi 3: * Copyright (C) 2015 revosec AG 4: * 5: * This program is free software; you can redistribute it and/or modify it 6: * under the terms of the GNU General Public License as published by the 7: * Free Software Foundation; either version 2 of the License, or (at your 8: * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. 9: * 10: * This program is distributed in the hope that it will be useful, but 11: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 12: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13: * for more details. 14: */ 15: 16: /** 17: * @defgroup chapoly_aead chapoly_aead 18: * @{ @ingroup chapoly 19: */ 20: 21: #ifndef CHAPOLY_AEAD_H_ 22: #define CHAPOLY_AEAD_H_ 23: 24: #include <crypto/aead.h> 25: 26: typedef struct chapoly_aead_t chapoly_aead_t; 27: 28: /** 29: * ChaCha20/Poly1305 AEAD implementation. 30: * 31: * TODO-Chapoly: draft-ietf-ipsecme-chacha20-poly1305-05 32: */ 33: struct chapoly_aead_t { 34: 35: /** 36: * Implements aead_t interface. 37: */ 38: aead_t aead; 39: }; 40: 41: /** 42: * Create a chapoly_aead instance. 43: * 44: * @param algo algorithm to implement, ENCR_CHACHA20_POLY1305 45: * @param key_size key size in bytes, 32 46: * @param salt_size size of implicit salt length, 0 47: * @return AEAD, NULL if not supported 48: */ 49: chapoly_aead_t *chapoly_aead_create(encryption_algorithm_t algo, 50: size_t key_size, size_t salt_size); 51: 52: #endif /** CHAPOLY_AEAD_H_ @}*/