Rizin
unix-like reverse engineering framework and cli tools
des.c File Reference
#include <rz_types.h>
#include <rz_util.h>

Go to the source code of this file.

Macros

#define ROTL28(rs, sh)   ((((rs) << (sh)) | ((rs) >> (28 - (sh)))) & 0x0FFFFFFF)
 
#define ROTR28(rs, sh)   ((((rs) >> (sh)) | ((rs) << (28 - (sh)))) & 0x0FFFFFFF)
 
#define ROTL(rs, sh)   (((rs) << (sh)) | ((rs) >> (32 - (sh))))
 
#define ROTR(rs, sh)   (((rs) >> (sh)) | ((rs) << (32 - (sh))))
 

Functions

RZ_API void rz_des_permute_key (ut32 *keylo, ut32 *keyhi)
 Apply PC-1. More...
 
RZ_API void rz_des_permute_key_inv (ut32 *keylo, ut32 *keyhi)
 Inverse of rz_des_permute_key (PC-1) More...
 
RZ_API void rz_des_permute_block0 (ut32 *blocklo, ut32 *blockhi)
 first permutation of the input block More...
 
RZ_API void rz_des_permute_block1 (ut32 *blocklo, ut32 *blockhi)
 last permutation of the block More...
 
RZ_API void rz_des_shift_key (int i, bool decrypt, RZ_INOUT ut32 *deskeylo, RZ_INOUT ut32 *deskeyhi)
 Apply the respective shift to the key for a given round. More...
 
RZ_API void rz_des_pc2 (RZ_OUT ut32 *keylo, RZ_OUT ut32 *keyhi, RZ_IN ut32 deslo, RZ_IN ut32 deshi)
 PC-2 permutation of a key. More...
 
RZ_API void rz_des_round_key (int i, RZ_OUT ut32 *keylo, RZ_OUT ut32 *keyhi, RZ_INOUT ut32 *deskeylo, RZ_INOUT ut32 *deskeyhi)
 Calculate the final key to be used in a given round. More...
 
RZ_API void rz_des_round (RZ_OUT ut32 *buflo, RZ_OUT ut32 *bufhi, RZ_IN ut32 *roundkeylo, RZ_IN ut32 *roundkeyhi)
 Apply the cipher function (f) More...
 

Variables

static const ut32 sbox1 [64]
 
static const ut32 sbox2 [64]
 
static const ut32 sbox3 [64]
 
static const ut32 sbox4 [64]
 
static const ut32 sbox5 [64]
 
static const ut32 sbox6 [64]
 
static const ut32 sbox7 [64]
 
static const ut32 sbox8 [64]
 
static const st8 pc1_inv [64]
 

Macro Definition Documentation

◆ ROTL

#define ROTL (   rs,
  sh 
)    (((rs) << (sh)) | ((rs) >> (32 - (sh))))

Definition at line 11 of file des.c.

◆ ROTL28

#define ROTL28 (   rs,
  sh 
)    ((((rs) << (sh)) | ((rs) >> (28 - (sh)))) & 0x0FFFFFFF)

Definition at line 9 of file des.c.

◆ ROTR

#define ROTR (   rs,
  sh 
)    (((rs) >> (sh)) | ((rs) << (32 - (sh))))

Definition at line 12 of file des.c.

◆ ROTR28

#define ROTR28 (   rs,
  sh 
)    ((((rs) >> (sh)) | ((rs) << (28 - (sh)))) & 0x0FFFFFFF)

Definition at line 10 of file des.c.

Function Documentation

◆ rz_des_pc2()

RZ_API void rz_des_pc2 ( RZ_OUT ut32 keylo,
RZ_OUT ut32 keyhi,
RZ_IN ut32  deslo,
RZ_IN ut32  deshi 
)

PC-2 permutation of a key.

Definition at line 247 of file des.c.

