doc fixes

This commit is contained in:
Sanjana Rajan 2018-01-19 14:38:27 +01:00
parent 3ce6309788
commit a173a63b16
3 changed files with 8 additions and 8 deletions

View File

@ -87,7 +87,7 @@ export default {
* Create a signature on data using the specified algorithm * Create a signature on data using the specified algorithm
* @param {module:enums.hash} hash_algo hash Algorithm to use (See {@link http://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4}) * @param {module:enums.hash} hash_algo hash Algorithm to use (See {@link http://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})
* @param {module:enums.publicKey} algo Asymmetric cipher algorithm to use (See {@link http://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1}) * @param {module:enums.publicKey} algo Asymmetric cipher algorithm to use (See {@link http://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1})
* @param {Array<module:type/mpi>} publicMPIs Public followed by Private key multiprecision algorithm-specific parameters * @param {Array<module:type/mpi>} keyIntegers Public followed by Private key multiprecision algorithm-specific parameters
* @param {Uint8Array} data Data to be signed * @param {Uint8Array} data Data to be signed
* @return {Array<module:type/mpi>} * @return {Array<module:type/mpi>}
*/ */

View File

@ -129,7 +129,7 @@ PublicKeyEncryptedSessionKey.prototype.encrypt = async function (key) {
* packets (tag 1) * packets (tag 1)
* *
* @param {module:packet/secret_key} key * @param {module:packet/secret_key} key
* Private key with secMPIs unlocked * Private key with secret params unlocked
* @return {String} The unencrypted session key * @return {String} The unencrypted session key
*/ */
PublicKeyEncryptedSessionKey.prototype.decrypt = async function (key) { PublicKeyEncryptedSessionKey.prototype.decrypt = async function (key) {

View File

@ -25,7 +25,7 @@
* @requires crypto * @requires crypto
* @requires enums * @requires enums
* @requires packet/public_key * @requires packet/public_key
* @requires type/mpi * @requires type/keyid
* @requires type/s2k * @requires type/s2k
* @requires util * @requires util
* @module packet/secret_key * @module packet/secret_key
@ -95,7 +95,7 @@ function parse_cleartext_params(hash_algorithm, cleartext, algorithm) {
for (var i = 0; i < types.length && p < cleartext.length; i++) { for (var i = 0; i < types.length && p < cleartext.length; i++) {
p += params[i].read(cleartext.subarray(p, cleartext.length)); p += params[i].read(cleartext.subarray(p, cleartext.length));
if (p > cleartext.length) { if (p > cleartext.length) {
throw new Error('Error reading MPI @:' + p); throw new Error('Error reading param @:' + p);
} }
} }
@ -205,13 +205,13 @@ function produceEncryptionKey(s2k, passphrase, algorithm) {
} }
/** /**
* Decrypts the private key MPIs which are needed to use the key. * Decrypts the private key params which are needed to use the key.
* @link module:packet/secret_key.isDecrypted should be * @link module:packet/secret_key.isDecrypted should be
* false otherwise a call to this function is not needed * false otherwise a call to this function is not needed
* *
* @param {String} str_passphrase The passphrase for this private key * @param {String} str_passphrase The passphrase for this private key
* as string * as string
* @return {Boolean} True if the passphrase was correct or MPI already * @return {Boolean} True if the passphrase was correct or param already
* decrypted; false if not * decrypted; false if not
*/ */
SecretKey.prototype.decrypt = function (passphrase) { SecretKey.prototype.decrypt = function (passphrase) {
@ -281,11 +281,11 @@ SecretKey.prototype.generate = function (bits, curve) {
}; };
/** /**
* Clear private MPIs, return to initial state * Clear private params, return to initial state
*/ */
SecretKey.prototype.clearPrivateParams = function () { SecretKey.prototype.clearPrivateParams = function () {
if (!this.encrypted) { if (!this.encrypted) {
throw new Error('If secret key is not encrypted, clearing private MPIs is irreversible.'); throw new Error('If secret key is not encrypted, clearing private params is irreversible.');
} }
this.params = this.params.slice(0, crypto.getPubKeyParamTypes(this.algorithm).length); this.params = this.params.slice(0, crypto.getPubKeyParamTypes(this.algorithm).length);
this.isDecrypted = false; this.isDecrypted = false;