Skip to content

Commit

Permalink
Merge pull request #129 from achingbrain/fix/write-handshake-nonce-co…
Browse files Browse the repository at this point in the history
…rrectly

fix: write handshake nonce correctly
  • Loading branch information
wemeetagain committed Jan 14, 2022
2 parents 112e247 + ecd70af commit ef64957
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/handshakes/abstract-handshake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export abstract class AbstractHandshake {
protected nonceToBytes (n: uint64): bytes {
// Even though we're treating the nonce as 8 bytes, RFC7539 specifies 12 bytes for a nonce.
const nonce = new Uint8Array(12)
new DataView(nonce.buffer, nonce.byteOffset, nonce.byteLength).setUint32(n, 4, true)
new DataView(nonce.buffer, nonce.byteOffset, nonce.byteLength).setUint32(4, n, true)

return nonce
}
Expand Down

0 comments on commit ef64957

Please sign in to comment.