247  {
248  rz_return_if_fail(keylo && keyhi);
249  *keylo = ((deslo << 4) & 0x24000000) | ((deslo << 28) & 0x10000000) |
250  ((deslo << 14) & 0x08000000) | ((deslo << 18) & 0x02080000) |
251  ((deslo << 6) & 0x01000000) | ((deslo << 9) & 0x00200000) |
252  ((deslo >> 1) & 0x00100000) | ((deslo << 10) & 0x00040000) |
253  ((deslo << 2) & 0x00020000) | ((deslo >> 10) & 0x00010000) |
254  ((deshi >> 13) & 0x00002000) | ((deshi >> 4) & 0x00001000) |
255  ((deshi << 6) & 0x00000800) | ((deshi >> 1) & 0x00000400) |
256  ((deshi >> 14) & 0x00000200) | ((deshi)&0x00000100) |
257  ((deshi >> 5) & 0x00000020) | ((deshi >> 10) & 0x00000010) |
258  ((deshi >> 3) & 0x00000008) | ((deshi >> 18) & 0x00000004) |
259  ((deshi >> 26) & 0x00000002) | ((deshi >> 24) & 0x00000001);
260 
261  *keyhi = ((deslo << 15) & 0x20000000) | ((deslo << 17) & 0x10000000) |
262  ((deslo << 10) & 0x08000000) | ((deslo << 22) & 0x04000000) |
263  ((deslo >> 2) & 0x02000000) | ((deslo << 1) & 0x01000000) |
264  ((deslo << 16) & 0x00200000) | ((deslo << 11) & 0x00100000) |
265  ((deslo << 3) & 0x00080000) | ((deslo >> 6) & 0x00040000) |
266  ((deslo << 15) & 0x00020000) | ((deslo >> 4) & 0x00010000) |
267  ((deshi >> 2) & 0x00002000) | ((deshi << 8) & 0x00001000) |
268  ((deshi >> 14) & 0x00000808) | ((deshi >> 9) & 0x00000400) |
269  ((deshi)&0x00000200) | ((deshi << 7) & 0x00000100) |
270  ((deshi >> 7) & 0x00000020) | ((deshi >> 3) & 0x00000011) |
271  ((deshi << 2) & 0x00000004) | ((deshi >> 21) & 0x00000002);
272 }
#define rz_return_if_fail(expr)
Definition: rz_assert.h:100

References rz_return_if_fail.

Referenced by avr_custom_des(), and rz_des_round_key().

◆ rz_des_permute_block0()

RZ_API void rz_des_permute_block0 ( ut32 blocklo,
ut32 blockhi 
)

first permutation of the input block

Definition at line 171 of file des.c.

171  {
172  rz_return_if_fail(blocklo && blockhi);
173  ut32 lo = *blocklo;
174  ut32 hi = *blockhi;
175  ut32 perm = ((lo >> 4) ^ hi) & 0x0F0F0F0F;
176  hi ^= perm;
177  lo ^= perm << 4;
178  perm = ((lo >> 16) ^ hi) & 0x0000FFFF;
179  hi ^= perm;
180  lo ^= perm << 16;
181  perm = ((hi >> 2) ^ lo) & 0x33333333;
182  lo ^= perm;
183  hi ^= perm << 2;
184  perm = ((hi >> 8) ^ lo) & 0x00FF00FF;
185  lo ^= perm;
186  hi ^= perm << 8;
187  perm = ((lo >> 1) ^ hi) & 0x55555555;
188  hi ^= perm;
189  lo ^= perm << 1;
190  *blocklo = ROTL(lo, 1);
191  *blockhi = ROTL(hi, 1);
192 }
uint32_t ut32
#define ROTL(rs, sh)
Definition: des.c:11
hi(addr) 0x03

References hi(), lo, ROTL, and rz_return_if_fail.

Referenced by avr_custom_des(), des_decrypt(), and des_encrypt().

◆ rz_des_permute_block1()

RZ_API void rz_des_permute_block1 ( ut32 blocklo,
ut32 blockhi 
)

last permutation of the block

Definition at line 195 of file des.c.

