File tree 3 files changed +17
-8
lines changed
3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,10 @@ const struct ethash_epoch_context* ethash_get_global_epoch_context(int epoch_num
113
113
const struct ethash_epoch_context_full * ethash_get_global_epoch_context_full (
114
114
int epoch_number ) NOEXCEPT ;
115
115
116
+
117
+ struct ethash_result ethash_hash (const struct ethash_epoch_context * context ,
118
+ const union ethash_hash256 * header_hash , uint64_t nonce ) NOEXCEPT ;
119
+
116
120
#ifdef __cplusplus
117
121
}
118
122
#endif
Original file line number Diff line number Diff line change @@ -120,7 +120,11 @@ inline epoch_context_full_ptr create_epoch_context_full(int epoch_number) noexce
120
120
}
121
121
122
122
123
- result hash (const epoch_context& context, const hash256& header_hash, uint64_t nonce) noexcept ;
123
+ inline result hash (
124
+ const epoch_context& context, const hash256& header_hash, uint64_t nonce) noexcept
125
+ {
126
+ return ethash_hash (&context, &header_hash, nonce);
127
+ }
124
128
125
129
result hash (const epoch_context_full& context, const hash256& header_hash, uint64_t nonce) noexcept ;
126
130
Original file line number Diff line number Diff line change @@ -303,13 +303,6 @@ inline hash256 hash_kernel(
303
303
}
304
304
} // namespace
305
305
306
- result hash (const epoch_context& context, const hash256& header_hash, uint64_t nonce) noexcept
307
- {
308
- const hash512 seed = hash_seed (header_hash, nonce);
309
- const hash256 mix_hash = hash_kernel (context, seed, calculate_dataset_item_1024);
310
- return {hash_final (seed, mix_hash), mix_hash};
311
- }
312
-
313
306
result hash (const epoch_context_full& context, const hash256& header_hash, uint64_t nonce) noexcept
314
307
{
315
308
static const auto lazy_lookup = [](const epoch_context& ctx, uint32_t index ) noexcept
@@ -438,4 +431,12 @@ void ethash_destroy_epoch_context(epoch_context* context) noexcept
438
431
std::free (context);
439
432
}
440
433
434
+ ethash_result ethash_hash (
435
+ const epoch_context* context, const hash256* header_hash, uint64_t nonce) noexcept
436
+ {
437
+ const hash512 seed = hash_seed (*header_hash, nonce);
438
+ const hash256 mix_hash = hash_kernel (*context, seed, calculate_dataset_item_1024);
439
+ return {hash_final (seed, mix_hash), mix_hash};
440
+ }
441
+
441
442
} // extern "C"
You can’t perform that action at this time.
0 commit comments