From 8a9208612eec8ddae4c418485d848ecfa0613699 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Mon, 30 Oct 2023 22:12:14 +0100 Subject: Meta: Move kernel and userland to their own folders. This is to allow both the kernel and the userland to share certain header files and to make the folder structure a bit more clear. --- crypto/ChaCha20/chacha20.c | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 crypto/ChaCha20/chacha20.c (limited to 'crypto/ChaCha20/chacha20.c') diff --git a/crypto/ChaCha20/chacha20.c b/crypto/ChaCha20/chacha20.c deleted file mode 100644 index 5bf7aa2..0000000 --- a/crypto/ChaCha20/chacha20.c +++ /dev/null @@ -1,29 +0,0 @@ -#include "chacha20.h" - -#define ROTL(a, b) (((a) << (b)) | ((a) >> (32 - (b)))) -#define QR(a, b, c, d) \ - (a += b, d ^= a, d = ROTL(d, 16), c += d, b ^= c, b = ROTL(b, 12), \ - a += b, d ^= a, d = ROTL(d, 8), c += d, b ^= c, b = ROTL(b, 7)) -#define ROUNDS 20 - -void chacha_block(uint32_t out[16], uint32_t const in[16]) -{ - int i; - uint32_t x[16]; - - for (i = 0; i < 16; ++i) - x[i] = in[i]; - for (i = 0; i < ROUNDS; i += 2) { - QR(x[0], x[4], x[8], x[12]); - QR(x[1], x[5], x[9], x[13]); - QR(x[2], x[6], x[10], x[14]); - QR(x[3], x[7], x[11], x[15]); - - QR(x[0], x[5], x[10], x[15]); - QR(x[1], x[6], x[11], x[12]); - QR(x[2], x[7], x[8], x[13]); - QR(x[3], x[4], x[9], x[14]); - } - for (i = 0; i < 16; ++i) - out[i] = x[i] + in[i]; -} -- cgit v1.2.3