195  {
196  rz_return_if_fail(blocklo && blockhi);
197  ut32 lo = *blocklo;
198  ut32 hi = *blockhi;
199  lo = ROTR(lo, 1);
200  hi = ROTR(hi, 1);
201  ut32 perm = ((lo >> 1) ^ hi) & 0x55555555;
202  hi ^= perm;
203  lo ^= perm << 1;
204  perm = ((hi >> 8) ^ lo) & 0x00FF00FF;
205  lo ^= perm;
206  hi ^= perm << 8;
207  perm = ((hi >> 2) ^ lo) & 0x33333333;
208  lo ^= perm;
209  hi ^= perm << 2;
210  perm = ((lo >> 16) ^ hi) & 0x0000FFFF;
211  hi ^= perm;
212  lo ^= perm << 16;
213  perm = ((lo >> 4) ^ hi) & 0x0F0F0F0F;
214  hi ^= perm;
215  lo ^= perm << 4;
216  *blocklo = lo;
217  *blockhi = hi;
218 }
#define ROTR(rs, sh)
Definition: des.c:12

References hi(), lo, ROTR, and rz_return_if_fail.

Referenced by avr_custom_des(), des_decrypt(), and des_encrypt().

◆ rz_des_permute_key()

RZ_API void rz_des_permute_key ( ut32 keylo,
ut32 keyhi 
)

Apply PC-1.

Definition at line 115 of file des.c.

115  {
116  rz_return_if_fail(keylo && keyhi);
117  ut32 perm = ((*keylo >> 4) ^ *keyhi) & 0x0F0F0F0F;
118  *keyhi ^= perm;
119  *keylo ^= (perm << 4);
120  perm = ((*keyhi >> 16) ^ *keylo) & 0x0000FFFF;
121  *keylo ^= perm;
122  *keyhi ^= (perm << 16);
123  perm = ((*keylo >> 2) ^ *keyhi) & 0x33333333;
124  *keyhi ^= perm;
125  *keylo ^= (perm << 2);
126  perm = ((*keyhi >> 16) ^ *keylo) & 0x0000FFFF;
127  *keylo ^= perm;
128  *keyhi ^= (perm << 16);
129  perm = ((*keylo >> 1) ^ *keyhi) & 0x55555555;
130  *keyhi ^= perm;
131  *keylo ^= (perm << 1);
132  perm = ((*keyhi >> 8) ^ *keylo) & 0x00FF00FF;
133  *keylo ^= perm;
134  *keyhi ^= (perm << 8);
135  perm = ((*keylo >> 1) ^ *keyhi) & 0x55555555;
136  *keyhi ^= perm;
137  *keylo ^= (perm << 1);
138  perm = (*keylo << 8) | ((*keyhi >> 20) & 0x000000F0);
139  *keylo = ((*keyhi << 20) & 0x0FF00000);
140  *keylo |= ((*keyhi << 4) & 0x000FF000);
141  *keylo |= ((*keyhi >> 12) & 0x00000FF0);
142  *keylo |= ((*keyhi >> 28) & 0x0000000F);
143  *keyhi = perm >> 4;
144 }

References rz_return_if_fail.

Referenced by avr_custom_des(), and des_set_key().

◆ rz_des_permute_key_inv()

RZ_API void rz_des_permute_key_inv ( ut32 keylo,
ut32 keyhi 
)

Inverse of rz_des_permute_key (PC-1)

This is usually not necessary when executing DES. Keep in mind that PC-1 is not injective on arbitrary values, as it drops the parity bits. This inverse function simply sets the positions of those to 0.

Definition at line 153 of file des.c.

153  {
154  rz_return_if_fail(keylo && keyhi);
155  ut64 in = *keylo | ((ut64)*keyhi << 32);
156  ut64 out = 0;
157  for (size_t i = 0; i < 64; i++) {
158  st8 p = pc1_inv[i];
159  if (p < 0) {
160  continue;
161  }
162  if (in & ((ut64)1 << p)) {
163  out |= ((ut64)1 << i);
164  }
165  }
166  *keylo = out & 0xffffffff;
167  *keyhi = out >> 32;
168 }
lzma_index ** i
Definition: index.h:629
const lzma_allocator const uint8_t * in
Definition: block.h:527
const lzma_allocator const uint8_t size_t uint8_t * out
Definition: block.h:528
static const st8 pc1_inv[64]
Definition: des.c:103
void * p
Definition: libc.cpp:67
#define st8
Definition: rz_types_base.h:16
ut64(WINAPI *w32_GetEnabledXStateFeatures)()

