Skip to content

Commit 6fe53a5

Browse files
committed
It should be static inline
Signed-off-by: Steffen Jaeckel <[email protected]>
1 parent c021605 commit 6fe53a5

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

src/ciphers/cast5.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,23 +492,23 @@ int cast5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_
492492
#endif
493493

494494
#define FI cast5_FI
495-
LTC_INLINE static ulong32 FI(ulong32 R, ulong32 Km, ulong32 Kr)
495+
static LTC_INLINE ulong32 FI(ulong32 R, ulong32 Km, ulong32 Kr)
496496
{
497497
ulong32 I;
498498
I = (Km + R);
499499
I = ROL(I, Kr);
500500
return ((S1[LTC_BYTE(I, 3)] ^ S2[LTC_BYTE(I,2)]) - S3[LTC_BYTE(I,1)]) + S4[LTC_BYTE(I,0)];
501501
}
502502

503-
LTC_INLINE static ulong32 FII(ulong32 R, ulong32 Km, ulong32 Kr)
503+
static LTC_INLINE ulong32 FII(ulong32 R, ulong32 Km, ulong32 Kr)
504504
{
505505
ulong32 I;
506506
I = (Km ^ R);
507507
I = ROL(I, Kr);
508508
return ((S1[LTC_BYTE(I, 3)] - S2[LTC_BYTE(I,2)]) + S3[LTC_BYTE(I,1)]) ^ S4[LTC_BYTE(I,0)];
509509
}
510510

