This commit is contained in:
parent
19a2481c13
commit
6d5cbf5a32
@ -271,6 +271,8 @@ export function cryptoAeadDecrypt (ciphertext: number[], associatedData: number[
|
||||
ciphertext.length -= 16
|
||||
|
||||
let state = zeroedBuffer(16)
|
||||
let counter = resetCounter()
|
||||
|
||||
if (ciphertext.length !== 0) {
|
||||
state = [...authenticationTag]
|
||||
const parsedCiphertext = parse(ciphertext, 16)
|
||||
@ -278,8 +280,6 @@ export function cryptoAeadDecrypt (ciphertext: number[], associatedData: number[
|
||||
const finalCiphertextBlockLength = parsedCiphertext[parsedCiphertextLength].length
|
||||
parsedCiphertext[parsedCiphertextLength] = pad(parsedCiphertext[parsedCiphertextLength], 16)
|
||||
|
||||
var counter = resetCounter()
|
||||
|
||||
for (let i = 1; i < parsedCiphertextLength + 1; i++) {
|
||||
state = skinnyEncrypt(state, tweakeyEncode(counter, 4, nonce, key))
|
||||
let mBlock
|
||||
|
Loading…
x
Reference in New Issue
Block a user