XilinxProcessorIPLib/drivers/trngpsv/src/CompactAES.c
void aesCbcEncrypt(unsigned char* in, unsigned char* out, AES_BLOCK iv, int max_blk)
{

    int max_blk_int = max_blk;

    while (max_blk_int > 0)
    {
        xorb(iv, in);
        aesEncrypt(iv, iv);
        if (out != NULL)
        {
            (void)memcpy(out, iv, AES_BLK_SIZE);
            out += AES_BLK_SIZE;
        }
        in += AES_BLK_SIZE;
        max_blk_int -= 1;
    }
}
//
// Encrypt few blocks in the CBC mode. If out==NULL, just calculate
// the CBC checksum
//
// Updates the IV to allow the chaining operation
// Key shall be set up prior to invocation
//
Encrypt few blocks in the CBC mode. If out==NULL, just calculate
the CBC checksum

Updates the IV to allow the chaining operation
Key shall be set up prior to invocation
Encrypt few blocks in the CBC mode . If out == NULL just calculate the CBC checksum Updates the IV to allow the chaining operation Key shall be set up prior to invocation
void aesCbcEncrypt(unsigned char* in, unsigned char* out, AES_BLOCK iv, int max_blk)
{
    int max_blk_int = max_blk;
    while (max_blk_int > 0)
    {
        xorb(iv, in);
        aesEncrypt(iv, iv);
        if (out != NULL)
        {
            (void)memcpy(out, iv, AES_BLK_SIZE);
            out += AES_BLK_SIZE;
        }
        in += AES_BLK_SIZE;
        max_blk_int -= 1;
    }
}
void aesCbcEncrypt ( unsigned char * in , unsigned char * out , AES_BLOCK iv , int max_blk ) { int max_blk_int = max_blk ; while ( max_blk_int > 0 ) { xorb ( iv , in ) ; aesEncrypt ( iv , iv ) ; if ( out != NULL ) { ( void ) memcpy ( out , iv , AES_BLK_SIZE ) ; out += AES_BLK_SIZE ; } in += AES_BLK_SIZE ; max_blk_int -= 1 ; } }
Encrypt few blocks in the CBC mode.
Encrypt few blocks in the CBC mode .