From 2197d9fc9fefc1ab634c469aa700c197fa8e1575 Mon Sep 17 00:00:00 2001 From: "Aaron Tulino (Aaronjamt)" Date: Sun, 21 Dec 2025 03:49:45 -0700 Subject: [PATCH] Fix `ROTR` conflict --- common/generator.c | 2 +- include/common.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/generator.c b/common/generator.c index 8a9476251..62512c103 100644 --- a/common/generator.c +++ b/common/generator.c @@ -143,7 +143,7 @@ uint32_t ul_ev1_pwdgenC(const uint8_t *uid) { memcpy(base, uid, 7); for (int i = 0; i < 8; i++) { - pwd = base[i] + ROTR(pwd, 25) + ROTR(pwd, 10) - pwd; + pwd = base[i] + PM3_ROTR(pwd, 25) + PM3_ROTR(pwd, 10) - pwd; } return BSWAP_32(pwd); } diff --git a/include/common.h b/include/common.h index 086354750..05ff0a489 100644 --- a/include/common.h +++ b/include/common.h @@ -94,8 +94,8 @@ extern bool g_tearoff_enabled; //#define RAMFUNC __attribute((long_call, section(".ramfunc"))) #define RAMFUNC __attribute((long_call, section(".ramfunc"))) __attribute__((target("arm"))) -#ifndef ROTR -# define ROTR(x,n) (((uintmax_t)(x) >> (n)) | ((uintmax_t)(x) << ((sizeof(x) * 8) - (n)))) +#ifndef PM3_ROTR +# define PM3_ROTR(x,n) (((uintmax_t)(x) >> (n)) | ((uintmax_t)(x) << ((sizeof(x) * 8) - (n)))) #endif #ifndef PM3_ROTL