diff --git a/lib/crypto.js b/lib/crypto.js index e7ee903..95daf2f 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -146,15 +146,14 @@ var encrypted = exports.encrypted = { * Encrypt message for given recepient's public key. * @param {Buffer} publicKeyTo - Recipient's public key (65 bytes) * @param {Buffer} msg - The message being encrypted - * @param {?{?iv: Buffer, ?ephemPrivateKey: Buffer}} opts - You may also - * specify initialization vector (16 bytes) and ephemeral private key - * (32 bytes) to get deterministic results. - * @return {Promise.} - A promise that resolves with the buffer - * in `encrypted` format successful encryption and rejects on failure. + * @param {Object=} opts - You may also specify initialization vector + * and ephemeral private key to get deterministic results + * @param {Buffer} opts.iv - Initialization vector (16 bytes) + * @param {Buffer} opts.ephemPrivateKey - Ephemeral private key (32 + * bytes) + * @return {Promise.} A promise that resolves with the buffer in + * `encrypted` format successful encryption and rejects on failure. */ -// TODO(Kagami): Properly document `opts`. Documenting multiple -// function arguments with options object at the end for now gives -// strange results (probably a bug in jsdoc). exports.encrypt = function(publicKeyTo, msg, opts) { return eccrypto.encrypt(publicKeyTo, msg, opts).then(function(encObj) { return encrypted.encode(encObj); @@ -166,8 +165,8 @@ exports.encrypt = function(publicKeyTo, msg, opts) { * @param {Buffer} privateKey - A 32-byte private key of recepient of * the mesage * @param {Buffer} buf - Encrypted data - * @return {Promise.} - A promise that resolves with the - * plaintext on successful decryption and rejects on failure. + * @return {Promise.} A promise that resolves with the plaintext + * on successful decryption and rejects on failure. */ exports.decrypt = function(privateKey, buf) { return new PPromise(function(resolve) { diff --git a/package.json b/package.json index 9f6ac7a..cd7ed23 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "homepage": "https://github.com/bitchan/bitmessage", "devDependencies": { "chai": "*", - "jsdoc": "^3.3.0-beta1", + "jsdoc": "jsdoc3/jsdoc", "jshint": "*", "karma": "^0.12.31", "karma-browserify": "^2.0.0",