kohana/core — pull request #560 by enov (2014-10-07 07:21:20+00:00)
Title: Unit test for the Encrypt class

The test data are provided by:
Cryptographic Algorithm Validation Program
National Institute of Standards and Technology

http://csrc.nist.gov/groups/STM/cavp/index.html

Used AES Multiblock Message Test (MMT) Sample Vectors
from http://csrc.nist.gov/groups/STM/cavp/documents/aes/aesmmt.zip
(the actual file used in that zipped file is CBCMMT128.rsp)

Also adds a class Kohana_EncryptTest_TestableEncrypt that wraps the
Encrypt class to mock out the actual mcrypt_create_iv calls.

However, it also changes Kohana_Encrypt internal API by adding
a protected function _create_iv to proxy mcrypt_create_iv
and to allow mocking and testing against KAT vectors.

Ready for merge. Kindly review thoroughly.

Thanks!