References i, in, out, p, pc1_inv, rz_return_if_fail, st8, and ut64().

Referenced by avr_custom_des().

◆ rz_des_round()

RZ_API void rz_des_round ( RZ_OUT ut32 buflo,
RZ_OUT ut32 bufhi,
RZ_IN ut32 roundkeylo,
RZ_IN ut32 roundkeyhi 
)

Apply the cipher function (f)

Definition at line 292 of file des.c.

292  {
293  rz_return_if_fail(buflo && bufhi && roundkeylo && roundkeyhi);
294  ut32 lo = *buflo;
295  ut32 hi = *bufhi;
296  ut32 perm = hi ^ (*roundkeylo);
297  lo ^= sbox2[(perm >> 24) & 0x3F];
298  lo ^= sbox4[(perm >> 16) & 0x3F];
299  lo ^= sbox6[(perm >> 8) & 0x3F];
300  lo ^= sbox8[perm & 0x3F];
301  perm = ROTR(hi, 4) ^ (*roundkeyhi);
302  lo ^= sbox1[(perm >> 24) & 0x3F];
303  lo ^= sbox3[(perm >> 16) & 0x3F];
304  lo ^= sbox5[(perm >> 8) & 0x3F];
305  lo ^= sbox7[perm & 0x3F];
306  perm = hi;
307  *bufhi = lo;
308  *buflo = perm;
309 }
static const ut32 sbox8[64]
Definition: des.c:92
static const ut32 sbox7[64]
Definition: des.c:81
static const ut32 sbox3[64]
Definition: des.c:37
static const ut32 sbox6[64]
Definition: des.c:70
static const ut32 sbox1[64]
Definition: des.c:15
static const ut32 sbox5[64]
Definition: des.c:59
static const ut32 sbox4[64]
Definition: des.c:48
static const ut32 sbox2[64]
Definition: des.c:26

References hi(), lo, ROTR, rz_return_if_fail, sbox1, sbox2, sbox3, sbox4, sbox5, sbox6, sbox7, and sbox8.

Referenced by avr_custom_des(), des_decrypt(), and des_encrypt().

◆ rz_des_round_key()

RZ_API void rz_des_round_key ( int  i,
RZ_OUT ut32 keylo,
RZ_OUT ut32 keyhi,
RZ_INOUT ut32 deskeylo,
RZ_INOUT ut32 deskeyhi 
)

Calculate the final key to be used in a given round.

Parameters
inumber of the round
keyloderivated round key (output)
keyhiderivated round key (output)
deskeylodes derivated key (input+modified)
deskeyhides derivated key (input+modified)

This function should be applied successively with i from 0 to 15 as deskeylo/deskeyhi is left-shifted in each iteration.

Definition at line 285 of file des.c.

285  {
286  rz_return_if_fail(keylo && keyhi && deskeylo && deskeyhi);
287  rz_des_shift_key(i, false, deskeylo, deskeyhi);
288  rz_des_pc2(keylo, keyhi, *deskeylo, *deskeyhi);
289 }
RZ_API void rz_des_pc2(RZ_OUT ut32 *keylo, RZ_OUT ut32 *keyhi, RZ_IN ut32 deslo, RZ_IN ut32 deshi)
PC-2 permutation of a key.
Definition: des.c:247
RZ_API void rz_des_shift_key(int i, bool decrypt, RZ_INOUT ut32 *deskeylo, RZ_INOUT ut32 *deskeyhi)
Apply the respective shift to the key for a given round.
Definition: des.c:225

References i, rz_des_pc2(), rz_des_shift_key(), and rz_return_if_fail.

Referenced by des_set_key().

◆ rz_des_shift_key()

RZ_API void rz_des_shift_key ( int  i,
bool  decrypt,
RZ_INOUT ut32 deskeylo,
RZ_INOUT ut32 deskeyhi 
)

Apply the respective shift to the key for a given round.

Parameters
inumber of the round
decryptIf false, the specified left-shift is executed. If true, the inverse is applied.

Definition at line 225 of file des.c.

