CryptexTest
extends TestCase
in package
FinalYes
Table of Contents
Properties
- $ciphertext : string
- $key : string
- $plaintext : string
- $salt : string
Methods
- invalidCiphertextProvider() : array<string|int, mixed>
- invalidKeyProvider() : array<string|int, mixed>
- invalidPlaintextProvider() : array<string|int, mixed>
- invalidSaltLengthProvider() : array<string|int, mixed>
- invalidSaltTypeProvider() : array<string|int, mixed>
- testDecryptRejectsInvalidCiphertextTypes() : void
- testDecryptRejectsInvalidKeyTypes() : void
- testDecryptRejectsInvalidSaltLength() : void
- testDecryptRejectsInvalidSaltTypes() : void
- testDecryptRejectsMalformedHexCiphertext() : void
- testDecryptRejectsNonceOnlyPayload() : void
- testDecryptRejectsNoncePlusTooShortTagPayload() : void
- testDecryptRejectsTamperedCiphertext() : void
- testDecryptRejectsTooShortPayload() : void
- testDecryptRejectsWrongKey() : void
- testDecryptRejectsWrongSalt() : void
- testEncryptDecryptBinaryPlaintext() : void
- testEncryptDecryptEmptyPlaintext() : void
- testEncryptDecryptLargePlaintext() : void
- testEncryptDecryptNonAsciiPlaintext() : void
- testEncryptDecryptRoundTrip() : void
- testEncryptRejectsInvalidKeyTypes() : void
- testEncryptRejectsInvalidPlaintextTypes() : void
- testEncryptRejectsInvalidSaltLength() : void
- testEncryptRejectsInvalidSaltTypes() : void
- testGenerateSaltReturnsExpectedLength() : void
- testRepeatedEncryptionProducesDifferentCiphertext() : void
- setUp() : void
- flipLastHexNibble() : string
Properties
$ciphertext
private
string
$ciphertext
$key
private
string
$key
$plaintext
private
string
$plaintext
$salt
private
string
$salt
Methods
invalidCiphertextProvider()
public
static invalidCiphertextProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>invalidKeyProvider()
public
static invalidKeyProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>invalidPlaintextProvider()
public
static invalidPlaintextProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>invalidSaltLengthProvider()
public
static invalidSaltLengthProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>invalidSaltTypeProvider()
public
static invalidSaltTypeProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>testDecryptRejectsInvalidCiphertextTypes()
public
testDecryptRejectsInvalidCiphertextTypes(mixed $ciphertext) : void
Parameters
- $ciphertext : mixed
Attributes
- #[DataProvider]
- 'invalidCiphertextProvider'
testDecryptRejectsInvalidKeyTypes()
public
testDecryptRejectsInvalidKeyTypes(mixed $key) : void
Parameters
- $key : mixed
Attributes
- #[DataProvider]
- 'invalidKeyProvider'
testDecryptRejectsInvalidSaltLength()
public
testDecryptRejectsInvalidSaltLength(string $salt) : void
Parameters
- $salt : string
Attributes
- #[DataProvider]
- 'invalidSaltLengthProvider'
testDecryptRejectsInvalidSaltTypes()
public
testDecryptRejectsInvalidSaltTypes(mixed $salt) : void
Parameters
- $salt : mixed
Attributes
- #[DataProvider]
- 'invalidSaltTypeProvider'
testDecryptRejectsMalformedHexCiphertext()
public
testDecryptRejectsMalformedHexCiphertext() : void
testDecryptRejectsNonceOnlyPayload()
public
testDecryptRejectsNonceOnlyPayload() : void
testDecryptRejectsNoncePlusTooShortTagPayload()
public
testDecryptRejectsNoncePlusTooShortTagPayload() : void
testDecryptRejectsTamperedCiphertext()
public
testDecryptRejectsTamperedCiphertext() : void
testDecryptRejectsTooShortPayload()
public
testDecryptRejectsTooShortPayload() : void
testDecryptRejectsWrongKey()
public
testDecryptRejectsWrongKey() : void
testDecryptRejectsWrongSalt()
public
testDecryptRejectsWrongSalt() : void
testEncryptDecryptBinaryPlaintext()
public
testEncryptDecryptBinaryPlaintext() : void
testEncryptDecryptEmptyPlaintext()
public
testEncryptDecryptEmptyPlaintext() : void
testEncryptDecryptLargePlaintext()
public
testEncryptDecryptLargePlaintext() : void
testEncryptDecryptNonAsciiPlaintext()
public
testEncryptDecryptNonAsciiPlaintext() : void
testEncryptDecryptRoundTrip()
public
testEncryptDecryptRoundTrip() : void
testEncryptRejectsInvalidKeyTypes()
public
testEncryptRejectsInvalidKeyTypes(mixed $key) : void
Parameters
- $key : mixed
Attributes
- #[DataProvider]
- 'invalidKeyProvider'
testEncryptRejectsInvalidPlaintextTypes()
public
testEncryptRejectsInvalidPlaintextTypes(mixed $plaintext) : void
Parameters
- $plaintext : mixed
Attributes
- #[DataProvider]
- 'invalidPlaintextProvider'
testEncryptRejectsInvalidSaltLength()
public
testEncryptRejectsInvalidSaltLength(string $salt) : void
Parameters
- $salt : string
Attributes
- #[DataProvider]
- 'invalidSaltLengthProvider'
testEncryptRejectsInvalidSaltTypes()
public
testEncryptRejectsInvalidSaltTypes(mixed $salt) : void
Parameters
- $salt : mixed
Attributes
- #[DataProvider]
- 'invalidSaltTypeProvider'
testGenerateSaltReturnsExpectedLength()
public
testGenerateSaltReturnsExpectedLength() : void
testRepeatedEncryptionProducesDifferentCiphertext()
public
testRepeatedEncryptionProducesDifferentCiphertext() : void
setUp()
protected
setUp() : void
flipLastHexNibble()
private
flipLastHexNibble(string $hex) : string
Parameters
- $hex : string