mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2026-03-08 01:51:34 +00:00
some style fixes, update tests
This commit is contained in:
@@ -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)
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user