openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/libgcrypt/1.8.4-r0/libgcrypt-1.8.4/cipher/rijndael-armv8-ce.c
void _gcry_aes_armv8_ce_prepare_decryption(RIJNDAEL_context* ctx)
{
    u128_t* ekey = (u128_t*)(void*)ctx->keyschenc;
    u128_t* dkey = (u128_t*)(void*)ctx->keyschdec;
    int rounds = ctx->rounds;
    int rr;
    int r;

#define DO_AESIMC() _gcry_aes_invmixcol_armv8_ce(&dkey[r], &ekey[rr])

    dkey[0] = ekey[rounds];
    r = 1;
    rr = rounds - 1;
    DO_AESIMC();
    r++;
    rr--; /* round 1 */
    DO_AESIMC();
    r++;
    rr--; /* round 2 */
    DO_AESIMC();
    r++;
    rr--; /* round 3 */
    DO_AESIMC();
    r++;
    rr--; /* round 4 */
    DO_AESIMC();
    r++;
    rr--; /* round 5 */
    DO_AESIMC();
    r++;
    rr--; /* round 6 */
    DO_AESIMC();
    r++;
    rr--; /* round 7 */
    DO_AESIMC();
    r++;
    rr--; /* round 8 */
    DO_AESIMC();
    r++;
    rr--; /* round 9 */
    if (rounds >= 12)
    {
        if (rounds > 12)
        {
            DO_AESIMC();
            r++;
            rr--; /* round 10 */
            DO_AESIMC();
            r++;
            rr--; /* round 11 */
        }

        DO_AESIMC();
        r++;
        rr--; /* round 12 / 10 */
        DO_AESIMC();
        r++;
        rr--; /* round 13 / 11 */
    }

    dkey[r] = ekey[0];

#undef DO_AESIMC
}
/* Make a decryption key from an encryption key. */
Make a decryption key from an encryption key.
Make a decryption key from an encryption key .
void _gcry_aes_armv8_ce_prepare_decryption(RIJNDAEL_context* ctx)
{
    u128_t* ekey = (u128_t*)(void*)ctx->keyschenc;
    u128_t* dkey = (u128_t*)(void*)ctx->keyschdec;
    int rounds = ctx->rounds;
    int rr;
    int r;
#define DO_AESIMC() _gcry_aes_invmixcol_armv8_ce(&dkey[r], &ekey[rr])
    dkey[0] = ekey[rounds];
    r = 1;
    rr = rounds - 1;
    DO_AESIMC();
    r++;
    rr--; 
    DO_AESIMC();
    r++;
    rr--; 
    DO_AESIMC();
    r++;
    rr--; 
    DO_AESIMC();
    r++;
    rr--; 
    DO_AESIMC();
    r++;
    rr--; 
    DO_AESIMC();
    r++;
    rr--; 
    DO_AESIMC();
    r++;
    rr--; 
    DO_AESIMC();
    r++;
    rr--; 
    DO_AESIMC();
    r++;
    rr--; 
    if (rounds >= 12)
    {
        if (rounds > 12)
        {
            DO_AESIMC();
            r++;
            rr--; 
            DO_AESIMC();
            r++;
            rr--; 
        }
        DO_AESIMC();
        r++;
        rr--; 
        DO_AESIMC();
        r++;
        rr--; 
    }
    dkey[r] = ekey[0];
#undef DO_AESIMC
}
void _gcry_aes_armv8_ce_prepare_decryption ( RIJNDAEL_context * ctx ) { u128_t * ekey = ( u128_t * ) ( void * ) ctx -> keyschenc ; u128_t * dkey = ( u128_t * ) ( void * ) ctx -> keyschdec ; int rounds = ctx -> rounds ; int rr ; int r ; #define DO_AESIMC ( )  _gcry_aes_invmixcol_armv8_ce(&dkey[r], &ekey[rr]) dkey [ 0 ] = ekey [ rounds ] ; r = 1 ; rr = rounds - 1 ; DO_AESIMC ( ) ; r ++ ; rr -- ; DO_AESIMC ( ) ; r ++ ; rr -- ; DO_AESIMC ( ) ; r ++ ; rr -- ; DO_AESIMC ( ) ; r ++ ; rr -- ; DO_AESIMC ( ) ; r ++ ; rr -- ; DO_AESIMC ( ) ; r ++ ; rr -- ; DO_AESIMC ( ) ; r ++ ; rr -- ; DO_AESIMC ( ) ; r ++ ; rr -- ; DO_AESIMC ( ) ; r ++ ; rr -- ; if ( rounds >= 12 ) { if ( rounds > 12 ) { DO_AESIMC ( ) ; r ++ ; rr -- ; DO_AESIMC ( ) ; r ++ ; rr -- ; } DO_AESIMC ( ) ; r ++ ; rr -- ; DO_AESIMC ( ) ; r ++ ; rr -- ; } dkey [ r ] = ekey [ 0 ] ; #undef  DO_AESIMC }
Make a decryption key from an encryption key.
Make a decryption key from an encryption key .
/* round 1 */ /* round 2 */ /* round 3 */ /* round 4 */ /* round 5 */ /* round 6 */ /* round 7 */ /* round 8 */ /* round 9 */ /* round 10 */ /* round 11 */ /* round 12 / 10 */ /* round 13 / 11 */