225  {
226  rz_return_if_fail(deskeylo && deskeyhi);
227  if (!decrypt) {
228  if (i == 0 || i == 1 || i == 8 || i == 15) {
229  *deskeylo = ROTL28(*deskeylo, 1);
230  *deskeyhi = ROTL28(*deskeyhi, 1);
231  } else {
232  *deskeylo = ROTL28(*deskeylo, 2);
233  *deskeyhi = ROTL28(*deskeyhi, 2);
234  }
235  } else {
236  if (i == 0 || i == 1 || i == 8 || i == 15) {
237  *deskeylo = ROTR28(*deskeylo, 1);
238  *deskeyhi = ROTR28(*deskeyhi, 1);
239  } else {
240  *deskeylo = ROTR28(*deskeylo, 2);
241  *deskeyhi = ROTR28(*deskeyhi, 2);
242  }
243  }
244 }
#define ROTL28(rs, sh)
Definition: des.c:9
#define ROTR28(rs, sh)
Definition: des.c:10

References i, ROTL28, ROTR28, and rz_return_if_fail.

Referenced by avr_custom_des(), and rz_des_round_key().

Variable Documentation

◆ pc1_inv

const st8 pc1_inv[64]
static
Initial value:
= {
-1, 0x3b, 0x33, 0x2b, 0x03, 0x0b, 0x13, 0x1b,
-1, 0x3a, 0x32, 0x2a, 0x02, 0x0a, 0x12, 0x1a,
-1, 0x39, 0x31, 0x29, 0x01, 0x09, 0x11, 0x19,
-1, 0x38, 0x30, 0x28, 0x00, 0x08, 0x10, 0x18,
-1, 0x37, 0x2f, 0x27, 0x23, 0x07, 0x0f, 0x17,
-1, 0x36, 0x2e, 0x26, 0x22, 0x06, 0x0e, 0x16,
-1, 0x35, 0x2d, 0x25, 0x21, 0x05, 0x0d, 0x15,
-1, 0x34, 0x2c, 0x24, 0x20, 0x04, 0x0c, 0x14
}

Definition at line 103 of file des.c.

Referenced by rz_des_permute_key_inv().

◆ sbox1

const ut32 sbox1[64]
static
Initial value:
= {
0x01010400, 0x00000000, 0x00010000, 0x01010404, 0x01010004, 0x00010404, 0x00000004, 0x00010000,
0x00000400, 0x01010400, 0x01010404, 0x00000400, 0x01000404, 0x01010004, 0x01000000, 0x00000004,
0x00000404, 0x01000400, 0x01000400, 0x00010400, 0x00010400, 0x01010000, 0x01010000, 0x01000404,
0x00010004, 0x01000004, 0x01000004, 0x00010004, 0x00000000, 0x00000404, 0x00010404, 0x01000000,
0x00010000, 0x01010404, 0x00000004, 0x01010000, 0x01010400, 0x01000000, 0x01000000, 0x00000400,
0x01010004, 0x00010000, 0x00010400, 0x01000004, 0x00000400, 0x00000004, 0x01000404, 0x00010404,
0x01010404, 0x00010004, 0x01010000, 0x01000404, 0x01000004, 0x00000404, 0x00010404, 0x01010400,
0x00000404, 0x01000400, 0x01000400, 0x00000000, 0x00010004, 0x00010400, 0x00000000, 0x01010004
}

Definition at line 15 of file des.c.

Referenced by fn(), and rz_des_round().

◆ sbox2

const ut32 sbox2[64]
static
Initial value:
= {
0x80108020, 0x80008000, 0x00008000, 0x00108020, 0x00100000, 0x00000020, 0x80100020, 0x80008020,
0x80000020, 0x80108020, 0x80108000, 0x80000000, 0x80008000, 0x00100000, 0x00000020, 0x80100020,
0x00108000, 0x00100020, 0x80008020, 0x00000000, 0x80000000, 0x00008000, 0x00108020, 0x80100000,
0x00100020, 0x80000020, 0x00000000, 0x00108000, 0x00008020, 0x80108000, 0x80100000, 0x00008020,
0x00000000, 0x00108020, 0x80100020, 0x00100000, 0x80008020, 0x80100000, 0x80108000, 0x00008000,
0x80100000, 0x80008000, 0x00000020, 0x80108020, 0x00108020, 0x00000020, 0x00008000, 0x80000000,
0x00008020, 0x80108000, 0x00100000, 0x80000020, 0x00100020, 0x80008020, 0x80000020, 0x00100020,
0x00108000, 0x00000000, 0x80008000, 0x00008020, 0x80000000, 0x80100020, 0x80108020, 0x00108000
}

