From nobody Fri Feb 10 00:23:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PCZGJ3pGZz3pgHV; Fri, 10 Feb 2023 00:23:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCZGJ1Q30z3QXS; Fri, 10 Feb 2023 00:23:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675988616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r5OXI3HxwWmMIhao6kFRcpU4SNHrO9hQZbqhYGpbzT0=; b=Xr9H1zKdor9FFj4YIWh+Yk5oEwJKQ7RJUyCsjf5bU694N7tH8URoiSMUkU+SNNRe3qkdoa nVsN1Q9geYy9PMtOcatsm5iBALvlvcXJHFxYvWP34iAX6dyxfntvySXm8Rl786u6XFQf6S lRqMm9C0+g9XMusTN057VjRFdFRLxjr0OyJ6VePppA0NPLx7K+AxcO2LacMkv0rzqwlYKH p7PxKxeA32B3ZdBN/5uaDKxH7/TD1KKO0K33UtS3aieeVqz8TIO5fdG5y4hHzE8z8D61Tb Ikm0RU00cpubpsuFY9UizbDntdSnxA/uaA517GnUuZ+chret6jv9ERdrn1Glcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675988616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r5OXI3HxwWmMIhao6kFRcpU4SNHrO9hQZbqhYGpbzT0=; b=C/EX8hkjc0wwRTRaPnWhHn6SQDF4//Rv/eyN5o7/ZNf9HZdmUvoNyYz+KqAf37ycQ2b3re 9dyMtFambE1bjY4MDAm6q16eW0ibcf8aLe4lHGVl9QMkLPAgr0sWPPEiT0kpJjXu1SfuWb +tQ8e9qMXIZA/GHqbmOYP9/+sjulHq6dAiFCs1Sw47gVQO09y6ic2obRxWrDfbEEGkH5XU A2s28p83wKrubnWJtR8Pjm7TplKLelo/6oaRi735qO362aXhg/u0kEGU+RumadndS1zDCR 9Gchfl3+1nyrmfaX41QqklBUr7jUh4MigubVECiNGPSVVusvHvT5V8bRrCOcwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675988616; a=rsa-sha256; cv=none; b=c6vEvZeXiKlN9lKGLokIp79Zz8F3yygTleuxjuiYUAJcn6gFrnq1sWod4GYsVMkIERR+op PjTktpwHetxyGura4SFZR/RvzneBblV92qwH5l8L9B76M7vRXJ7rlDhXodhLmhNTmGWLkW PsCvf1aom/z6hibMqiGRK4qIuVYm0UU5jOlPQ2rQSiq1MdcGQ0tAE6hKPOIywX6udW6Cqs fuI8tcf00S3jlN652mwmanvTc6ztHijTk1Bf6NVfnZYfmb2E/BuMZ1X7y9NJJ+6v9S/jny 77W8bTop1sY/sBWTBDQMmOr6NWbJt5shdCTMJZIg28wb40iRzw1ldRbaHJnWdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCZGJ0W6BzxQf; Fri, 10 Feb 2023 00:23:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31A0NaoV016654; Fri, 10 Feb 2023 00:23:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31A0Nahd016653; Fri, 10 Feb 2023 00:23:36 GMT (envelope-from git) Date: Fri, 10 Feb 2023 00:23:36 GMT Message-Id: <202302100023.31A0Nahd016653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 316cf82382e0 - stable/12 - sha512_224: Fix SHA512_224_Final() on little-endian machines. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 316cf82382e06b7abf8724e9b7804bf6dc2aa576 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=316cf82382e06b7abf8724e9b7804bf6dc2aa576 commit 316cf82382e06b7abf8724e9b7804bf6dc2aa576 Author: Sebastian Huber AuthorDate: 2023-02-06 16:57:28 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-10 00:20:11 +0000 sha512_224: Fix SHA512_224_Final() on little-endian machines. PR: 266863 MFC after: 1 week Reviewed by: allanjude, cperciva, des Differential Revision: https://reviews.freebsd.org/D38372 (cherry picked from commit 6680cfe8e0eec4427716ab50d73ab8231dd9ab28) --- sys/crypto/sha2/sha512c.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/crypto/sha2/sha512c.c b/sys/crypto/sha2/sha512c.c index e0dd36120a90..d1c8ec488fe5 100644 --- a/sys/crypto/sha2/sha512c.c +++ b/sys/crypto/sha2/sha512c.c @@ -54,23 +54,26 @@ __FBSDID("$FreeBSD$"); #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;