Lines Matching refs:encrypt
114 const encrypt = crypto.createCipheriv(test.algo,
120 encrypt.setAAD(Buffer.from(test.aad, 'hex'), aadOptions);
122 let hex = encrypt.update(test.plain, inputEncoding, 'hex');
123 hex += encrypt.final('hex');
125 const auth_tag = encrypt.getAuthTag();
168 const encrypt = crypto.createCipher(test.algo, test.password, options);
170 encrypt.setAAD(Buffer.from(test.aad, 'hex'), aadOptions);
171 let hex = encrypt.update(test.plain, 'ascii', 'hex');
172 hex += encrypt.final('hex');
173 const auth_tag = encrypt.getAuthTag();
204 const encrypt = crypto.createCipheriv(test.algo,
208 encrypt.update('blah', 'ascii');
209 assert.throws(function() { encrypt.getAuthTag(); }, errMessages.state);
226 const encrypt =
230 encrypt.update('blah', 'ascii');
231 encrypt.final();
232 assert.throws(() => encrypt.getAuthTag(), errMessages.state);
233 assert.throws(() => encrypt.setAAD(Buffer.from('123', 'ascii')),
556 const encrypt = crypto.createCipheriv('aes-128-ccm', key, iv, options);
557 encrypt.update('boom'); // Should not throw 'Message exceeds maximum size'.
558 encrypt.final();