Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
tpruvot
GitHub Repository: tpruvot/cpuminer-multi
Path: blob/linux/crypto/hash.c
1201 views
1
// Copyright (c) 2012-2013 The Cryptonote developers
2
// Distributed under the MIT/X11 software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#include <stddef.h>
6
#include <stdint.h>
7
#include <string.h>
8
9
#include "hash-ops.h"
10
#include "c_keccak.h"
11
12
void hash_permutation(union hash_state *state) {
13
keccakf((uint64_t*)state, 24);
14
}
15
16
void hash_process(union hash_state *state, const uint8_t *buf, int count) {
17
keccak1600(buf, count, (uint8_t*)state);
18
}
19
20
void cn_fast_hash(const void *data, int len, char *hash) {
21
union hash_state state;
22
hash_process(&state, data, len);
23
memcpy(hash, &state, HASH_SIZE);
24
}
25
26