Merge pull request #7 from libp2p/be

big-endian
This commit is contained in:
Friedel Ziegelmayer 2016-09-05 20:30:42 +02:00 committed by GitHub
commit 16d8790472

View File

@ -26,7 +26,7 @@ module.exports = (curveName) => {
const genSharedKey = (theirPub, forcePrivate) => { const genSharedKey = (theirPub, forcePrivate) => {
const pub = ec.keyFromPublic(theirPub, 'hex') const pub = ec.keyFromPublic(theirPub, 'hex')
const p = forcePrivate || priv const p = forcePrivate || priv
return p.derive(pub.getPublic()).toBuffer('le') return p.derive(pub.getPublic()).toBuffer('be')
} }
return { return {