new BN, fix doc

This commit is contained in:
wussler 2019-01-22 16:50:06 +01:00 committed by GitHub
parent 2975e49dd0
commit 6b19af0a63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,7 +96,7 @@ async function genPublicEphemeralKey(oid, cipher_algo, hash_algo, Q, fingerprint
async function encrypt(oid, cipher_algo, hash_algo, m, Q, fingerprint) { async function encrypt(oid, cipher_algo, hash_algo, m, Q, fingerprint) {
const { V, Z } = await genPublicEphemeralKey(oid, cipher_algo, hash_algo, Q, fingerprint); const { V, Z } = await genPublicEphemeralKey(oid, cipher_algo, hash_algo, Q, fingerprint);
return { return {
V: BN(V), V: new BN(V),
C: aes_kw.wrap(Z, m.toString()) C: aes_kw.wrap(Z, m.toString())
}; };
} }
@ -133,7 +133,7 @@ async function genPrivateEphemeralKey(oid, cipher_algo, hash_algo, V, d, fingerp
* @param {Uint8Array} C Encrypted and wrapped value derived from session key * @param {Uint8Array} C Encrypted and wrapped value derived from session key
* @param {Uint8Array} d Recipient private key * @param {Uint8Array} d Recipient private key
* @param {String} fingerprint Recipient fingerprint * @param {String} fingerprint Recipient fingerprint
* @returns {Promise<Uint8Array>} Value derived from session * @returns {Promise<BN>} Value derived from session
* @async * @async
*/ */
async function decrypt(oid, cipher_algo, hash_algo, V, C, d, fingerprint) { async function decrypt(oid, cipher_algo, hash_algo, V, C, d, fingerprint) {