Class: ChaCha20

crypto/chachapoly.ChaCha20

new ChaCha20()

ChaCha20 (used for bip151)

Source:
See:

Methods

encrypt(data)

Encrypt/decrypt data.

Parameters:
Name Type Description
data Buffer

Will be mutated.

Source:

getCounter() → {Number}

Get the counter as a uint64.

Source:
Returns:
Type
Number

init(key, iv, counter)

Initialize chacha20 with a key, iv, and counter.

Parameters:
Name Type Description
key Buffer
iv Buffer
counter Number
Source:

initIV(iv, counter)

Set IV and counter.

Parameters:
Name Type Description
iv Buffer
counter Number
Source:

initKey(key)

Set key.

Parameters:
Name Type Description
key Buffer
Source:

setCounter(counter)

Artificially set the counter.

Parameters:
Name Type Description
counter Number
Source: