From: Heiko Schocher <hs@nabladev.com>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Heiko Schocher <hs@nabladev.com>, Tom Rini <trini@konsulko.com>
Subject: [PATCH v3 1/6] lib: Import rol32 function from Linux
Date: Tue, 18 Nov 2025 05:30:37 +0100 [thread overview]
Message-ID: <20251118043042.27726-2-hs@nabladev.com> (raw)
In-Reply-To: <20251118043042.27726-1-hs@nabladev.com>
sm3 crypto algorithm uses rol32 function from linux, so
import it. Linux base was:
commit ca91b9500108:("Merge tag 'v6.15-rc4-ksmbd-server-fixes' of git://git.samba.org/ksmbd")
Signed-off-by: Heiko Schocher <hs@nabladev.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
---
Changes in v3:
Added Reviewed-by from Ilias
rebased series to
commit: 69cc92d6869 ("Merge tag 'efi-2026-01-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi")
Changes in v2:
rebase to
6b27b688694: ("Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh")
add Ilias to Series-cc
include/linux/bitops.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index f826d7f3b34..29e0da48de8 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -148,6 +148,17 @@ static inline unsigned long hweight_long(unsigned long w)
return sizeof(w) == 4 ? generic_hweight32(w) : generic_hweight64(w);
}
+/**
+ * rol32 - rotate a 32-bit value left
+ * @word: value to rotate
+ * @shift: bits to roll
+ */
+
+static inline __u32 rol32(__u32 word, unsigned int shift)
+{
+ return (word << (shift & 31)) | (word >> ((-shift) & 31));
+}
+
#include <asm/bitops.h>
/* linux/include/asm-generic/bitops/non-atomic.h */
--
2.20.1
next prev parent reply other threads:[~2025-11-18 4:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-18 4:30 [PATCH v3 0/6] Add support for SM3 secure hash Heiko Schocher
2025-11-18 4:30 ` Heiko Schocher [this message]
2025-11-18 4:30 ` [PATCH v3 2/6] lib: import sm3 256 hash parts from linux Heiko Schocher
2025-11-19 11:02 ` Ilias Apalodimas
2025-11-18 4:30 ` [PATCH v3 3/6] lib: sm3: implement U-Boot parts Heiko Schocher
2025-11-18 10:30 ` Quentin Schulz
2025-11-19 7:13 ` Heiko Schocher
2025-11-18 4:30 ` [PATCH v3 4/6] test: cmd: hash: add unit test for sm3_256 Heiko Schocher
2025-11-18 4:30 ` [PATCH v3 5/6] tpm2: add sm3 256 hash support Heiko Schocher
2025-11-18 4:30 ` [PATCH v3 6/6] test: cmd: fix a typo in md5 test Heiko Schocher
2025-11-18 10:06 ` [PATCH v3 0/6] Add support for SM3 secure hash Ilias Apalodimas
2025-11-18 15:11 ` Raymond Mao
2025-11-19 5:40 ` Heiko Schocher
2025-11-19 7:18 ` Ilias Apalodimas
2025-12-04 19:31 ` Tom Rini
2025-12-05 5:03 ` Heiko Schocher
2025-12-05 7:24 ` Ilias Apalodimas
2025-12-05 8:02 ` Heiko Schocher
2025-12-05 14:11 ` Tom Rini
2025-12-08 9:07 ` Ilias Apalodimas
2025-12-08 9:26 ` Heiko Schocher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251118043042.27726-2-hs@nabladev.com \
--to=hs@nabladev.com \
--cc=ilias.apalodimas@linaro.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.