Lines Matching refs:cipher

213     // Trying to create cipher with incorrect IV length
281 const cipher = crypto.createCipheriv('aes-256-gcm',
286 cipher.setAAD(Buffer.from('abcd'));
287 cipher.update('01234567', 'hex');
288 cipher.final();
289 const tag = cipher.getAuthTag();
444 const cipher = crypto.createCipheriv('aes-256-ccm',
453 cipher.setAAD(Buffer.from('0123456789', 'hex'), { plaintextLength });
468 const cipher = () => crypto.createCipheriv('aes-256-ccm', key,
475 cipher().setAAD(Buffer.alloc(0), {
482 cipher().update(msg);
485 const c = cipher();
497 const cipher = crypto.createCipheriv('aes-256-ccm',
503 cipher.setAAD(Buffer.from('0123456789', 'hex'));
508 const cipher = crypto.createDecipheriv('aes-256-ccm',
514 cipher.setAAD(Buffer.from('0123456789', 'hex'));
570 const cipher = crypto.createCipheriv(`aes-128-${mode}`, key, iv, {
573 const ciphertext = Buffer.concat([cipher.update(plain), cipher.final()]);
574 const authTag = cipher.getAuthTag();
603 const cipher = crypto.createCipheriv(`aes-128-${mode}`, key, iv, opts);
604 const ciphertext = Buffer.concat([cipher.update(plain), cipher.final()]);
605 const tag = cipher.getAuthTag();
669 // CCM cipher without data should not crash, see https://github.com/nodejs/node/issues/38035.
675 for (const cipher of [
680 cipher.final();
710 const cipher =
712 const ciphertext = Buffer.concat([cipher.update('foo'), cipher.final()]);
713 const authTag = cipher.getAuthTag();
722 // ChaCha20 is a stream cipher so we do not need to call final() to obtain
770 const cipher = crypto.createCipheriv('chacha20-poly1305', key, iv, opt);
772 cipher.setAAD(aad).update(testCase.plain, 'hex'),
773 cipher.final(),
775 const authTag = cipher.getAuthTag();
803 const cipher = crypto.createCipheriv('chacha20-poly1305', key, iv, opt);
805 cipher.setAAD(aad).update(testCase.plain, 'hex'),
806 cipher.final(),
808 const authTag = cipher.getAuthTag();