php-src/ext/openssl/tests/openssl_cipher_key_length_basic.phpt
Jakub Zelenka 35e2a25d83
Add openssl_cipher_key_length function
This function works in exactly the same way as openssl_cipher_iv_length
but for a key length. This is especially useful to make sure that the
right key length is provided to openssl_encrypt and openssl_decrypt.

In addtion the change also updates implementation of
openssl_cipher_iv_length and adds a test for it.
2022-08-28 12:27:16 +01:00

15 lines
222 B
PHP

--TEST--
openssl_cipher_key_length() basic test
--EXTENSIONS--
openssl
--FILE--
<?php
var_dump(openssl_cipher_key_length('AES-128-CBC'));
var_dump(openssl_cipher_key_length('AES-256-CBC'));
?>
--EXPECT--
int(16)
int(32)