lib/noise/functions/cipher/cha_cha_poly.rb in noise-ruby-0.5.3 vs lib/noise/functions/cipher/cha_cha_poly.rb in noise-ruby-0.6.0

- old
+ new

@@ -13,10 +13,10 @@ @cipher = RbNaCl::AEAD::ChaCha20Poly1305IETF.new(String.new(k).force_encoding('ASCII-8BIT')) @cipher.decrypt(nonce_to_bytes(n), ciphertext, ad) end def nonce_to_bytes(n) - "\00" * 4 + format('%16x', n).htb.reverse + "\x00" * 4 + format('%16x', n).htb.reverse end end end end end