[Cryptech-Commits] [user/sra/libhal] 15/15: Cleanup: names of *_core_present() functions, Makefile.
git at cryptech.is
git at cryptech.is
Mon May 25 21:04:30 UTC 2015
This is an automated email from the git hooks/post-receive script.
sra at hactrn.net pushed a commit to branch master
in repository user/sra/libhal.
commit 9e00faa503b1ac5ee4d01db84accdaf27f08f436
Author: Rob Austein <sra at hactrn.net>
Date: Mon May 25 16:36:12 2015 -0400
Cleanup: names of *_core_present() functions, Makefile.
---
Makefile.in | 1 +
cryptech.h | 6 +++---
hash.c | 6 +++---
tests/test-hash.c | 6 +++---
4 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index bc60029..ee9daae 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -18,6 +18,7 @@ includedir = @includedir@
libdir = @libdir@
all: ${LIB}
+ cd tests; ${MAKE} $@
${OBJ}: ${INC}
diff --git a/cryptech.h b/cryptech.h
index 3ceab95..9ac73e8 100644
--- a/cryptech.h
+++ b/cryptech.h
@@ -479,9 +479,9 @@ extern hal_error_t hal_io_wait_valid(off_t offset);
extern hal_error_t hal_get_random(void *buffer, const size_t length);
extern void hal_hash_set_debug(int onoff);
-extern hal_error_t hash_sha1_core_present(void);
-extern hal_error_t hash_sha256_core_present(void);
-extern hal_error_t hash_sha512_core_present(void);
+extern hal_error_t hal_hash_sha1_core_present(void);
+extern hal_error_t hal_hash_sha256_core_present(void);
+extern hal_error_t hal_hash_sha512_core_present(void);
extern size_t hal_hash_state_size(void);
extern void hal_hash_state_initialize(void *state);
extern hal_error_t hal_hash_sha1(void *state, const uint8_t * data_buffer, const size_t data_buffer_length,
diff --git a/hash.c b/hash.c
index ae49c06..bd0daa8 100644
--- a/hash.c
+++ b/hash.c
@@ -92,17 +92,17 @@ void hal_hash_state_initialize(void *_state)
* Report whether cores are present.
*/
-hal_error_t hash_sha1_core_present(void)
+hal_error_t hal_hash_sha1_core_present(void)
{
return hal_io_expected(SHA1_ADDR_NAME0, (const uint8_t *) (SHA1_NAME0 SHA1_NAME1), 8);
}
-hal_error_t hash_sha256_core_present(void)
+hal_error_t hal_hash_sha256_core_present(void)
{
return hal_io_expected(SHA256_ADDR_NAME0, (const uint8_t *) (SHA256_NAME0 SHA256_NAME1), 8);
}
-hal_error_t hash_sha512_core_present(void)
+hal_error_t hal_hash_sha512_core_present(void)
{
return hal_io_expected(SHA512_ADDR_NAME0, (const uint8_t *) (SHA512_NAME0 SHA512_NAME1), 8);
}
diff --git a/tests/test-hash.c b/tests/test-hash.c
index 8144459..671f200 100644
--- a/tests/test-hash.c
+++ b/tests/test-hash.c
@@ -177,7 +177,7 @@ int main (int argc, char *argv[])
{
int ok = 1;
- if (hash_sha1_core_present() == HAL_OK) {
+ if (hal_hash_sha1_core_present() == HAL_OK) {
ok &= test_hash(hal_hash_sha1, nist_512_single, sha1_single_digest, "SHA-1 single block");
ok &= test_hash(hal_hash_sha1, nist_512_double, sha1_double_digest, "SHA-1 double block");
}
@@ -185,7 +185,7 @@ int main (int argc, char *argv[])
printf("SHA-1 core not present, skipping tests which depend on it\n");
}
- if (hash_sha256_core_present() == HAL_OK) {
+ if (hal_hash_sha256_core_present() == HAL_OK) {
ok &= test_hash(hal_hash_sha256, nist_512_single, sha256_single_digest, "SHA-256 single block");
ok &= test_hash(hal_hash_sha256, nist_512_double, sha256_double_digest, "SHA-256 double block");
}
@@ -193,7 +193,7 @@ int main (int argc, char *argv[])
printf("SHA-256 core not present, skipping tests which depend on it\n");
}
- if (hash_sha512_core_present() == HAL_OK) {
+ if (hal_hash_sha512_core_present() == HAL_OK) {
ok &= test_hash(hal_hash_sha512_224, nist_1024_single, sha512_224_single_digest, "SHA-512/224 single block");
ok &= test_hash(hal_hash_sha512_224, nist_1024_double, sha512_224_double_digest, "SHA-512/224 double block");
More information about the Commits
mailing list