@@ -1742,7 +1742,14 @@ crypto_one_time(Cipher, Key, IV, Data, FlagOrOptions) ->
1742
1742
{}).
1743
1743
1744
1744
% %%----------------------------------------------------------------
1745
- -doc (#{equiv => crypto_one_time_aead / 7 }).
1745
+ -doc """
1746
+ Do a complete encrypt with an AEAD cipher of the full text
1747
+ with the default tag length.
1748
+
1749
+ Equivalent to
1750
+ `crypto_one_time_aead(Cipher, Key, IV, InText, AAD, TagLength, true)`
1751
+ where `TagLength` is the default tag length for the given `Cipher`.
1752
+ """ .
1746
1753
-doc (#{group => <<" Cipher API" >>,
1747
1754
since => <<" OTP 22.0" >>}).
1748
1755
-spec crypto_one_time_aead (Cipher , Key , IV , InText , AAD , EncFlag :: true ) ->
@@ -1772,6 +1779,13 @@ length is wanted, the `crypto_one_time_aead/6` form may be used.
1772
1779
For decryption, set the `EncryptFlag` to `false` and put the tag to be checked
1773
1780
in the argument `TagOrTagLength`.
1774
1781
1782
+ > #### Warning {: .warning }
1783
+ >
1784
+ > The length of the tag at decryption is not checked by the function. It is the
1785
+ > caller's responsibility to ensure that the length of the tag matches the
1786
+ > length of the tag used when the data was encrypted. Otherwise the decryption
1787
+ > may succeed if the given tag only matches the start of the proper tag.
1788
+
1775
1789
Additional Authentication Data (AAD) is plaintext data that will not be
1776
1790
encrypted, but will be covered by authenticity protection. It should be provided
1777
1791
through the `AAD` argument, but can be an empty binary as well (`<<>>`) if not
0 commit comments