Lines Matching refs:rk
875 void rijndaelKeySetupEnc(u32 rk[/*44*/], const u8 cipherKey[])
880 rk[0] = GETU32(cipherKey );
881 rk[1] = GETU32(cipherKey + 4);
882 rk[2] = GETU32(cipherKey + 8);
883 rk[3] = GETU32(cipherKey + 12);
885 temp = rk[3];
886 rk[4] = rk[0] ^
889 rk[5] = rk[1] ^ rk[4];
890 rk[6] = rk[2] ^ rk[5];
891 rk[7] = rk[3] ^ rk[6];
892 rk += 4;
902 void rijndaelKeySetupDec(u32 rk[/*44*/], const u8 cipherKey[])
908 rijndaelKeySetupEnc(rk, cipherKey);
911 temp = rk[i ]; rk[i ] = rk[j ]; rk[j ] = temp;
912 temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp;
913 temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp;
914 temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp;
919 rk += 4;
921 rk[j] = TD0_(TE4((rk[j] >> 24) )) ^
922 TD1_(TE4((rk[j] >> 16) & 0xff)) ^
923 TD2_(TE4((rk[j] >> 8) & 0xff)) ^
924 TD3_(TE4((rk[j] ) & 0xff));
931 void rijndaelEncrypt(const u32 rk[/*44*/], const u8 pt[16], u8 ct[16])
943 s0 = GETU32(pt ) ^ rk[0];
944 s1 = GETU32(pt + 4) ^ rk[1];
945 s2 = GETU32(pt + 8) ^ rk[2];
946 s3 = GETU32(pt + 12) ^ rk[3];
949 d##0 = TE0(s##0) ^ TE1(s##1) ^ TE2(s##2) ^ TE3(s##3) ^ rk[4 * i]; \
950 d##1 = TE0(s##1) ^ TE1(s##2) ^ TE2(s##3) ^ TE3(s##0) ^ rk[4 * i + 1]; \
951 d##2 = TE0(s##2) ^ TE1(s##3) ^ TE2(s##0) ^ TE3(s##1) ^ rk[4 * i + 2]; \
952 d##3 = TE0(s##3) ^ TE1(s##0) ^ TE2(s##1) ^ TE3(s##2) ^ rk[4 * i + 3]
966 rk += Nr << 2;
974 rk += 8;
988 s0 = TE41(t0) ^ TE42(t1) ^ TE43(t2) ^ TE44(t3) ^ rk[0];
990 s1 = TE41(t1) ^ TE42(t2) ^ TE43(t3) ^ TE44(t0) ^ rk[1];
992 s2 = TE41(t2) ^ TE42(t3) ^ TE43(t0) ^ TE44(t1) ^ rk[2];
994 s3 = TE41(t3) ^ TE42(t0) ^ TE43(t1) ^ TE44(t2) ^ rk[3];
999 void rijndaelDecrypt(const u32 rk[/*44*/], const u8 ct[16], u8 pt[16])
1011 s0 = GETU32(ct ) ^ rk[0];
1012 s1 = GETU32(ct + 4) ^ rk[1];
1013 s2 = GETU32(ct + 8) ^ rk[2];
1014 s3 = GETU32(ct + 12) ^ rk[3];
1017 d##0 = TD0(s##0) ^ TD1(s##3) ^ TD2(s##2) ^ TD3(s##1) ^ rk[4 * i]; \
1018 d##1 = TD0(s##1) ^ TD1(s##0) ^ TD2(s##3) ^ TD3(s##2) ^ rk[4 * i + 1]; \
1019 d##2 = TD0(s##2) ^ TD1(s##1) ^ TD2(s##0) ^ TD3(s##3) ^ rk[4 * i + 2]; \
1020 d##3 = TD0(s##3) ^ TD1(s##2) ^ TD2(s##1) ^ TD3(s##0) ^ rk[4 * i + 3]
1034 rk += Nr << 2;
1042 rk += 8;
1056 s0 = TD41(t0) ^ TD42(t3) ^ TD43(t2) ^ TD44(t1) ^ rk[0];
1058 s1 = TD41(t1) ^ TD42(t0) ^ TD43(t3) ^ TD44(t2) ^ rk[1];
1060 s2 = TD41(t2) ^ TD42(t1) ^ TD43(t0) ^ TD44(t3) ^ rk[2];
1062 s3 = TD41(t3) ^ TD42(t2) ^ TD43(t1) ^ TD44(t0) ^ rk[3];
1075 u32 *rk;
1078 rk = os_malloc(AES_PRIV_SIZE);
1079 if (rk == NULL)
1081 rijndaelKeySetupEnc(rk, key);
1082 return rk;
1103 u32 *rk;
1106 rk = os_malloc(AES_PRIV_SIZE);
1107 if (rk == NULL)
1109 rijndaelKeySetupDec(rk, key);
1110 return rk;