diff options
| author | ame <[email protected]> | 2024-03-13 16:03:10 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2024-03-13 16:03:10 -0500 |
| commit | cf36c993ba4bb931ecf9c84de41ab0bc5fc915e4 (patch) | |
| tree | 6e7f5619f468e5b4e34378def3e9f2960d909b38 /src/hash/blake2.h | |
| parent | 74289579ac66890ef0d7df2a5ec5f15f8308b8cd (diff) | |
blake2{b,s} and maybe other stuff
Diffstat (limited to 'src/hash/blake2.h')
| -rw-r--r-- | src/hash/blake2.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/hash/blake2.h b/src/hash/blake2.h new file mode 100644 index 0000000..cde04b3 --- /dev/null +++ b/src/hash/blake2.h @@ -0,0 +1,21 @@ +#include <stdint.h>
+#include "../lua.h"
+
+static const uint8_t blake2b_sigma[10][16] = {
+ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
+ { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 },
+ { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 },
+ { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 },
+ { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 },
+ { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 },
+ { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 },
+ { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 },
+ { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 },
+ { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 },
+};
+
+void blake2s(char*, int, char*, int, int, char*);
+void blake2b(char*, int, char*, int, int, char*);
+
+int l_blake2s(lua_State*);
+int l_blake2b(lua_State*);
\ No newline at end of file |
