Skip to content

Commit 5f79da4

Browse files
committed
cipher: update the documentation for Cipher#auth_tag=
The authentication tag can be set after starting the decryption, if only it is before Cipher#final is called. Fixes: ruby#74
1 parent 6a79a06 commit 5f79da4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

ext/openssl/ossl_cipher.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -631,13 +631,11 @@ ossl_cipher_get_auth_tag(int argc, VALUE *argv, VALUE self)
631631
* call-seq:
632632
* cipher.auth_tag = string -> string
633633
*
634-
* Sets the authentication tag to verify the contents of the
635-
* ciphertext. The tag must be set after calling Cipher#decrypt,
636-
* Cipher#key= and Cipher#iv=, but before assigning the associated
637-
* authenticated data using Cipher#auth_data= and of course, before
638-
* decrypting any of the ciphertext. After all decryption is
639-
* performed, the tag is verified automatically in the call to
640-
* Cipher#final.
634+
* Sets the authentication tag to verify the integrity of the ciphertext.
635+
* This can be called only when the cipher supports AE. The tag must be set
636+
* after calling Cipher#decrypt, Cipher#key= and Cipher#iv=, but before
637+
* calling Cipher#final. After all decryption is performed, the tag is
638+
* verified automatically in the call to Cipher#final.
641639
*
642640
* For OCB mode, the tag length must be supplied with #auth_tag_len=
643641
* beforehand.

0 commit comments

Comments
 (0)