-
Notifications
You must be signed in to change notification settings - Fork 24
/
multihashing.cc
587 lines (467 loc) · 22.1 KB
/
multihashing.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
#include <node.h>
#include <node_buffer.h>
#include <v8.h>
#include <stdint.h>
#include <iostream>
#include "nan.h"
// Main Imports
#include "algorithms/main/allium/allium.h"
#include "algorithms/main/blake/blake.h"
#include "algorithms/main/blake/blake2s.h"
#include "algorithms/main/c11/c11.h"
#include "algorithms/main/equihash/equihash.h"
#include "algorithms/main/fugue/fugue.h"
#include "algorithms/main/ghostrider/ghostrider.h"
#include "algorithms/main/groestl/groestl.h"
#include "algorithms/main/keccak/keccak.h"
#include "algorithms/main/minotaur/minotaur.h"
#include "algorithms/main/nist5/nist5.h"
#include "algorithms/main/quark/quark.h"
#include "algorithms/main/qubit/qubit.h"
#include "algorithms/main/scrypt/scrypt.h"
#include "algorithms/main/sha256d/sha256d.h"
#include "algorithms/main/skein/skein.h"
#include "algorithms/main/verthash/verthash.h"
#include "algorithms/main/x11/x11.h"
#include "algorithms/main/x13/x13.h"
#include "algorithms/main/x15/x15.h"
#include "algorithms/main/x16r/x16r.h"
#include "algorithms/main/x16rt/x16rt.h"
// ProgPow Imports
#include "algorithms/main/firopow/firopow.h"
#include "algorithms/main/firopow/firopow.hpp"
#include "algorithms/main/firopow/firopow_progpow.hpp"
#include "algorithms/main/kawpow/kawpow.h"
#include "algorithms/main/kawpow/kawpow.hpp"
#include "algorithms/main/kawpow/kawpow_progpow.hpp"
// Common Imports
#include "algorithms/main/common/ethash/helpers.hpp"
using namespace node;
using namespace v8;
#define THROW_ERROR_EXCEPTION(x) Nan::ThrowError(x)
const char* ToCString(const Nan::Utf8String& value) {
return *value ? *value : "<string conversion failed>";
}
// Allium Algorithm
NAN_METHOD(allium) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
allium_hash(input, output);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// Blake Algorithm
NAN_METHOD(blake) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
blake_hash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// Blake Algorithm
NAN_METHOD(blake2s) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
blake2s_hash(input, output);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// C11 Algorithm
NAN_METHOD(c11) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
c11_hash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// Equihash Algorithm
NAN_METHOD(equihash) {
// Handle Main Scope
Isolate* isolate = Isolate::GetCurrent();
HandleScope scope(isolate);
// Check Arguments for Errors [1]
if (info.Length() < 5)
return THROW_ERROR_EXCEPTION("You must provide five arguments.");
if (!info[3]->IsInt32() || !info[4]->IsInt32())
return THROW_ERROR_EXCEPTION("The fourth and fifth parameters should be equihash parameters (n, k)");
// Define Passed Parameters
Isolate *argsIsolate = info.GetIsolate();
Local<Context> context = argsIsolate->GetCurrentContext();
Local<Object> header = info[0]->ToObject(context).ToLocalChecked();
Local<Object> solution = info[1]->ToObject(context).ToLocalChecked();
// Check Arguments for Errors [2]
if (!Buffer::HasInstance(header) || !Buffer::HasInstance(solution))
return THROW_ERROR_EXCEPTION("The first two arguments should be buffer objects");
if (!info[2]->IsString())
return THROW_ERROR_EXCEPTION("The third argument should be the personalization string");
// Header Length !== 140
const char *hdr = Buffer::Data(header);
if (Buffer::Length(header) != 140) {
info.GetReturnValue().Set(false);
return;
}
// Process Passed Parameters
const char *soln = Buffer::Data(solution);
vector<unsigned char> vecSolution(soln, soln + Buffer::Length(solution));
Nan::Utf8String str(info[2]);
const char* personalizationString = ToCString(str);
unsigned int N = info[3].As<Uint32>()->Value();
unsigned int K = info[4].As<Uint32>()->Value();
// Hash Input Data and Check if Valid Solution
bool isValid;
crypto_generichash_blake2b_state state;
EhInitialiseState(N, K, state, personalizationString);
crypto_generichash_blake2b_update(&state, (const unsigned char*)hdr, 140);
EhIsValidSolution(N, K, state, vecSolution, isValid);
info.GetReturnValue().Set(isValid);
}
// Firopow Algorithm
NAN_METHOD(firopow) {
// Check Arguments for Errors
if (info.Length() < 5)
return THROW_ERROR_EXCEPTION("You must provide five arguments.");
// Process/Define Passed Parameters [1]
const ethash::hash256* header_hash_ptr = (ethash::hash256*)Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint64_t* nonce64_ptr = (uint64_t*)Buffer::Data(Nan::To<v8::Object>(info[1]).ToLocalChecked());
int block_height = info[2]->IntegerValue(Nan::GetCurrentContext()).FromJust();
const ethash::hash256* mix_hash_ptr = (ethash::hash256*)Buffer::Data(Nan::To<v8::Object>(info[3]).ToLocalChecked());
ethash::hash256* hash_out_ptr = (ethash::hash256*)Buffer::Data(Nan::To<v8::Object>(info[4]).ToLocalChecked());
// Process/Define Passed Parameters [2]
static firopow_main::epoch_context_ptr context{nullptr, nullptr};
const auto epoch_number = firopow_main::get_epoch_number(block_height);
if (!context || context->epoch_number != epoch_number)
context = firopow_main::create_epoch_context(epoch_number);
// Hash Input Data and Check if Valid Solution
bool is_valid = firopow_progpow::verify(*context, block_height, header_hash_ptr, *mix_hash_ptr, *nonce64_ptr, hash_out_ptr);
if (is_valid) info.GetReturnValue().Set(Nan::True());
else info.GetReturnValue().Set(Nan::False());
}
// Fugue Algorithm
NAN_METHOD(fugue) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
fugue_hash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// Ghostrider Algorithm
NAN_METHOD(ghostrider) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
ghostrider_hash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// Groestl Algorithm
NAN_METHOD(groestl) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
groestl_hash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// Kawpow Algorithm
NAN_METHOD(kawpow) {
// Check Arguments for Errors
if (info.Length() < 5)
return THROW_ERROR_EXCEPTION("You must provide five arguments.");
// Process/Define Passed Parameters [1]
const ethash::hash256* header_hash_ptr = (ethash::hash256*)Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint64_t* nonce64_ptr = (uint64_t*)Buffer::Data(Nan::To<v8::Object>(info[1]).ToLocalChecked());
int block_height = info[2]->IntegerValue(Nan::GetCurrentContext()).FromJust();
const ethash::hash256* mix_hash_ptr = (ethash::hash256*)Buffer::Data(Nan::To<v8::Object>(info[3]).ToLocalChecked());
ethash::hash256* hash_out_ptr = (ethash::hash256*)Buffer::Data(Nan::To<v8::Object>(info[4]).ToLocalChecked());
// Process/Define Passed Parameters [2]
static kawpow_main::epoch_context_ptr context{nullptr, nullptr};
const auto epoch_number = kawpow_main::get_epoch_number(block_height);
if (!context || context->epoch_number != epoch_number)
context = kawpow_main::create_epoch_context(epoch_number);
// Hash Input Data and Check if Valid Solution
bool is_valid = kawpow_progpow::verify(*context, block_height, header_hash_ptr, *mix_hash_ptr, *nonce64_ptr, hash_out_ptr);
if (is_valid) info.GetReturnValue().Set(Nan::True());
else info.GetReturnValue().Set(Nan::False());
}
// Keccak Algorithm
NAN_METHOD(keccak) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
keccak_hash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// Minotaur Algorithm
NAN_METHOD(minotaur) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
minotaur_hash(input, output, input_len, false);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// MinotaurX Algorithm
NAN_METHOD(minotaurx) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
minotaur_hash(input, output, input_len, true);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// Nist5 Algorithm
NAN_METHOD(nist5) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
nist5_hash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// Quark Algorithm
NAN_METHOD(quark) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
quark_hash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// Qubit Algorithm
NAN_METHOD(qubit) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
qubit_hash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// Scrypt Algorithm
NAN_METHOD(scrypt) {
// Handle Main Scope
Isolate* isolate = Isolate::GetCurrent();
HandleScope scope(isolate);
// Check Arguments for Errors [1]
if (info.Length() < 3)
return THROW_ERROR_EXCEPTION("You must provide an input buffer, as well as an nValue and rValue.");
if (!info[1]->IsInt32() || !info[2]->IsInt32())
return THROW_ERROR_EXCEPTION("The first and second parameters should be scrypt parameters (n, r)");
// Define Passed Parameters
Isolate *argsIsolate = info.GetIsolate();
Local<Context> context = argsIsolate->GetCurrentContext();
Local<Object> header = info[0]->ToObject(context).ToLocalChecked();
unsigned int N = info[1].As<Uint32>()->Value();
unsigned int R = info[2].As<Uint32>()->Value();
// Check Arguments for Errors [2]
if (!Buffer::HasInstance(header))
return THROW_ERROR_EXCEPTION("Argument should be a buffer object.");
// Process/Define Passed Parameters
char * input = Buffer::Data(header);
uint32_t input_len = Buffer::Length(header);
char output[32];
// Hash Input Data and Return Output
scrypt_N_R_1_256(input, output, N, R, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// Sha256d Algorithm
NAN_METHOD(sha256d) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
sha256d_hash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// Skein Algorithm
NAN_METHOD(skein) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
skein_hash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// Verthash Algorithm
NAN_METHOD(verthash) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
verthash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// X11 Algorithm
NAN_METHOD(x11) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
x11_hash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// X13 Algorithm
NAN_METHOD(x13) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
x13_hash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// X15 Algorithm
NAN_METHOD(x15) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
x15_hash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// X16r Algorithm
NAN_METHOD(x16r) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
x16r_hash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// X16rt Algorithm
NAN_METHOD(x16rt) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
x16rt_hash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
// X16rv2 Algorithm
NAN_METHOD(x16rv2) {
// Check Arguments for Errors
if (info.Length() < 1)
return THROW_ERROR_EXCEPTION("You must provide one argument.");
// Process/Define Passed Parameters
char * input = Buffer::Data(Nan::To<v8::Object>(info[0]).ToLocalChecked());
uint32_t input_len = Buffer::Length(Nan::To<v8::Object>(info[0]).ToLocalChecked());
char output[32];
// Hash Input Data and Return Output
x16rv2_hash(input, output, input_len);
info.GetReturnValue().Set(Nan::CopyBuffer(output, 32).ToLocalChecked());
}
NAN_MODULE_INIT(init) {
Nan::Set(target, Nan::New("allium").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(allium)).ToLocalChecked());
Nan::Set(target, Nan::New("blake").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(blake)).ToLocalChecked());
Nan::Set(target, Nan::New("blake2s").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(blake2s)).ToLocalChecked());
Nan::Set(target, Nan::New("c11").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(c11)).ToLocalChecked());
Nan::Set(target, Nan::New("equihash").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(equihash)).ToLocalChecked());
Nan::Set(target, Nan::New("firopow").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(firopow)).ToLocalChecked());
Nan::Set(target, Nan::New("fugue").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(fugue)).ToLocalChecked());
Nan::Set(target, Nan::New("ghostrider").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(ghostrider)).ToLocalChecked());
Nan::Set(target, Nan::New("groestl").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(groestl)).ToLocalChecked());
Nan::Set(target, Nan::New("kawpow").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(kawpow)).ToLocalChecked());
Nan::Set(target, Nan::New("keccak").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(keccak)).ToLocalChecked());
Nan::Set(target, Nan::New("minotaur").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(minotaur)).ToLocalChecked());
Nan::Set(target, Nan::New("minotaurx").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(minotaurx)).ToLocalChecked());
Nan::Set(target, Nan::New("nist5").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(nist5)).ToLocalChecked());
Nan::Set(target, Nan::New("quark").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(quark)).ToLocalChecked());
Nan::Set(target, Nan::New("qubit").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(qubit)).ToLocalChecked());
Nan::Set(target, Nan::New("scrypt").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(scrypt)).ToLocalChecked());
Nan::Set(target, Nan::New("sha256d").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(sha256d)).ToLocalChecked());
Nan::Set(target, Nan::New("skein").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(skein)).ToLocalChecked());
Nan::Set(target, Nan::New("verthash").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(verthash)).ToLocalChecked());
Nan::Set(target, Nan::New("x11").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(x11)).ToLocalChecked());
Nan::Set(target, Nan::New("x13").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(x13)).ToLocalChecked());
Nan::Set(target, Nan::New("x15").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(x15)).ToLocalChecked());
Nan::Set(target, Nan::New("x16r").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(x16r)).ToLocalChecked());
Nan::Set(target, Nan::New("x16rt").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(x16rt)).ToLocalChecked());
Nan::Set(target, Nan::New("x16rv2").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(x16rv2)).ToLocalChecked());
}
NODE_MODULE(multihashing, init)