Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
keccak256.hpp
Go to the documentation of this file.
1/* sha3 - an implementation of Secure Hash Algorithm 3 (Keccak).
2 * based on the
3 * The Keccak SHA-3 submission. Submission to NIST (Round 3), 2011
4 * by Guido Bertoni, Joan Daemen, Michaƫl Peeters and Gilles Van Assche
5 *
6 * Copyright: 2013 Aleksey Kravchenko <rhash.admin@gmail.com>
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 * or FITNESS FOR A PARTICULAR PURPOSE. Use this program at your own risk!
18 */
19
20#pragma once
21
22#include <cstdint> // Include for std::uint64_t
23
24#ifndef __KECCAK256_HPP_
25#define __KECCAK256_HPP_
26
27#define sha3_max_permutation_size 25
28#define sha3_max_rate_in_qwords 24
29
30
31typedef struct SHA3_CTX {
32 /* 1600 bits algorithm hashing state */
34 /* 1536-bit buffer for leftovers */
36 /* count of bytes in the message[] buffer */
38 /* size of a message block processed at once */
39 //unsigned block_size;
41
42
43#ifdef __cplusplus
44extern "C" {
45#endif /* __cplusplus */
46
47
48void keccak_init(SHA3_CTX *ctx);
49void keccak_update(SHA3_CTX *ctx, const unsigned char *msg, uint16_t size);
50void keccak_final(SHA3_CTX *ctx, unsigned char* result);
51
52
53#ifdef __cplusplus
54}
55
56#endif /* __cplusplus */
57
58#endif /* __KECCAK256_HPP_ */
void keccak_init(SHA3_CTX *ctx)
Definition keccak256.cpp:75
#define sha3_max_rate_in_qwords
Definition keccak256.hpp:28
void keccak_update(SHA3_CTX *ctx, const unsigned char *msg, uint16_t size)
void keccak_final(SHA3_CTX *ctx, unsigned char *result)
#define sha3_max_permutation_size
Definition keccak256.hpp:27
struct SHA3_CTX SHA3_CTX
unsigned short uint16_t
Definition stdint.h:125
unsigned __int64 uint64_t
Definition stdint.h:136
uint16_t rest
Definition keccak256.hpp:37