- var_dump: documentation ( source)
<?php
function getExpectedCiphertextSize(int $sizeOfInput) : int
{
$padding = ($sizeOfInput % 16);
if ($padding === 0) { // PKCS7
$padding += 16;
}
return 16 // IV
+ 32 // HMAC-SHA-256
+ $sizeOfInput
+ $padding;
}
var_dump(getExpectedCiphertextSize(100));