|
cryptal
latest
Cryptography Abstraction Layer
|
Inheritance diagram for fpoirotte\Cryptal\Implementers\AbstractMac:Static Public Member Functions | |
| static | mac (MacEnum $macAlgorithm, SubAlgorithmAbstractEnum $innerAlgorithm, $key, $data, $nonce= '', $raw=false) |
Additional Inherited Members | |
Public Member Functions inherited from fpoirotte\Cryptal\AbstractContextBasedAlgorithm | |
| __toString () | |
| finalize ($raw=false) | |
| update ($data) | |
Public Member Functions inherited from fpoirotte\Cryptal\Implementers\MacInterface | |
| __construct (MacEnum $macAlgorithm, SubAlgorithmAbstractEnum $innerAlgorithm, $key, $nonce= '') | |
Public Member Functions inherited from fpoirotte\Cryptal\ContextBasedInterface | |
| __toString () | |
| finalize ($raw=false) | |
| update ($data) | |
Protected Member Functions inherited from fpoirotte\Cryptal\AbstractContextBasedAlgorithm | |
| internalFinalize () | |
| internalUpdate ($data) | |
Interface for Message Authentication Codes.
Definition at line 13 of file AbstractMac.php.
|
staticfinal |
All-in-one function to quickly compute the message authentication code for a string of text.
| MacEnum | $macAlgorithm | Algorithm to use to produce the message authentication code. |
| SubAlgorithmAbstractEnum | $innerAlgorithm | Inner algorithm used during generation. This should be either an instance of CipherEnum or MacEnum, depending on the value for the $macAlgorithm parameter. |
| string | $key | Secret key used to produce the Message Authentication Code. |
| string | $data | Data for which a message authentication code will be generated. |
| string | $nonce | (optional) Nonce used to randomize the output. |
| bool | $raw | (optional) Whether the result should be returned in raw form (true) or using its hexadecimal representation (false). Defaults to false. |
| string | Message Authentication Code for the given data. |
Implements fpoirotte\Cryptal\Implementers\MacInterface.
Definition at line 15 of file AbstractMac.php.
Referenced by fpoirotte\Cryptal\DefaultAlgorithms\ChaCha20Openssh\decrypt(), fpoirotte\Cryptal\DefaultAlgorithms\ChaCha20\decrypt(), fpoirotte\Cryptal\DefaultAlgorithms\ChaCha20Openssh\encrypt(), and fpoirotte\Cryptal\DefaultAlgorithms\ChaCha20\encrypt().