This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto'), | |
hkdf = require('futoin-hkdf'), | |
// TODO: Replace with crypto.diffieHellman once nodejs#26626 lands on v12 LTS | |
{ box } = require('tweetnacl'), | |
boxutil = require('tweetnacl-util'), | |
{ chunk, hexToUint8 } = require('./utils'), | |
CIPHER = 'aes-256-cbc', | |
RATCHET_KEYS_LEN = 64, | |
RATCHET_KEYS_HASH = 'SHA-256', |