Skip to content
This repository was archived by the owner on Mar 5, 2024. It is now read-only.

Commit 4808968

Browse files
author
Constanza Heath
committed
Turn ROTR macro into inline function
Signed-off-by: Constanza Heath <[email protected]>
1 parent d31d845 commit 4808968

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/hmac_prng.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ int32_t tc_hmac_prng_reseed (
138138
seedlen < MIN_SLEN ||
139139
seedlen > MAX_SLEN) {
140140
return TC_FAIL;
141-
}
141+
}
142142

143143
if (additional_input != (const uint8_t *) 0) {
144144
/* Abort if additional_input is provided but has inappropriate length */

lib/sha256.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ static const uint32_t k256[64] = {
150150
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
151151
};
152152

153-
#define ROTR(a,n) (((a) >> n) | ((a) << (32 - n)))
153+
static inline uint32_t ROTR (uint32_t a, uint32_t n) {
154+
return (((a) >> n) | ((a) << (32 - n)));
155+
}
154156

155157
#define Sigma0(a) (ROTR((a),2) ^ ROTR((a),13) ^ ROTR((a),22))
156158
#define Sigma1(a) (ROTR((a),6) ^ ROTR((a),11) ^ ROTR((a),25))

0 commit comments

Comments
 (0)