511-
LTC_INLINE static ulong32 FIII(ulong32 R, ulong32 Km, ulong32 Kr)
511+
static LTC_INLINE ulong32 FIII(ulong32 R, ulong32 Km, ulong32 Kr)
512512
{
513513
ulong32 I;
514514
I = (Km - R);

src/ciphers/sm4.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static const sm4_u8_t sm4_sbox_table[16][16] = {
6767
* S-box
6868
* defined in section 2.6 S-box
6969
*/
70-
LTC_INLINE static sm4_u8_t s_sm4_sbox(sm4_u8_t a)
70+
static LTC_INLINE sm4_u8_t s_sm4_sbox(sm4_u8_t a)
7171
{
7272
return sm4_sbox_table[(a >> 4) & 0x0f][a & 0x0f];
7373
}
@@ -80,7 +80,7 @@ LTC_INLINE static sm4_u8_t s_sm4_sbox(sm4_u8_t a)
8080
* But we just convert a 32bit word byte by byte.
8181
* So it's OK if we don't convert the endian order
8282
*/
83-
LTC_INLINE static sm4_u32_t s_sm4_t(sm4_u32_t A)
83+
static LTC_INLINE sm4_u32_t s_sm4_t(sm4_u32_t A)
8484
{
8585
sm4_u8_t a[4];
8686
sm4_u8_t b[4];
@@ -98,15 +98,15 @@ LTC_INLINE static sm4_u32_t s_sm4_t(sm4_u32_t A)
9898
/*
9999
* defined in section 6.2 (2) Linear transformation L
100100
*/
101-
LTC_INLINE static sm4_u32_t s_sm4_L62(sm4_u32_t B)
101+
static LTC_INLINE sm4_u32_t s_sm4_L62(sm4_u32_t B)
102102
{
103103
return B ^ ROLc(B, 2) ^ ROLc(B, 10) ^ ROLc(B, 18) ^ ROLc(B, 24);
104104
}
105105

106106
/*
107107
* defined in section 6.2 Permutation T
108108
*/
109-
LTC_INLINE static sm4_u32_t s_sm4_T62(sm4_u32_t Z)
109+
static LTC_INLINE sm4_u32_t s_sm4_T62(sm4_u32_t Z)
110110
{
111111
return s_sm4_L62(s_sm4_t(Z));
112112
}
@@ -137,23 +137,23 @@ static const sm4_u32_t sm4_CK[32] =
137137
/*
138138
* defined in section 7.3 (1) L'
139139
*/
140-
LTC_INLINE static sm4_u32_t s_sm4_L73(sm4_u32_t B)
140+
static LTC_INLINE sm4_u32_t s_sm4_L73(sm4_u32_t B)
141141
{
142142
return B ^ ROLc(B, 13) ^ ROLc(B, 23);
143143
}
144144

145145
/*
146146
* defined in section 7.3 (1) T'
147147
*/
148-
LTC_INLINE static sm4_u32_t s_sm4_T73(sm4_u32_t Z)
148+
static LTC_INLINE sm4_u32_t s_sm4_T73(sm4_u32_t Z)
149149
{
150150
return s_sm4_L73(s_sm4_t(Z));
151151
}
152152

153153
/*
154154
* defined in section 7.3 Key Expansion
155155
*/
156-
LTC_INLINE static void s_sm4_mk2rk(sm4_u32_t rk[32], sm4_u8_t mk[16])
156+
static LTC_INLINE void s_sm4_mk2rk(sm4_u32_t rk[32], sm4_u8_t mk[16])
157157
{
158158
sm4_u32_t MK[4] = { 0 };
159159
sm4_u32_t K[4+32] = { 0 };
@@ -175,15 +175,15 @@ LTC_INLINE static void s_sm4_mk2rk(sm4_u32_t rk[32], sm4_u8_t mk[16])
175175
/*
176176
* defined in section 6 Round Function F
177177
*/
178-
LTC_INLINE static sm4_u32_t s_sm4_F(sm4_u32_t X[4], sm4_u32_t rk)
178+
static LTC_INLINE sm4_u32_t s_sm4_F(sm4_u32_t X[4], sm4_u32_t rk)
179179
{
180180
return X[0] ^ s_sm4_T62(X[1] ^ X[2] ^ X[3] ^ rk);
181181
}
182182

183183
/*
184184
* defined in section 7.1 (2) The reverse transformation
185185
*/
186-
LTC_INLINE static void s_sm4_R(sm4_u32_t Y[4], sm4_u32_t X[32+4])
186+
static LTC_INLINE void s_sm4_R(sm4_u32_t Y[4], sm4_u32_t X[32+4])
187187
{
188188
Y[0] = X[35];
189189
Y[1] = X[34];
@@ -194,7 +194,7 @@ LTC_INLINE static void s_sm4_R(sm4_u32_t Y[4], sm4_u32_t X[32+4])
194194
/*
195195
* defined in section 7.1 (En)cryption
196196
*/
197-
LTC_INLINE static void s_sm4_crypt(sm4_u32_t Y[4], sm4_u32_t X[4+32], const sm4_u32_t rk[32])
197+
static LTC_INLINE void s_sm4_crypt(sm4_u32_t Y[4], sm4_u32_t X[4+32], const sm4_u32_t rk[32])
198198
{
199199
int i;
200200

@@ -203,7 +203,7 @@ LTC_INLINE static void s_sm4_crypt(sm4_u32_t Y[4], sm4_u32_t X[4+32], const sm4_
203203
s_sm4_R(Y, X);
204204
}
205205

206-
LTC_INLINE static void s_sm4_setkey(struct sm4_key *sm4, const unsigned char *key)
206+
static LTC_INLINE void s_sm4_setkey(struct sm4_key *sm4, const unsigned char *key)
207207
{
208208
int i;
209209

@@ -229,7 +229,7 @@ int sm4_setup(const unsigned char *key, int keylen,
229229
/*
230230
* SM4 encryption.
231231
*/
232-
LTC_INLINE static void s_sm4_do(void *output, const void *input, const sm4_u32_t rk[32])
232+
static LTC_INLINE void s_sm4_do(void *output, const void *input, const sm4_u32_t rk[32])
233233
{
234234
sm4_u32_t Y[4];
235235
sm4_u32_t X[32+4];

src/hashes/tiger.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ static const ulong64 table[4*256] = {
566566
CONST64(0xC83223F1720AEF96) /* 1022 */, CONST64(0xC3A0396F7363A51F) /* 1023 */};
567567

568568
/* one round of the hash function */
569-
LTC_INLINE static void tiger_round(ulong64 *a, ulong64 *b, ulong64 *c, ulong64 x, int mul)
569+
static LTC_INLINE void s_tiger_round(ulong64 *a, ulong64 *b, ulong64 *c, ulong64 x, int mul)
570570
{
571571
ulong64 tmp;
572572
tmp = (*c ^= x);
@@ -582,14 +582,14 @@ LTC_INLINE static void tiger_round(ulong64 *a, ulong64 *b, ulong64 *c, ulong64 x
582582
/* one complete pass */
583583
static void s_pass(ulong64 *a, ulong64 *b, ulong64 *c, const ulong64 *x, int mul)
584584
{
585-
tiger_round(a,b,c,x[0],mul);
586-
tiger_round(b,c,a,x[1],mul);
587-
tiger_round(c,a,b,x[2],mul);
588-
tiger_round(a,b,c,x[3],mul);
589-
tiger_round(b,c,a,x[4],mul);
590-
tiger_round(c,a,b,x[5],mul);
591-
tiger_round(a,b,c,x[6],mul);
592-
tiger_round(b,c,a,x[7],mul);
585+
s_tiger_round(a,b,c,x[0],mul);
586+
s_tiger_round(b,c,a,x[1],mul);
587+
s_tiger_round(c,a,b,x[2],mul);
588+
s_tiger_round(a,b,c,x[3],mul);
589+
s_tiger_round(b,c,a,x[4],mul);
590+
s_tiger_round(c,a,b,x[5],mul);
591+
s_tiger_round(a,b,c,x[6],mul);
592+
s_tiger_round(b,c,a,x[7],mul);
593593
}
594594

595595
/* The key mixing schedule */

0 commit comments

Comments
 (0)