Lines Matching refs:pmac
28 int pmac_process(pmac_state *pmac, const unsigned char *in, unsigned long inlen) in pmac_process() argument
34 LTC_ARGCHK(pmac != NULL); in pmac_process()
36 if ((err = cipher_is_valid(pmac->cipher_idx)) != CRYPT_OK) { in pmac_process()
40 if ((pmac->buflen > (int)sizeof(pmac->block)) || (pmac->buflen < 0) || in pmac_process()
41 (pmac->block_len > (int)sizeof(pmac->block)) || (pmac->buflen > pmac->block_len)) { in pmac_process()
46 if (pmac->buflen == 0 && inlen > 16) { in pmac_process()
49 pmac_shift_xor(pmac); in pmac_process()
51 … *((LTC_FAST_TYPE*)(&Z[y])) = *((LTC_FAST_TYPE*)(&in[y])) ^ *((LTC_FAST_TYPE*)(&pmac->Li[y])); in pmac_process()
53 … if ((err = cipher_descriptor[pmac->cipher_idx].ecb_encrypt(Z, Z, &pmac->key)) != CRYPT_OK) { in pmac_process()
57 *((LTC_FAST_TYPE*)(&pmac->checksum[y])) ^= *((LTC_FAST_TYPE*)(&Z[y])); in pmac_process()
67 if (pmac->buflen == pmac->block_len) { in pmac_process()
68 pmac_shift_xor(pmac); in pmac_process()
69 for (x = 0; x < (unsigned long)pmac->block_len; x++) { in pmac_process()
70 Z[x] = pmac->Li[x] ^ pmac->block[x]; in pmac_process()
72 … if ((err = cipher_descriptor[pmac->cipher_idx].ecb_encrypt(Z, Z, &pmac->key)) != CRYPT_OK) { in pmac_process()
75 for (x = 0; x < (unsigned long)pmac->block_len; x++) { in pmac_process()
76 pmac->checksum[x] ^= Z[x]; in pmac_process()
78 pmac->buflen = 0; in pmac_process()
82 n = MIN(inlen, (unsigned long)(pmac->block_len - pmac->buflen)); in pmac_process()
83 XMEMCPY(pmac->block + pmac->buflen, in, n); in pmac_process()
84 pmac->buflen += n; in pmac_process()