- enum blake2s_constant
- {
- BLAKE2S_BLOCKBYTES = 64,
- BLAKE2S_OUTBYTES = 32,
- BLAKE2S_KEYBYTES = 32,
- BLAKE2S_SALTBYTES = 8,
- BLAKE2S_PERSONALBYTES = 8
- };
-
- enum blake2b_constant
- {
- BLAKE2B_BLOCKBYTES = 128,
- BLAKE2B_OUTBYTES = 64,
- BLAKE2B_KEYBYTES = 64,
- BLAKE2B_SALTBYTES = 16,
- BLAKE2B_PERSONALBYTES = 16
- };
-
- typedef struct blake2s_state__
- {
- uint32_t h[8];
- uint32_t t[2];
- uint32_t f[2];
- uint8_t buf[BLAKE2S_BLOCKBYTES];
- size_t buflen;
- size_t outlen;
- uint8_t last_node;
- } blake2s_state;
-
- typedef struct blake2b_state__
- {
- uint64_t h[8];
- uint64_t t[2];
- uint64_t f[2];
- uint8_t buf[BLAKE2B_BLOCKBYTES];
- size_t buflen;
- size_t outlen;
- uint8_t last_node;
- } blake2b_state;
-
- typedef struct blake2sp_state__
- {
- blake2s_state S[8][1];
- blake2s_state R[1];
- uint8_t buf[8 * BLAKE2S_BLOCKBYTES];
- size_t buflen;
- size_t outlen;
- } blake2sp_state;
-
- typedef struct blake2bp_state__
- {
- blake2b_state S[4][1];
- blake2b_state R[1];
- uint8_t buf[4 * BLAKE2B_BLOCKBYTES];
- size_t buflen;
- size_t outlen;
- } blake2bp_state;
-
-
- BLAKE2_PACKED(struct blake2s_param__
- {
- uint8_t digest_length; /* 1 */
- uint8_t key_length; /* 2 */
- uint8_t fanout; /* 3 */
- uint8_t depth; /* 4 */
- uint32_t leaf_length; /* 8 */
- uint32_t node_offset; /* 12 */
- uint16_t xof_length; /* 14 */
- uint8_t node_depth; /* 15 */
- uint8_t inner_length; /* 16 */
- /* uint8_t reserved[0]; */
- uint8_t salt[BLAKE2S_SALTBYTES]; /* 24 */
- uint8_t personal[BLAKE2S_PERSONALBYTES]; /* 32 */
- });
-
- typedef struct blake2s_param__ blake2s_param;
-
- BLAKE2_PACKED(struct blake2b_param__
- {
- uint8_t digest_length; /* 1 */
- uint8_t key_length; /* 2 */
- uint8_t fanout; /* 3 */
- uint8_t depth; /* 4 */
- uint32_t leaf_length; /* 8 */
- uint32_t node_offset; /* 12 */
- uint32_t xof_length; /* 16 */
- uint8_t node_depth; /* 17 */
- uint8_t inner_length; /* 18 */
- uint8_t reserved[14]; /* 32 */
- uint8_t salt[BLAKE2B_SALTBYTES]; /* 48 */
- uint8_t personal[BLAKE2B_PERSONALBYTES]; /* 64 */
- });
-
- typedef struct blake2b_param__ blake2b_param;
-
- typedef struct blake2xs_state__
- {
- blake2s_state S[1];
- blake2s_param P[1];
- } blake2xs_state;
-
- typedef struct blake2xb_state__
- {
- blake2b_state S[1];
- blake2b_param P[1];
- } blake2xb_state;
+enum blake2s_constant {
+ BLAKE2S_BLOCKBYTES = 64,
+ BLAKE2S_OUTBYTES = 32,
+ BLAKE2S_KEYBYTES = 32,
+ BLAKE2S_SALTBYTES = 8,
+ BLAKE2S_PERSONALBYTES = 8
+};
+
+enum blake2b_constant {
+ BLAKE2B_BLOCKBYTES = 128,
+ BLAKE2B_OUTBYTES = 64,
+ BLAKE2B_KEYBYTES = 64,
+ BLAKE2B_SALTBYTES = 16,
+ BLAKE2B_PERSONALBYTES = 16
+};
+
+typedef struct blake2s_state__ {
+ uint32_t h[8];
+ uint32_t t[2];
+ uint32_t f[2];
+ uint8_t buf[BLAKE2S_BLOCKBYTES];
+ size_t buflen;
+ size_t outlen;
+ uint8_t last_node;
+} blake2s_state;
+
+typedef struct blake2b_state__ {
+ uint64_t h[8];
+ uint64_t t[2];
+ uint64_t f[2];
+ uint8_t buf[BLAKE2B_BLOCKBYTES];
+ size_t buflen;
+ size_t outlen;
+ uint8_t last_node;
+} blake2b_state;
+
+typedef struct blake2sp_state__ {
+ blake2s_state S[8][1];
+ blake2s_state R[1];
+ uint8_t buf[8 * BLAKE2S_BLOCKBYTES];
+ size_t buflen;
+ size_t outlen;
+} blake2sp_state;
+
+typedef struct blake2bp_state__ {
+ blake2b_state S[4][1];
+ blake2b_state R[1];
+ uint8_t buf[4 * BLAKE2B_BLOCKBYTES];
+ size_t buflen;
+ size_t outlen;
+} blake2bp_state;
+
+
+BLAKE2_PACKED(struct blake2s_param__ {
+ uint8_t digest_length; /* 1 */
+ uint8_t key_length; /* 2 */
+ uint8_t fanout; /* 3 */
+ uint8_t depth; /* 4 */
+ uint32_t leaf_length; /* 8 */
+ uint32_t node_offset; /* 12 */
+ uint16_t xof_length; /* 14 */
+ uint8_t node_depth; /* 15 */
+ uint8_t inner_length; /* 16 */
+ /* uint8_t reserved[0]; */
+ uint8_t salt[BLAKE2S_SALTBYTES]; /* 24 */
+ uint8_t personal[BLAKE2S_PERSONALBYTES]; /* 32 */
+ });
+
+typedef struct blake2s_param__ blake2s_param;
+
+BLAKE2_PACKED(struct blake2b_param__ {
+ uint8_t digest_length; /* 1 */
+ uint8_t key_length; /* 2 */
+ uint8_t fanout; /* 3 */
+ uint8_t depth; /* 4 */
+ uint32_t leaf_length; /* 8 */
+ uint32_t node_offset; /* 12 */
+ uint32_t xof_length; /* 16 */
+ uint8_t node_depth; /* 17 */
+ uint8_t inner_length; /* 18 */
+ uint8_t reserved[14]; /* 32 */
+ uint8_t salt[BLAKE2B_SALTBYTES]; /* 48 */
+ uint8_t personal[BLAKE2B_PERSONALBYTES]; /* 64 */
+ });
+
+typedef struct blake2b_param__ blake2b_param;
+
+typedef struct blake2xs_state__ {
+ blake2s_state S[1];
+ blake2s_param P[1];
+} blake2xs_state;
+
+typedef struct blake2xb_state__ {
+ blake2b_state S[1];
+ blake2b_param P[1];
+} blake2xb_state;