Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
block-sha1: minor fixups
author
Junio C Hamano
<gitster@pobox.com>
Thu, 6 Aug 2009 20:52:58 +0000
(13:52 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 6 Aug 2009 20:56:45 +0000
(13:56 -0700)
Bert Wesarg noticed non-x86 version of SHA_ROT() had a typo.
Also spell in-line assembly as __asm__(), otherwise I seem to get
error: implicit declaration of function 'asm' from my compiler.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
block-sha1/sha1.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
b8e48a8
)
diff --git
a/block-sha1/sha1.c
b/block-sha1/sha1.c
index a45a3dec1e02e4168efc9656fea728cbb355d0fe..698e435a391a2a3cf3e856c98e80e9f7b0f5bc6d 100644
(file)
--- a/
block-sha1/sha1.c
+++ b/
block-sha1/sha1.c
@@
-82,13
+82,13
@@
void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx)
#if defined(__i386__) || defined(__x86_64__)
#if defined(__i386__) || defined(__x86_64__)
-#define SHA_ASM(op, x, n) ({ unsigned int __res;
asm
(op " %1,%0":"=r" (__res):"i" (n), "0" (x)); __res; })
+#define SHA_ASM(op, x, n) ({ unsigned int __res;
__asm__
(op " %1,%0":"=r" (__res):"i" (n), "0" (x)); __res; })
#define SHA_ROL(x,n) SHA_ASM("rol", x, n)
#define SHA_ROR(x,n) SHA_ASM("ror", x, n)
#else
#define SHA_ROL(x,n) SHA_ASM("rol", x, n)
#define SHA_ROR(x,n) SHA_ASM("ror", x, n)
#else
-#define SHA_ROT(X,
n)
(((X) << (l)) | ((X) >> (r)))
+#define SHA_ROT(X,
l,r)
(((X) << (l)) | ((X) >> (r)))
#define SHA_ROL(X,n) SHA_ROT(X,n,32-(n))
#define SHA_ROR(X,n) SHA_ROT(X,32-(n),n)
#define SHA_ROL(X,n) SHA_ROT(X,n,32-(n))
#define SHA_ROR(X,n) SHA_ROT(X,32-(n),n)