summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-11-14 04:09:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-14 07:54:52 (GMT)
commita2ce0a752600a44979da94b19aa1b367c6850bd7 (patch)
tree8053b48486e56cd2719508fa4f996e22997d989f /cache.h
parent50c817e0c02a133a1615ba32971fd5f6649c894f (diff)
downloadgit-a2ce0a752600a44979da94b19aa1b367c6850bd7.zip
git-a2ce0a752600a44979da94b19aa1b367c6850bd7.tar.gz
git-a2ce0a752600a44979da94b19aa1b367c6850bd7.tar.bz2
sha1-file: add a constant for hash block size
There is one place we need the hash algorithm block size: the HMAC code for push certs. Expose this constant in struct git_hash_algo and expose values for SHA-1 and for the largest value of any hash. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 85a8e7b..5d96972 100644
--- a/cache.h
+++ b/cache.h
@@ -45,10 +45,14 @@ unsigned long git_deflate_bound(git_zstream *, unsigned long);
/* The length in bytes and in hex digits of an object name (SHA-1 value). */
#define GIT_SHA1_RAWSZ 20
#define GIT_SHA1_HEXSZ (2 * GIT_SHA1_RAWSZ)
+/* The block size of SHA-1. */
+#define GIT_SHA1_BLKSZ 64
/* The length in byte and in hex digits of the largest possible hash value. */
#define GIT_MAX_RAWSZ GIT_SHA1_RAWSZ
#define GIT_MAX_HEXSZ GIT_SHA1_HEXSZ
+/* The largest possible block size for any supported hash. */
+#define GIT_MAX_BLKSZ GIT_SHA1_BLKSZ
struct object_id {
unsigned char hash[GIT_MAX_RAWSZ];