This commit is contained in:
Dobromir Popov
2025-09-07 15:03:47 +03:00
parent 00cda24e71
commit 2d2653551b
132 changed files with 34281 additions and 5 deletions

25
zano/libethash/primes.h Normal file
View File

@@ -0,0 +1,25 @@
/* ethash: C/C++ implementation of Ethash, the Ethereum Proof of Work algorithm.
* Copyright 2018 Pawel Bylica.
* Licensed under the Apache License, Version 2.0. See the LICENSE file.
*/
#pragma once
#include <ethash/ethash.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Finds the largest prime number not greater than the provided upper bound.
*
* @param upper_bound The upper bound. SHOULD be greater than 1.
* @return The largest prime number `p` such `p <= upper_bound`.
* In case `upper_bound <= 1`, returns 0.
*/
int ethash_find_largest_prime(int upper_bound) NOEXCEPT;
#ifdef __cplusplus
}
#endif