]> git.codecow.com Git - Monocypher.git/commitdiff
sha512 test vector
authorLoup Vaillant <loup@loup-vaillant.fr>
Tue, 7 Feb 2017 17:21:38 +0000 (18:21 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Tue, 7 Feb 2017 17:21:38 +0000 (18:21 +0100)
sha512.c
sha512.h
vectors_sha512

index 1f20919d55f41d7eb909d795ffe67081521a9ff4..05d0e28530922a990d329249f4602728a5036b72 100644 (file)
--- a/sha512.c
+++ b/sha512.c
@@ -116,7 +116,7 @@ void crypto_sha512_update(crypto_sha512_ctx *ctx, const u8 *in, size_t inlen)
     }
 }
 
-void crypto_sha512_finish(crypto_sha512_ctx *ctx, u8 out[64])
+void crypto_sha512_final(crypto_sha512_ctx *ctx, u8 out[64])
 {
     incr(ctx->m_size, ctx->m_index * 8); // size is in bits
     set_input(ctx, 128);                 // padding
@@ -145,5 +145,5 @@ void crypto_sha512(u8 *out, const u8 *m, size_t n)
     crypto_sha512_ctx ctx;
     crypto_sha512_init  (&ctx);
     crypto_sha512_update(&ctx, m, n);
-    crypto_sha512_finish(&ctx, out);
+    crypto_sha512_final (&ctx, out);
 }
index b88de929f04a932e1b6e0537eb96d928fa988deb..6909c65100002f3a86637eca04f995f26ff6b4bb 100644 (file)
--- a/sha512.h
+++ b/sha512.h
@@ -14,7 +14,7 @@ typedef struct {
 void crypto_sha512_init  (crypto_sha512_ctx *ctx);
 void crypto_sha512_update(crypto_sha512_ctx *ctx,
                           const uint8_t     *in, size_t  inlen);
-void crypto_sha512_finish(crypto_sha512_ctx *ctx, uint8_t out[64]);
+void crypto_sha512_final (crypto_sha512_ctx *ctx, uint8_t out[64]);
 
 void crypto_sha512(uint8_t *out,const uint8_t *input, size_t input_size);
 
index bffb06072dc4a5c2a44566474ebf4fbd17172780..bab9ae822be096ca39463b9d3f4b4d3daeb252cd 100644 (file)
@@ -9,3 +9,6 @@ hash:   204a8fc6dda82f0a0ced7beb8e08a41657c16ef468b228a8279be331a703c33596fd15c13b
 
 msg:   61626364656667686263646566676869636465666768696a6465666768696a6b65666768696a6b6c666768696a6b6c6d6768696a6b6c6d6e68696a6b6c6d6e6f696a6b6c6d6e6f706a6b6c6d6e6f70716b6c6d6e6f7071726c6d6e6f707172736d6e6f70717273746e6f707172737475
 hash:  8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909
+
+msg:   6162636465666768414243444546474861626364656667684142434445464748616263646566676841424344454647486162636465666768414243444546474861626364656667684142434445464748616263646566676841424344454647486162636465666768414243444546474861626364656667684142434445464748
+hash:  0d10792e998fcb5ba10fa1e8d416263b4afb8b830d617b240a4b6f547847dbfe232b0e2d1c0cfb242a0a7da528bdeaaafe00ca516407130dac81fbc4c24c5893