22 lines
595 B
C
22 lines
595 B
C
#ifndef DEPLOYD_POW_H_
|
|
#define DEPLOYD_POW_H_
|
|
|
|
#include "conf.h"
|
|
|
|
#include "def.h"
|
|
#include "log.h"
|
|
#include "blake2s.h"
|
|
|
|
#include <openssl/ssl.h>
|
|
|
|
#define DP_POW_LOG "pow"
|
|
#define DP_POW_CHALLENGE_SIZE 16
|
|
|
|
bool dp_pow_protect(SSL *ssl, dp_Logger *logger);
|
|
bool dp_pow_has_leading_zero_bits(
|
|
const uint8_t digest[DP_BLAKE2S_OUTPUT_SIZE_MAX], uint8_t difficulty);
|
|
bool dp_pow_has_xor_ones(const uint8_t digest[DP_BLAKE2S_OUTPUT_SIZE_MAX],
|
|
const uint8_t challenge[DP_POW_CHALLENGE_SIZE],
|
|
uint8_t ones);
|
|
|
|
#endif /* DEPLOYD_POW_H_ */
|