some style fixes, update tests

This commit is contained in:
Sanjana Rajan
2017-07-24 18:36:18 +02:00
parent fdcfcf3a54
commit 3b8cea67a2
7 changed files with 22 additions and 28 deletions

View File

@@ -228,7 +228,7 @@ export default {
}
},
generateMpi: function(algo, bits, curve, material) {
generateMpi: function(algo, bits, curve) {
switch (algo) {
case 'rsa_encrypt':
case 'rsa_encrypt_sign':
@@ -247,21 +247,21 @@ export default {
});
case 'ecdsa':
return publicKey.elliptic.generate(curve, material).then(function (key) {
return publicKey.elliptic.generate(curve).then(function (keyObject) {
return [
new type_oid(key.oid),
BigInteger2mpi(key.R),
BigInteger2mpi(key.r)
new type_oid(keyObject.oid),
BigInteger2mpi(keyObject.R),
BigInteger2mpi(keyObject.r)
];
});
case 'ecdh':
return publicKey.elliptic.generate(curve, material).then(function (key) {
return publicKey.elliptic.generate(curve).then(function (keyObject) {
return [
new type_oid(key.oid),
BigInteger2mpi(key.R),
new type_kdf_params(key.hash, key.cipher),
BigInteger2mpi(key.r)
new type_oid(keyObject.oid),
BigInteger2mpi(keyObject.R),
new type_kdf_params(keyObject.hash, keyObject.cipher),
BigInteger2mpi(keyObject.r)
];
});

View File

@@ -15,7 +15,7 @@ import random from './random';
import pkcs1 from './pkcs1';
import pkcs5 from './pkcs5.js';
import crypto from './crypto.js';
import rfc3394 from './rfc3394.js';
import aes_kw from './aes_kw.js';
const mod = {
/** @see module:crypto/cipher */
@@ -36,8 +36,8 @@ const mod = {
pkcs1: pkcs1,
/** @see module:crypto/pkcs5 */
pkcs5: pkcs5,
/** @see module:crypto/rfc3394 */
rfc3394: rfc3394,
/** @see module:crypto/aes_kw */
aes_kw: aes_kw,
};
for (var i in crypto) {