git ssb

1+

Dominic / ssb-keys



Commit 36de09c97bf4ab11665bc129f764c5612bed702e

randombytes mutates arg, ignore return value

Dominic Tarr committed on 9/4/2016, 7:05:53 AM
Parent: d07c56db9283161c98f4bf5fc8dec7649b1ea137

Files changed

sodium.jschanged
sodium.jsView
@@ -5,9 +5,10 @@
55
66 curves: ['ed25519'],
77
88 generate: function (seed) {
9- seed = seed || sodium.randombytes(seed = new Buffer(32))
9+ if(!seed) sodium.randombytes(seed = new Buffer(32))
10+
1011 var keys = seed ? sodium.crypto_sign_seed_keypair(seed) : sodium.crypto_sign_keypair()
1112 return {
1213 curve: 'ed25519',
1314 public: keys.publicKey,
@@ -29,4 +30,6 @@
2930 }
3031
3132
3233
34+
35+

Built with git-ssb-web