-
Notifications
You must be signed in to change notification settings - Fork 752
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PHP 8.4] Add new Sodium functions and constants
Signed-off-by: Maurício Meneghini Fauth <[email protected]>
- Loading branch information
1 parent
e4efbf3
commit e4796fd
Showing
8 changed files
with
598 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
reference/sodium/functions/sodium-crypto-aead-aegis128l-decrypt.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- $Revision$ --> | ||
<refentry xml:id="function.sodium-crypto-aead-aegis128l-decrypt" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<refnamediv> | ||
<refname>sodium_crypto_aead_aegis128l_decrypt</refname> | ||
<refpurpose>Verify then decrypt a message with AEGIS-128L</refpurpose> | ||
</refnamediv> | ||
|
||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis> | ||
<type class="union"><type>string</type><type>false</type></type><methodname>sodium_crypto_aead_aegis128l_decrypt</methodname> | ||
<methodparam><type>string</type><parameter>ciphertext</parameter></methodparam> | ||
<methodparam><type>string</type><parameter>additional_data</parameter></methodparam> | ||
<methodparam><type>string</type><parameter>nonce</parameter></methodparam> | ||
<methodparam><modifier role="attribute">#[\SensitiveParameter]</modifier><type>string</type><parameter>key</parameter></methodparam> | ||
</methodsynopsis> | ||
<para> | ||
Verify then decrypt a message with AEGIS-128L. | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<variablelist> | ||
<varlistentry> | ||
<term><parameter>ciphertext</parameter></term> | ||
<listitem> | ||
<para> | ||
Must be in the format provided by <function>sodium_crypto_aead_aegis128l_encrypt</function>. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term><parameter>additional_data</parameter></term> | ||
<listitem> | ||
<para> | ||
Additional, authenticated data. This is used in the verification of the authentication tag | ||
appended to the ciphertext, but it is not encrypted or stored in the ciphertext. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term><parameter>nonce</parameter></term> | ||
<listitem> | ||
<para> | ||
A number that must be only used once, per message. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term><parameter>key</parameter></term> | ||
<listitem> | ||
<para> | ||
Encryption key (128-bit). | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsect1> | ||
|
||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<para> | ||
Returns the plaintext on success, &return.falseforfailure;. | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<simplelist> | ||
<member><function>sodium_crypto_aead_aegis128l_encrypt</function></member> | ||
<member><function>sodium_crypto_aead_aegis128l_keygen</function></member> | ||
</simplelist> | ||
</refsect1> | ||
</refentry> | ||
<!-- Keep this comment at the end of the file | ||
Local variables: | ||
mode: sgml | ||
sgml-omittag:t | ||
sgml-shorttag:t | ||
sgml-minimize-attributes:nil | ||
sgml-always-quote-attributes:t | ||
sgml-indent-step:1 | ||
sgml-indent-data:t | ||
indent-tabs-mode:nil | ||
sgml-parent-document:nil | ||
sgml-default-dtd-file:"~/.phpdoc/manual.ced" | ||
sgml-exposed-tags:nil | ||
sgml-local-catalogs:nil | ||
sgml-local-ecat-files:nil | ||
End: | ||
vim600: syn=xml fen fdm=syntax fdl=2 si | ||
vim: et tw=78 syn=sgml | ||
vi: ts=1 sw=1 | ||
--> |
96 changes: 96 additions & 0 deletions
96
reference/sodium/functions/sodium-crypto-aead-aegis128l-encrypt.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- $Revision$ --> | ||
<refentry xml:id="function.sodium-crypto-aead-aegis128l-encrypt" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<refnamediv> | ||
<refname>sodium_crypto_aead_aegis128l_encrypt</refname> | ||
<refpurpose>Encrypt then authenticate a message with AEGIS-128L</refpurpose> | ||
</refnamediv> | ||
|
||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis> | ||
<type>string</type><methodname>sodium_crypto_aead_aegis128l_encrypt</methodname> | ||
<methodparam><modifier role="attribute">#[\SensitiveParameter]</modifier><type>string</type><parameter>message</parameter></methodparam> | ||
<methodparam><type>string</type><parameter>additional_data</parameter></methodparam> | ||
<methodparam><type>string</type><parameter>nonce</parameter></methodparam> | ||
<methodparam><modifier role="attribute">#[\SensitiveParameter]</modifier><type>string</type><parameter>key</parameter></methodparam> | ||
</methodsynopsis> | ||
<para> | ||
Encrypt then authenticate a message with AEGIS-128L. | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<variablelist> | ||
<varlistentry> | ||
<term><parameter>message</parameter></term> | ||
<listitem> | ||
<para> | ||
The plaintext message to encrypt. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term><parameter>additional_data</parameter></term> | ||
<listitem> | ||
<para> | ||
Additional, authenticated data. This is used in the verification of the authentication tag | ||
appended to the ciphertext, but it is not encrypted or stored in the ciphertext. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term><parameter>nonce</parameter></term> | ||
<listitem> | ||
<para> | ||
A number that must be only used once, per message. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term><parameter>key</parameter></term> | ||
<listitem> | ||
<para> | ||
Encryption key (128-bit). | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsect1> | ||
|
||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<para> | ||
Returns the ciphertext and authentication tag as a string of raw binary bytes. | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<simplelist> | ||
<member><function>sodium_crypto_aead_aegis128l_decrypt</function></member> | ||
<member><function>sodium_crypto_aead_aegis128l_keygen</function></member> | ||
</simplelist> | ||
</refsect1> | ||
</refentry> | ||
<!-- Keep this comment at the end of the file | ||
Local variables: | ||
mode: sgml | ||
sgml-omittag:t | ||
sgml-shorttag:t | ||
sgml-minimize-attributes:nil | ||
sgml-always-quote-attributes:t | ||
sgml-indent-step:1 | ||
sgml-indent-data:t | ||
indent-tabs-mode:nil | ||
sgml-parent-document:nil | ||
sgml-default-dtd-file:"~/.phpdoc/manual.ced" | ||
sgml-exposed-tags:nil | ||
sgml-local-catalogs:nil | ||
sgml-local-ecat-files:nil | ||
End: | ||
vim600: syn=xml fen fdm=syntax fdl=2 si | ||
vim: et tw=78 syn=sgml | ||
vi: ts=1 sw=1 | ||
--> |
60 changes: 60 additions & 0 deletions
60
reference/sodium/functions/sodium-crypto-aead-aegis128l-keygen.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- $Revision$ --> | ||
<refentry xml:id="function.sodium-crypto-aead-aegis128l-keygen" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<refnamediv> | ||
<refname>sodium_crypto_aead_aegis128l_keygen</refname> | ||
<refpurpose>Generate a random AEGIS-128L key</refpurpose> | ||
</refnamediv> | ||
|
||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis> | ||
<type>string</type><methodname>sodium_crypto_aead_aegis128l_keygen</methodname> | ||
<void /> | ||
</methodsynopsis> | ||
<para> | ||
Generate a random key for use with <function>sodium_crypto_aead_aegis128l_encrypt</function> and | ||
<function>sodium_crypto_aead_aegis128l_decrypt</function>. | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
&no.function.parameters; | ||
</refsect1> | ||
|
||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<para> | ||
Returns a 128-bit random key. | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<simplelist> | ||
<member><function>sodium_crypto_aead_aegis128l_decrypt</function></member> | ||
<member><function>sodium_crypto_aead_aegis128l_encrypt</function></member> | ||
</simplelist> | ||
</refsect1> | ||
</refentry> | ||
<!-- Keep this comment at the end of the file | ||
Local variables: | ||
mode: sgml | ||
sgml-omittag:t | ||
sgml-shorttag:t | ||
sgml-minimize-attributes:nil | ||
sgml-always-quote-attributes:t | ||
sgml-indent-step:1 | ||
sgml-indent-data:t | ||
indent-tabs-mode:nil | ||
sgml-parent-document:nil | ||
sgml-default-dtd-file:"~/.phpdoc/manual.ced" | ||
sgml-exposed-tags:nil | ||
sgml-local-catalogs:nil | ||
sgml-local-ecat-files:nil | ||
End: | ||
vim600: syn=xml fen fdm=syntax fdl=2 si | ||
vim: et tw=78 syn=sgml | ||
vi: ts=1 sw=1 | ||
--> |
Oops, something went wrong.