From 073b6ac93fc12664ef0908dfc681ea624b3eecb4 Mon Sep 17 00:00:00 2001 From: microshine Date: Fri, 13 Mar 2020 14:19:38 +0300 Subject: [PATCH] Fix Buffer depricated usage --- src/mechs/aes/aes_cmac.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mechs/aes/aes_cmac.ts b/src/mechs/aes/aes_cmac.ts index f32acf2..046b3ca 100644 --- a/src/mechs/aes/aes_cmac.ts +++ b/src/mechs/aes/aes_cmac.ts @@ -42,7 +42,7 @@ function aes(key: Buffer, message: Buffer) { } function getMessageBlock(message: Buffer, blockIndex: number) { - const block = new Buffer(blockSize); + const block = Buffer.alloc(blockSize); const start = blockIndex * blockSize; const end = start + blockSize; @@ -52,7 +52,7 @@ function getMessageBlock(message: Buffer, blockIndex: number) { } function getPaddedMessageBlock(message: Buffer, blockIndex: number) { - const block = new Buffer(blockSize); + const block = Buffer.alloc(blockSize); const start = blockIndex * blockSize; const end = message.length;