diff options
author | Christian Heimes <christian@python.org> | 2022-03-26 19:52:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-26 19:52:24 (GMT) |
commit | b16b6bb8dacc41e9e569783890b0c88fcd3b24e8 (patch) | |
tree | 5e3c08a7bd917d3f45ddc4a8e195023e3d482731 /Modules/_blake2/impl/blake2sp-test.c | |
parent | c23ddf5ec229b7302437a1cf32d366df5cc5b837 (diff) | |
download | cpython-b16b6bb8dacc41e9e569783890b0c88fcd3b24e8.zip cpython-b16b6bb8dacc41e9e569783890b0c88fcd3b24e8.tar.gz cpython-b16b6bb8dacc41e9e569783890b0c88fcd3b24e8.tar.bz2 |
bpo-47095: Use libb2 to provide blake2 implementation (GH-32059)
Diffstat (limited to 'Modules/_blake2/impl/blake2sp-test.c')
-rw-r--r-- | Modules/_blake2/impl/blake2sp-test.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/Modules/_blake2/impl/blake2sp-test.c b/Modules/_blake2/impl/blake2sp-test.c deleted file mode 100644 index 621e350..0000000 --- a/Modules/_blake2/impl/blake2sp-test.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - BLAKE2 reference source code package - optimized C implementations - - Written in 2012 by Samuel Neves <sneves@dei.uc.pt> - - To the extent possible under law, the author(s) have dedicated all copyright - and related and neighboring rights to this software to the public domain - worldwide. This software is distributed without any warranty. - - You should have received a copy of the CC0 Public Domain Dedication along with - this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. -*/ -#include <stdio.h> -#include <string.h> -#include "blake2.h" -#include "blake2-kat.h" - -int main( int argc, char **argv ) -{ - uint8_t key[BLAKE2S_KEYBYTES]; - uint8_t buf[KAT_LENGTH]; - - for( size_t i = 0; i < BLAKE2S_KEYBYTES; ++i ) - key[i] = ( uint8_t )i; - - for( size_t i = 0; i < KAT_LENGTH; ++i ) - buf[i] = ( uint8_t )i; - - for( size_t i = 0; i < KAT_LENGTH; ++i ) - { - uint8_t hash[BLAKE2S_OUTBYTES]; - if( blake2sp( hash, buf, key, BLAKE2S_OUTBYTES, i, BLAKE2S_KEYBYTES ) < 0 || - 0 != memcmp( hash, blake2sp_keyed_kat[i], BLAKE2S_OUTBYTES ) ) - { - puts( "error" ); - return -1; - } - } - - puts( "ok" ); - return 0; -} - |