Lines Matching refs:crypto
4 common.skip('missing crypto');
7 const crypto = require('crypto');
9 assert.throws(() => crypto.diffieHellman(), {
15 assert.throws(() => crypto.diffieHellman(null), {
21 assert.throws(() => crypto.diffieHellman([]), {
32 const buf1 = crypto.diffieHellman({
36 const buf2 = crypto.diffieHellman({
46 const alicePrivateKey = crypto.createPrivateKey({
60 const alicePublicKey = crypto.createPublicKey({
75 const bobPrivateKey = crypto.createPrivateKey({
90 const bobPublicKey = crypto.createPublicKey({
105 assert.throws(() => crypto.diffieHellman({ privateKey: alicePrivateKey }), {
111 assert.throws(() => crypto.diffieHellman({ publicKey: alicePublicKey }), {
132 const group = crypto.getDiffieHellman('modp5');
133 const dh = crypto.createDiffieHellman(group.getPrime(), group.getGenerator());
141 test(crypto.generateKeyPairSync('dh', { group: 'modp5' }),
142 crypto.generateKeyPairSync('dh', { group: 'modp5' }));
144 test(crypto.generateKeyPairSync('dh', { group: 'modp5' }),
145 crypto.generateKeyPairSync('dh', { prime: group.getPrime() }));
162 test(crypto.generateKeyPairSync('dh', params1),
163 crypto.generateKeyPairSync('dh', params2));
173 const privateKey = crypto.createPrivateKey({
186 const publicKey = crypto.createPublicKey({
203 const secret = crypto.diffieHellman({ publicKey, privateKey });
216 test(crypto.generateKeyPairSync('ec', { namedCurve: 'secp256k1' }),
217 crypto.generateKeyPairSync('ec', { namedCurve: 'secp256k1' }));
219 const not256k1 = crypto.getCurves().find((c) => /^sec.*(224|384|512)/.test(c));
221 test(crypto.generateKeyPairSync('ec', { namedCurve: 'secp256k1' }),
222 crypto.generateKeyPairSync('ec', { namedCurve: not256k1 }));
233 test(crypto.generateKeyPairSync('x448'),
234 crypto.generateKeyPairSync('x448'));
236 test(crypto.generateKeyPairSync('x25519'),
237 crypto.generateKeyPairSync('x25519'));
240 test(crypto.generateKeyPairSync('x448'),
241 crypto.generateKeyPairSync('x25519'));