Fix doc strings

This commit is contained in:
Kagami Hiiragi 2015-01-02 18:21:24 +03:00
parent b9f504f800
commit ae968011a8
1 changed files with 11 additions and 11 deletions

View File

@ -10,18 +10,18 @@ var secp256k1 = require("secp256k1");
/** /**
* Compute the public key for a given private key. * Compute the public key for a given private key.
* @param {Buffer} publicKey A 32-byte private key * @param {Buffer} privateKey - A 32-byte private key
* @return {Buffer} A 65-byte public key * @return {Buffer} A 65-byte public key.
* @function * @function
*/ */
var getPublic = exports.getPublic = secp256k1.createPublicKey; var getPublic = exports.getPublic = secp256k1.createPublicKey;
/** /**
* Create an ECDSA signature. * Create an ECDSA signature.
* @param {Buffer} privateKey A 32-byte private key * @param {Buffer} privateKey - A 32-byte private key
* @param {Buffer} msg The message being signed * @param {Buffer} msg - The message being signed
* @return {Promise.<Buffer,undefined>} A promise that resolves with the * @return {Promise.<Buffer>} A promise that resolves with the
* signature or rejects on bad private key/message. * signature and rejects on bad key or message.
*/ */
// FIXME(Kagami): What to do in case of invalid nonce? // FIXME(Kagami): What to do in case of invalid nonce?
exports.sign = function(privateKey, msg) { exports.sign = function(privateKey, msg) {
@ -42,11 +42,11 @@ exports.sign = function(privateKey, msg) {
/** /**
* Verify an ECDSA signature. * Verify an ECDSA signature.
* @param {Buffer} key Private or public key * @param {Buffer} key - A private or public key
* @param {Buffer} msg The message being verified * @param {Buffer} msg - The message being verified
* @param {Buffer} sig The signature * @param {Buffer} sig - The signature
* @return {Promise} A promise that resolves on correct signature and * @return {Promise.<undefined>} A promise that resolves on correct
* rejects on bad signature/public key. * signature and rejects on bad key or signature.
*/ */
exports.verify = function(key, msg, sig) { exports.verify = function(key, msg, sig) {
var publicKey = key.length === 32 ? getPublic(key) : key; var publicKey = key.length === 32 ? getPublic(key) : key;