iwym: cc20.h

This commit is contained in:
Hamish Coleman 2023-06-13 21:36:07 +01:00
parent ae3d54eed6
commit 20df771af7
4 changed files with 12 additions and 6 deletions

View File

@ -21,9 +21,9 @@
#define CC20_H
#include <stdint.h>
#include "n2n.h" // HAVE_OPENSSL_1_1, traceEvent ...
#include <stddef.h> // for size_t
#include <stdint.h> // for uint32_t, uint8_t
#include "config.h" // HAVE_OPENSSL_1_1
#define CC20_IV_SIZE 16
@ -46,8 +46,6 @@ typedef struct cc20_context_t {
#elif defined (__SSE2__) // SSE2 ---------------------------------------------------------------------------------
#include <immintrin.h>
typedef struct cc20_context {
uint32_t keystream32[16];
uint8_t key[CC20_KEY_BYTES];

View File

@ -143,7 +143,6 @@
#include "pearson.h"
#include "portable_endian.h"
#include "aes.h"
#include "cc20.h"
#include "speck.h"
#include "curve25519.h"
#include "n2n_regex.h"

View File

@ -17,7 +17,11 @@
*/
#include <stdlib.h> // for calloc, free, size_t
#include <string.h> // for memcpy
#include "cc20.h"
#include "config.h" // HAVE_OPENSSL_1_1
#include "portable_endian.h" // for htole32
#if defined (HAVE_OPENSSL_1_1) // openSSL 1.1 ---------------------------------------------------------------------
@ -84,6 +88,10 @@ int cc20_crypt (unsigned char *out, const unsigned char *in, size_t in_len,
// https://github.com/Ginurx/chacha20-c (public domain)
#include <immintrin.h> // for _mm_xor_si128, _mm_add_epi32, _mm_slli_epi32
#include <xmmintrin.h> // for _MM_SHUFFLE
#define SL _mm_slli_epi32
#define SR _mm_srli_epi32
#define XOR _mm_xor_si128

View File

@ -17,6 +17,7 @@
*/
#include "cc20.h" // for CC20_IV_SIZE, cc20_crypt, cc20_deinit
#include "n2n.h"