Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160839476
D38372.id116394.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38372.id116394.diff
View Options
diff --git a/sys/crypto/sha2/sha512c.c b/sys/crypto/sha2/sha512c.c
--- a/sys/crypto/sha2/sha512c.c
+++ b/sys/crypto/sha2/sha512c.c
@@ -60,23 +60,26 @@
#else /* BYTE_ORDER != BIG_ENDIAN */
/*
- * Encode a length len/4 vector of (uint64_t) into a length len vector of
- * (unsigned char) in big-endian form. Assumes len is a multiple of 8.
+ * Encode a length (len + 7) / 8 vector of (uint64_t) into a length len
+ * vector of (unsigned char) in big-endian form. Assumes len is a
+ * multiple of 4.
*/
-static void
+static inline void
be64enc_vect(unsigned char *dst, const uint64_t *src, size_t len)
{
size_t i;
for (i = 0; i < len / 8; i++)
be64enc(dst + i * 8, src[i]);
+ if (len % 8 == 4)
+ be32enc(dst + i * 8, src[i] >> 32);
}
/*
* Decode a big-endian length len vector of (unsigned char) into a length
- * len/4 vector of (uint64_t). Assumes len is a multiple of 8.
+ * len/8 vector of (uint64_t). Assumes len is a multiple of 8.
*/
-static void
+static inline void
be64dec_vect(uint64_t *dst, const unsigned char *src, size_t len)
{
size_t i;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jun 29, 11:54 AM (11 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34436510
Default Alt Text
D38372.id116394.diff (1 KB)
Attached To
Mode
D38372: sha512_224: Fix SHA512_224_Final() on little-endian machines.
Attached
Detach File
Event Timeline
Log In to Comment