INNER CODE UNIT · C

tmp

pyrogram/tgcrypto · tgcrypto/aes256.c:376

            tmp = sub_word(tmp << 8 | tmp >> 24) ^ RCON[(i - 1) / Nk];
        else if (Nk > 6 && i % Nk == 4)
            tmp = sub_word(tmp);

        expandedKey[i] = expandedKey[i - Nk] ^ tmp;
    }
}

void aes256_set_decryption_key(const uint8_t key[32], uint32_t expandedKey[60]) {
    uint32_t i, j, k, tmp;

    aes256_set_encryption_key(key, expandedKey);

    for (i = 0, j = 56; i < j; i += 4, j -= 4)
        for (k = 0; k < 4; ++k) {
            tmp = expandedKey[i + k];
            expandedKey[i + k] = expandedKey[j + k];
            expandedKey[j + k] = tmp;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…