Skip to content

Commit 84698f1

Browse files
committed
Initializing padding correctly. Closes #6.
1 parent e656157 commit 84698f1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

nodejs/ece.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ function encryptRecord(key, counter, buffer, pad) {
143143
var nonce = generateNonce(key.nonce, counter);
144144
var gcm = crypto.createCipheriv(AES_GCM, key.key, nonce);
145145
var padding = new Buffer(pad + 1);
146+
padding.fill(0);
146147
padding.writeUIntBE(pad, 0, 1);
147148
var epadding = gcm.update(padding);
148149
var ebuffer = gcm.update(buffer);

0 commit comments

Comments
 (0)