Definition at line 26 of file des.c.

Referenced by fn(), and rz_des_round().

◆ sbox3

const ut32 sbox3[64]
static
Initial value:
= {
0x00000208, 0x08020200, 0x00000000, 0x08020008, 0x08000200, 0x00000000, 0x00020208, 0x08000200,
0x00020008, 0x08000008, 0x08000008, 0x00020000, 0x08020208, 0x00020008, 0x08020000, 0x00000208,
0x08000000, 0x00000008, 0x08020200, 0x00000200, 0x00020200, 0x08020000, 0x08020008, 0x00020208,
0x08000208, 0x00020200, 0x00020000, 0x08000208, 0x00000008, 0x08020208, 0x00000200, 0x08000000,
0x08020200, 0x08000000, 0x00020008, 0x00000208, 0x00020000, 0x08020200, 0x08000200, 0x00000000,
0x00000200, 0x00020008, 0x08020208, 0x08000200, 0x08000008, 0x00000200, 0x00000000, 0x08020008,
0x08000208, 0x00020000, 0x08000000, 0x08020208, 0x00000008, 0x00020208, 0x00020200, 0x08000008,
0x08020000, 0x08000208, 0x00000208, 0x08020000, 0x00020208, 0x00000008, 0x08020008, 0x00020200
}

Definition at line 37 of file des.c.

Referenced by fn(), and rz_des_round().

◆ sbox4

const ut32 sbox4[64]
static
Initial value:
= {
0x00802001, 0x00002081, 0x00002081, 0x00000080, 0x00802080, 0x00800081, 0x00800001, 0x00002001,
0x00000000, 0x00802000, 0x00802000, 0x00802081, 0x00000081, 0x00000000, 0x00800080, 0x00800001,
0x00000001, 0x00002000, 0x00800000, 0x00802001, 0x00000080, 0x00800000, 0x00002001, 0x00002080,
0x00800081, 0x00000001, 0x00002080, 0x00800080, 0x00002000, 0x00802080, 0x00802081, 0x00000081,
0x00800080, 0x00800001, 0x00802000, 0x00802081, 0x00000081, 0x00000000, 0x00000000, 0x00802000,
0x00002080, 0x00800080, 0x00800081, 0x00000001, 0x00802001, 0x00002081, 0x00002081, 0x00000080,
0x00802081, 0x00000081, 0x00000001, 0x00002000, 0x00800001, 0x00002001, 0x00802080, 0x00800081,
0x00002001, 0x00002080, 0x00800000, 0x00802001, 0x00000080, 0x00800000, 0x00002000, 0x00802080
}

Definition at line 48 of file des.c.

Referenced by fn(), and rz_des_round().

◆ sbox5

const ut32 sbox5[64]
static
Initial value:
= {
0x00000100, 0x02080100, 0x02080000, 0x42000100, 0x00080000, 0x00000100, 0x40000000, 0x02080000,
0x40080100, 0x00080000, 0x02000100, 0x40080100, 0x42000100, 0x42080000, 0x00080100, 0x40000000,
0x02000000, 0x40080000, 0x40080000, 0x00000000, 0x40000100, 0x42080100, 0x42080100, 0x02000100,
0x42080000, 0x40000100, 0x00000000, 0x42000000, 0x02080100, 0x02000000, 0x42000000, 0x00080100,
0x00080000, 0x42000100, 0x00000100, 0x02000000, 0x40000000, 0x02080000, 0x42000100, 0x40080100,
0x02000100, 0x40000000, 0x42080000, 0x02080100, 0x40080100, 0x00000100, 0x02000000, 0x42080000,
0x42080100, 0x00080100, 0x42000000, 0x42080100, 0x02080000, 0x00000000, 0x40080000, 0x42000000,
0x00080100, 0x02000100, 0x40000100, 0x00080000, 0x00000000, 0x40080000, 0x02080100, 0x40000100
}

