summaryrefslogtreecommitdiffstats
path: root/fs/cifs_common/arc4.h
diff options
context:
space:
mode:
authorRonnie Sahlberg <lsahlber@redhat.com>2021-08-19 20:34:59 +1000
committerSteve French <stfrench@microsoft.com>2021-08-25 15:47:57 -0500
commit71c02863246167b3d1639b8278681ca8ebedcb4e (patch)
treeb3358e81c8cbf007f5398c4c4486f64d48381398 /fs/cifs_common/arc4.h
parent76a3c92ec9e0668e4cd0e9ff1782eb68f61a179c (diff)
downloadlinux-71c02863246167b3d1639b8278681ca8ebedcb4e.tar.gz
linux-71c02863246167b3d1639b8278681ca8ebedcb4e.tar.bz2
linux-71c02863246167b3d1639b8278681ca8ebedcb4e.zip
cifs: fork arc4 and create a separate module for it for cifs and other users
We can not drop ARC4 and basically destroy CIFS connectivity for almost all CIFS users so create a new forked ARC4 module that CIFS and other subsystems that have a hard dependency on ARC4 can use. Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs_common/arc4.h')
-rw-r--r--fs/cifs_common/arc4.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/fs/cifs_common/arc4.h b/fs/cifs_common/arc4.h
new file mode 100644
index 000000000000..12e71ec033a1
--- /dev/null
+++ b/fs/cifs_common/arc4.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Common values for ARC4 Cipher Algorithm
+ */
+
+#ifndef _CRYPTO_ARC4_H
+#define _CRYPTO_ARC4_H
+
+#include <linux/types.h>
+
+#define ARC4_MIN_KEY_SIZE 1
+#define ARC4_MAX_KEY_SIZE 256
+#define ARC4_BLOCK_SIZE 1
+
+struct arc4_ctx {
+ u32 S[256];
+ u32 x, y;
+};
+
+int cifs_arc4_setkey(struct arc4_ctx *ctx, const u8 *in_key, unsigned int key_len);
+void cifs_arc4_crypt(struct arc4_ctx *ctx, u8 *out, const u8 *in, unsigned int len);
+
+#endif /* _CRYPTO_ARC4_H */