diff options
author | Mattias Andrée <maandree@kth.se> | 2024-08-24 10:09:33 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2024-08-24 10:09:52 +0200 |
commit | 871a9a1aaa59a9a857078b7a1fb734d0ef849e9d (patch) | |
tree | 0d177786a5d7747319bc11a86ed5f4d4fc99cf8c | |
parent | Empty signed commit (diff) | |
download | libsha1-871a9a1aaa59a9a857078b7a1fb734d0ef849e9d.tar.gz libsha1-871a9a1aaa59a9a857078b7a1fb734d0ef849e9d.tar.bz2 libsha1-871a9a1aaa59a9a857078b7a1fb734d0ef849e9d.tar.xz |
Bug and warning fix1.1.1
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r-- | digest.c | 2 | ||||
-rw-r--r-- | process.c | 4 |
2 files changed, 4 insertions, 2 deletions
@@ -11,7 +11,7 @@ libsha1_digest(struct libsha1_state *restrict state, const void *message_, size_ if (msglen & ~(size_t)7) { libsha1_update(state, message, msglen & ~(size_t)7); - message += msglen & ~(size_t)7; + message += msglen >> 3; msglen &= (size_t)7; } @@ -275,6 +275,7 @@ have_sha_intrinsics(void) { static volatile int ret = -1; static volatile atomic_flag spinlock = ATOMIC_FLAG_INIT; + int a, b, c, d; if (ret != -1) return ret; @@ -284,7 +285,8 @@ have_sha_intrinsics(void) if (ret != -1) goto out; - int a = 7, b, c = 0, d; + a = 7; + c = 0; __asm__ volatile("cpuid" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "a"(a), "c"(c)); if (!(b & (1 << 29))) { ret = 0; |