new Poly1305()
Poly1305 (used for bip151)
Methods
blocks(data, bytes, m)
Process 16 byte blocks.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer | Blocks. |
bytes |
Number | Size. |
m |
Number | Offset pointer. |
- Source:
finish() → {Buffer}
Finalize and return a 16-byte MAC.
- Source:
Returns:
- Type
- Buffer
init(key)
Initialize poly1305 with a key.
Parameters:
Name | Type | Description |
---|---|---|
key |
Buffer |
- Source:
update(data)
Update the MAC with data (will be processed as 16 byte blocks).
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer |
- Source:
(static) auth(msg, key) → {Buffer}
Return a MAC for a message and key.
Parameters:
Name | Type | Description |
---|---|---|
msg |
Buffer | |
key |
Buffer |
- Source:
Returns:
MAC
- Type
- Buffer
(static) verify(mac1, mac2) → {Boolean}
Compare two MACs in constant time.
Parameters:
Name | Type | Description |
---|---|---|
mac1 |
Buffer | |
mac2 |
Buffer |
- Source:
Returns:
- Type
- Boolean