1 // ethash: C/C++ implementation of Ethash, the Ethereum Proof of Work algorithm.
2 // Copyright 2018 Pawel Bylica.
3 // Licensed under the Apache License, Version 2.0. See the LICENSE file.
4 
5 #pragma once
6 
7 #include <ethash/keccak.h>
8 #include <ethash/hash_types.hpp>
9 
10 namespace ethash
11 {
keccak256(const uint8_t * data,size_t size)12 inline hash256 keccak256(const uint8_t* data, size_t size) noexcept
13 {
14     return ethash_keccak256(data, size);
15 }
16 
keccak256(const hash256 & input)17 inline hash256 keccak256(const hash256& input) noexcept
18 {
19     return ethash_keccak256_32(input.bytes);
20 }
21 
keccak512(const uint8_t * data,size_t size)22 inline hash512 keccak512(const uint8_t* data, size_t size) noexcept
23 {
24     return ethash_keccak512(data, size);
25 }
26 
keccak512(const hash512 & input)27 inline hash512 keccak512(const hash512& input) noexcept
28 {
29     return ethash_keccak512_64(input.bytes);
30 }
31 
32 static constexpr auto keccak256_32 = ethash_keccak256_32;
33 static constexpr auto keccak512_64 = ethash_keccak512_64;
34 
35 }  // namespace ethash
36