Skip to content

Commit

Permalink
Document returning null from functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dchest committed Dec 21, 2016
1 parent 5398dd6 commit ee0d9d8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,25 @@ or just download `ed2curve.js` or `ed2curve.min.js` and include it after
Usage
-----

### ed2curve.convertKeyPair(keyPair)
### ed2curve.convertKeyPair(keyPair) -> convertedKeyPair | null

Converts the given key pair as generated by
[TweetNaCl.js](https://github.com/dchest/tweetnacl-js)'s `nacl.sign.keyPair`
into a key pair suitable for operations which accept key pairs generated by
`nacl.box.keyPair`. This function is a combination of `convertPublicKey`
and `convertSecretKey`.

### ed2curve.convertPublicKey(edPublicKey)
Returns `null` if the public key in the key pair is not a valid
Ed25519 key.

### ed2curve.convertPublicKey(edPublicKey) -> curvePublicKey | null

Converts a 32-byte Ed25519 public key into a 32-byte Curve25519 public key
and returns it.

### ed2curve.convertSecretKey(edSecretKey)
Returns `null` if the public key in not a valid Ed25519 key.

### ed2curve.convertSecretKey(edSecretKey) -> curveSecretKey

Converts a 64-byte Ed25519 secret key (or just the first 32-byte part of it,
which is the secret value) into a 32-byte Curve25519 secret key and returns it.
Expand Down

0 comments on commit ee0d9d8

Please sign in to comment.