int BCMROMFN(aes_cbc_decrypt)(uint32 *rk, const size_t key_len, const uint8 *nonce, const size_t data_len, const uint8 *ctxt, uint8 *ptxt) { return aes_cbc_decrypt_pad(rk, key_len, nonce, data_len, ctxt, ptxt, NO_PADDING); }
void reg_proto_decrypt_data(BufferObj *cipherText, BufferObj *iv, BufferObj *encrKey, BufferObj *authKey, BufferObj *plainText) { /* 10 rounds for cbc 128 = (10+1) * 4 uint32 */ uint32 rk[44]; uint8 outBuf[1024]; int plaintext_len; TUTRACE((TUTRACE_ERR, "RPROTO: calling decryption\n")); rijndaelKeySetupDec(rk, encrKey->pBase, 128); plaintext_len = aes_cbc_decrypt_pad(rk, 16, iv->pBase, cipherText->m_dataLength, cipherText->pBase, outBuf, PAD_LEN_PADDING); buffobj_Append(plainText, plaintext_len, outBuf); buffobj_RewindLength(plainText, plainText->m_dataLength); }