forked from bcoin-org/bcrypto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsha3-512.js
65 lines (50 loc) · 983 Bytes
/
sha3-512.js
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
/*!
* sha3-512.js - sha3-512 implementation for bcrypto
* Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).
* https://github.com/bcoin-org/bcrypto
*/
'use strict';
const SHA3 = require('./sha3');
/**
* SHA3-512
*/
class SHA3_512 extends SHA3 {
constructor() {
super();
}
init() {
return super.init(512);
}
static hash() {
return new SHA3_512();
}
static hmac() {
return super.hmac(512);
}
static digest(data) {
return super.digest(data, 512);
}
static root(left, right) {
return super.root(left, right, 512);
}
static multi(x, y, z) {
return super.multi(x, y, z, 512);
}
static mac(data, key) {
return super.mac(data, key, 512);
}
}
/*
* Static
*/
SHA3_512.native = SHA3.native;
SHA3_512.id = 'SHA3_512';
SHA3_512.size = 64;
SHA3_512.bits = 512;
SHA3_512.blockSize = 72;
SHA3_512.zero = Buffer.alloc(64, 0x00);
SHA3_512.ctx = new SHA3_512();
/*
* Expose
*/
module.exports = SHA3_512;