summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-06-23 15:39:07 -0600
committerSimon Glass <sjg@chromium.org>2015-07-21 17:39:28 -0600
commit1acab96d974a1b9f35cbc901f68ef00653d18738 (patch)
treef21187eeb91fb8c77461203b0def9ebec1d7526a /include
parent6e780c7a7bfea05429d29fd30cdbf213583e03f6 (diff)
Add rivest cipher 4 (rc4) implementation
Add an implementation of RC4. This will be used by Rockchip booting but may be useful in other situations. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/rc4.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/rc4.h b/include/rc4.h
new file mode 100644
index 0000000000..ea409c2f3e
--- /dev/null
+++ b/include/rc4.h
@@ -0,0 +1,21 @@
+/*
+ * (C) Copyright 2015 Google, Inc
+ *
+ * (C) Copyright 2008-2014 Rockchip Electronics
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __RC4_H
+#define __RC4_H
+
+/**
+ * rc4_encode() - encode a buf with the RC4 cipher
+ *
+ * @buf: Buffer to encode (it is overwrite in the process
+ * @len: Length of buffer in bytes
+ * @key: 16-byte key to use
+ */
+void rc4_encode(unsigned char *buf, unsigned int len, unsigned char key[16]);
+
+#endif