Use hash transform function return type for passing burn stack depth
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Sat, 21 Sep 2013 10:54:38 +0000 (13:54 +0300)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Sat, 21 Sep 2013 10:54:38 +0000 (13:54 +0300)
commit592c2ab3deeeccbb6d3b078ed7bf0e6627c8e1fb
tree067ff9ba60af04b9570da3f54c3ff6c992650a90
parent902ea6052c11108bd19333c31b03e084bed1fb86
Use hash transform function return type for passing burn stack depth

* cipher/gostr4311-94.c (transform): Return stack burn depth.
* cipher/hash-common.c (_gcry_md_block_write): Use stack burn depth
returned by 'hd->bwrite'.
* cipher/hash-common.h (_gcry_md_block_write_t): Change return type to
'unsigned int'.
(gry_md_block_ctx_t): Remove 'stack_burn'.
* cipher/md4.c (transform): Return stack burn depth.
(md4_final): Use stack burn depth from transform.
* cipher/md5.c (transform): Return stack burn depth.
(md5_final): Use stack burn depth from transform.
* cipher/rmd160.c (transform): Return stack burn depth.
(rmd160_final): Use stack burn depth from transform.
* cipher/sha1.c (transform): Return stack burn depth.
(sha1_final): Use stack burn depth from transform.
* cipher/sha256.c (transform): Return stack burn depth.
(sha256_final): Use stack burn depth from transform.
* cipher/sha512.c (__transform, transform): Return stack burn depth.
(sha512_final): Use stack burn depth from transform.
* cipher/stribog.c (transform64): Return stack burn depth.
* cipher/tiger.c (transform): Return stack burn depth.
(tiger_final): Use stack burn depth from transform.
--

Transform function might want different depth of stack burn depending on
detected CPU features (like in SHA-512 on ARM with NEON). So return
stack burn depth from transform functions as a request or a hint to
calling function.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/gostr3411-94.c
cipher/hash-common.c
cipher/hash-common.h
cipher/md4.c
cipher/md5.c
cipher/rmd160.c
cipher/sha1.c
cipher/sha256.c
cipher/sha512.c
cipher/stribog.c
cipher/tiger.c