Definition at line 59 of file des.c.

Referenced by rz_des_round().

◆ sbox6

const ut32 sbox6[64]
static
Initial value:
= {
0x20000010, 0x20400000, 0x00004000, 0x20404010, 0x20400000, 0x00000010, 0x20404010, 0x00400000,
0x20004000, 0x00404010, 0x00400000, 0x20000010, 0x00400010, 0x20004000, 0x20000000, 0x00004010,
0x00000000, 0x00400010, 0x20004010, 0x00004000, 0x00404000, 0x20004010, 0x00000010, 0x20400010,
0x20400010, 0x00000000, 0x00404010, 0x20404000, 0x00004010, 0x00404000, 0x20404000, 0x20000000,
0x20004000, 0x00000010, 0x20400010, 0x00404000, 0x20404010, 0x00400000, 0x00004010, 0x20000010,
0x00400000, 0x20004000, 0x20000000, 0x00004010, 0x20000010, 0x20404010, 0x00404000, 0x20400000,
0x00404010, 0x20404000, 0x00000000, 0x20400010, 0x00000010, 0x00004000, 0x20400000, 0x00404010,
0x00004000, 0x00400010, 0x20004010, 0x00000000, 0x20404000, 0x20000000, 0x00400010, 0x20004010
}

Definition at line 70 of file des.c.

Referenced by rz_des_round().

◆ sbox7

const ut32 sbox7[64]
static
Initial value:
= {
0x00200000, 0x04200002, 0x04000802, 0x00000000, 0x00000800, 0x04000802, 0x00200802, 0x04200800,
0x04200802, 0x00200000, 0x00000000, 0x04000002, 0x00000002, 0x04000000, 0x04200002, 0x00000802,
0x04000800, 0x00200802, 0x00200002, 0x04000800, 0x04000002, 0x04200000, 0x04200800, 0x00200002,
0x04200000, 0x00000800, 0x00000802, 0x04200802, 0x00200800, 0x00000002, 0x04000000, 0x00200800,
0x04000000, 0x00200800, 0x00200000, 0x04000802, 0x04000802, 0x04200002, 0x04200002, 0x00000002,
0x00200002, 0x04000000, 0x04000800, 0x00200000, 0x04200800, 0x00000802, 0x00200802, 0x04200800,
0x00000802, 0x04000002, 0x04200802, 0x04200000, 0x00200800, 0x00000000, 0x00000002, 0x04200802,
0x00000000, 0x00200802, 0x04200000, 0x00000800, 0x04000002, 0x04000800, 0x00000800, 0x00200002
}

Definition at line 81 of file des.c.

Referenced by rz_des_round().

◆ sbox8

const ut32 sbox8[64]
static
Initial value:
= {
0x10001040, 0x00001000, 0x00040000, 0x10041040, 0x10000000, 0x10001040, 0x00000040, 0x10000000,
0x00040040, 0x10040000, 0x10041040, 0x00041000, 0x10041000, 0x00041040, 0x00001000, 0x00000040,
0x10040000, 0x10000040, 0x10001000, 0x00001040, 0x00041000, 0x00040040, 0x10040040, 0x10041000,
0x00001040, 0x00000000, 0x00000000, 0x10040040, 0x10000040, 0x10001000, 0x00041040, 0x00040000,
0x00041040, 0x00040000, 0x10041000, 0x00001000, 0x00000040, 0x10040040, 0x00001000, 0x00041040,
0x10001000, 0x00000040, 0x10000040, 0x10040000, 0x10040040, 0x10000000, 0x00040000, 0x10001040,
0x00000000, 0x10041040, 0x00040040, 0x10000040, 0x10040000, 0x10001000, 0x10001040, 0x00000000,
0x10041040, 0x00041000, 0x00041000, 0x00001040, 0x00001040, 0x00040040, 0x10000000, 0x10041000
}

Definition at line 92 of file des.c.

Referenced by rz_des_round().