From 428907318bf052b11e6c270ebe984ba8071c21cb Mon Sep 17 00:00:00 2001 From: Didactic Drunk <1479616+didactic-drunk@users.noreply.github.com> Date: Sat, 31 Aug 2019 02:47:34 -0700 Subject: [PATCH] Documentation fix. [skip ci] --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 184d7ea..7f774c2 100644 --- a/README.md +++ b/README.md @@ -137,13 +137,13 @@ box = alice.box bob.public_key # Encrypt a message for Bob using his public key, signing it with Alice's # secret key -nonce, encrypted = box.encrypt data +encrypted, nonce = box.encrypt data # Precompute within a block. The shared secret is wiped when the block exits. bob.box alice.public_key do |box| # Decrypt the message using Bob's secret key, and verify its signature against # Alice's public key - decrypted = Sodium.decrypt(encrypted, nonce, alice.public, bob.secret) + decrypted = box.decrypt encrypted, nonce: nonce String.new(decrypted) # => "Hello World!" end