void TDES_setup()

in TPMCmd/tpm/src/crypt/ltc/TpmToLtcDesSupport.c [53:73]


void TDES_setup(
    const BYTE          *key, 
    UINT32               keyBits, 
    symmetric_key       *skey
    )
{
    BYTE                 k[24];
    BYTE                *kp;

    // If this is two-key, make it three key by replicating K1
    if(keyBits == 128)
    {
        memcpy(k, key, 16);
        memcpy(&k[16], key, 8);
        kp = k;
    }
    else
        kp = (BYTE *)key;

    des3_setup(kp, 24, 0, skey);
}