• Home
  • Raw
  • Download

Lines Matching refs:uint32_t

64 static const uint32_t FwdTab0[] = { //other 3 tables are this same table, RORed 8, 16, and 24 bits …
99 static const uint32_t RevTab0[] = { //other 3 tables are this same table, RORed 8, 16, and 24 bits …
138 …#define ror(v, b) ({uint32_t ret; if (b) asm("ror %0, #" STRINGIFY(b) :"=r"(ret):"0"(v)); else ret…
142 inline static uint32_t ror(uint32_t val, uint32_t by) in ror()
155 void aesInitForEncr(struct AesContext *ctx, const uint32_t *k) in aesInitForEncr()
157 uint32_t i, *ks = ctx->K, roundConstant = 0x01000000; in aesInitForEncr()
160 memcpy(ctx->K, k, sizeof(uint32_t[AES_KEY_WORDS])); in aesInitForEncr()
165 ^ (((uint32_t)FwdSbox[(ks[ 7] >> 16) & 0xff]) << 24) in aesInitForEncr()
166 ^ (((uint32_t)FwdSbox[(ks[ 7] >> 8) & 0xff]) << 16) in aesInitForEncr()
167 ^ (((uint32_t)FwdSbox[(ks[ 7] >> 0) & 0xff]) << 8) in aesInitForEncr()
168 ^ (((uint32_t)FwdSbox[(ks[ 7] >> 24) & 0xff]) << 0); in aesInitForEncr()
173 ^ (((uint32_t)FwdSbox[(ks[11] >> 24) & 0xff]) << 24) in aesInitForEncr()
174 ^ (((uint32_t)FwdSbox[(ks[11] >> 16) & 0xff]) << 16) in aesInitForEncr()
175 ^ (((uint32_t)FwdSbox[(ks[11] >> 8) & 0xff]) << 8) in aesInitForEncr()
176 ^ (((uint32_t)FwdSbox[(ks[11] >> 0) & 0xff]) << 0); in aesInitForEncr()
183 void aesInitForDecr(struct AesContext *ctx, struct AesSetupTempWorksSpace *tmpSpace, const uint32_t in aesInitForDecr()
185 uint32_t i, j, *ks = ctx->K + 4, *encrK = tmpSpace->tmpCtx.K + 52; in aesInitForDecr()
191 memcpy(ctx->K, tmpSpace->tmpCtx.K + 56, sizeof(uint32_t[4])); in aesInitForDecr()
201 memcpy(ks, encrK, sizeof(uint32_t[4])); in aesInitForDecr()
204 void aesEncr(struct AesContext *ctx, const uint32_t *src, uint32_t *dst) in aesEncr()
206uint32_t x0, x1, x2, x3; //we CAN use an array, but then GCC will not use registers. so we use sep… in aesEncr()
207 uint32_t *k = ctx->K, i; in aesEncr()
217 uint32_t t0, t1, t2; in aesEncr()
250 (((uint32_t)(FwdSbox[(x0 >> 24) & 0xff])) << 24) ^ in aesEncr()
251 (((uint32_t)(FwdSbox[(x1 >> 16) & 0xff])) << 16) ^ in aesEncr()
252 (((uint32_t)(FwdSbox[(x2 >> 8) & 0xff])) << 8) ^ in aesEncr()
253 (((uint32_t)(FwdSbox[(x3 >> 0) & 0xff])) << 0); in aesEncr()
256 (((uint32_t)(FwdSbox[(x1 >> 24) & 0xff])) << 24) ^ in aesEncr()
257 (((uint32_t)(FwdSbox[(x2 >> 16) & 0xff])) << 16) ^ in aesEncr()
258 (((uint32_t)(FwdSbox[(x3 >> 8) & 0xff])) << 8) ^ in aesEncr()
259 (((uint32_t)(FwdSbox[(x0 >> 0) & 0xff])) << 0); in aesEncr()
262 (((uint32_t)(FwdSbox[(x2 >> 24) & 0xff])) << 24) ^ in aesEncr()
263 (((uint32_t)(FwdSbox[(x3 >> 16) & 0xff])) << 16) ^ in aesEncr()
264 (((uint32_t)(FwdSbox[(x0 >> 8) & 0xff])) << 8) ^ in aesEncr()
265 (((uint32_t)(FwdSbox[(x1 >> 0) & 0xff])) << 0); in aesEncr()
268 (((uint32_t)(FwdSbox[(x3 >> 24) & 0xff])) << 24) ^ in aesEncr()
269 (((uint32_t)(FwdSbox[(x0 >> 16) & 0xff])) << 16) ^ in aesEncr()
270 (((uint32_t)(FwdSbox[(x1 >> 8) & 0xff])) << 8) ^ in aesEncr()
271 (((uint32_t)(FwdSbox[(x2 >> 0) & 0xff])) << 0); in aesEncr()
274 void aesDecr(struct AesContext *ctx, const uint32_t *src, uint32_t *dst) in aesDecr()
276 uint32_t x0, x1, x2, x3; in aesDecr()
277 uint32_t *k = ctx->K, i; in aesDecr()
287 uint32_t t0, t1, t2; in aesDecr()
320 (((uint32_t)(RevSbox[(x0 >> 24) & 0xff])) << 24) ^ in aesDecr()
321 (((uint32_t)(RevSbox[(x3 >> 16) & 0xff])) << 16) ^ in aesDecr()
322 (((uint32_t)(RevSbox[(x2 >> 8) & 0xff])) << 8) ^ in aesDecr()
323 (((uint32_t)(RevSbox[(x1 >> 0) & 0xff])) << 0); in aesDecr()
326 (((uint32_t)(RevSbox[(x1 >> 24) & 0xff])) << 24) ^ in aesDecr()
327 (((uint32_t)(RevSbox[(x0 >> 16) & 0xff])) << 16) ^ in aesDecr()
328 (((uint32_t)(RevSbox[(x3 >> 8) & 0xff])) << 8) ^ in aesDecr()
329 (((uint32_t)(RevSbox[(x2 >> 0) & 0xff])) << 0); in aesDecr()
332 (((uint32_t)(RevSbox[(x2 >> 24) & 0xff])) << 24) ^ in aesDecr()
333 (((uint32_t)(RevSbox[(x1 >> 16) & 0xff])) << 16) ^ in aesDecr()
334 (((uint32_t)(RevSbox[(x0 >> 8) & 0xff])) << 8) ^ in aesDecr()
335 (((uint32_t)(RevSbox[(x3 >> 0) & 0xff])) << 0); in aesDecr()
338 (((uint32_t)(RevSbox[(x3 >> 24) & 0xff])) << 24) ^ in aesDecr()
339 (((uint32_t)(RevSbox[(x2 >> 16) & 0xff])) << 16) ^ in aesDecr()
340 (((uint32_t)(RevSbox[(x1 >> 8) & 0xff])) << 8) ^ in aesDecr()
341 (((uint32_t)(RevSbox[(x0 >> 0) & 0xff])) << 0); in aesDecr()
344 void aesCbcInitForEncr(struct AesCbcContext *ctx, const uint32_t *k, const uint32_t *iv) in aesCbcInitForEncr()
347 memcpy(ctx->iv, iv, sizeof(uint32_t[AES_BLOCK_WORDS])); in aesCbcInitForEncr()
350 void aesCbcInitForDecr(struct AesCbcContext *ctx, const uint32_t *k, const uint32_t *iv) in aesCbcInitForDecr()
355 memcpy(ctx->iv, iv, sizeof(uint32_t[AES_BLOCK_WORDS])); in aesCbcInitForDecr()
358 void aesCbcEncr(struct AesCbcContext *ctx, const uint32_t *src, uint32_t *dst) in aesCbcEncr()
360 uint32_t i; in aesCbcEncr()
366 memcpy(ctx->iv, dst, sizeof(uint32_t[AES_BLOCK_WORDS])); in aesCbcEncr()
369 void aesCbcDecr(struct AesCbcContext *ctx, const uint32_t *src, uint32_t *dst) in aesCbcDecr()
371 uint32_t i, tmp[AES_BLOCK_WORDS]; in aesCbcDecr()
377 memcpy(ctx->iv, src, sizeof(uint32_t[AES_BLOCK_WORDS])); in aesCbcDecr()
378 memcpy(dst, tmp, sizeof(uint32_t[AES_BLOCK_WORDS])); in aesCbcDecr()