diff options
author | Scott MacVicar <scottmac@php.net> | 2008-06-02 12:24:23 +0000 |
---|---|---|
committer | Scott MacVicar <scottmac@php.net> | 2008-06-02 12:24:23 +0000 |
commit | b83fbba9f31f10c58ef2dab9272a429f36c5da81 (patch) | |
tree | 3a71a431ea56034ab7a8412867eeb514450e9e98 /ext/hash/tests | |
parent | d652cec246bd394efd039c6625688bbf4385f32c (diff) | |
download | php-git-b83fbba9f31f10c58ef2dab9272a429f36c5da81.tar.gz |
Add sha224 support.
Diffstat (limited to 'ext/hash/tests')
-rw-r--r-- | ext/hash/tests/sha224.phpt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/hash/tests/sha224.phpt b/ext/hash/tests/sha224.phpt new file mode 100644 index 0000000000..dd3231fe9b --- /dev/null +++ b/ext/hash/tests/sha224.phpt @@ -0,0 +1,22 @@ +--TEST-- +sha256 algorithm +--SKIPIF-- +<?php if(!extension_loaded("hash")) print "skip"; ?> +--FILE-- +<?php +echo hash('sha224', '') . "\n"; +echo hash('sha224', 'a') . "\n"; +echo hash('sha224', '012345678901234567890123456789012345678901234567890123456789') . "\n"; + +/* FIPS-180 Vectors */ +echo hash('sha224', 'abc') . "\n"; +echo hash('sha224', 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq') . "\n"; +echo hash('sha224', str_repeat('a', 1000000)) . "\n"; +--EXPECT-- +d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f +abd37534c7d9a2efb9465de931cd7055ffdb8879563ae98078d6d6d5 +ae5c0d27fe120752911c994718296a3bccc77000aac07b8810714932 +23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7 +75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525 +20794655980c91d8bbb4c1ea97618a4bf03f42581948b2ee4ee7ad67 + |