Skip to content

Commit ef64957

Browse files
authored
Merge pull request #129 from achingbrain/fix/write-handshake-nonce-correctly
fix: write handshake nonce correctly
2 parents 112e247 + ecd70af commit ef64957

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/handshakes/abstract-handshake.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export abstract class AbstractHandshake {
6060
protected nonceToBytes (n: uint64): bytes {
6161
// Even though we're treating the nonce as 8 bytes, RFC7539 specifies 12 bytes for a nonce.
6262
const nonce = new Uint8Array(12)
63-
new DataView(nonce.buffer, nonce.byteOffset, nonce.byteLength).setUint32(n, 4, true)
63+
new DataView(nonce.buffer, nonce.byteOffset, nonce.byteLength).setUint32(4, n, true)
6464

6565
return nonce
6666
}

0 commit comments

Comments
 (0)