Lines Matching full:state
20 int pmac_done(pmac_state *state, unsigned char *out, unsigned long *outlen)
24 LTC_ARGCHK(state != NULL);
26 if ((err = cipher_is_valid(state->cipher_idx)) != CRYPT_OK) {
30 if ((state->buflen > (int)sizeof(state->block)) || (state->buflen < 0) ||
31 (state->block_len > (int)sizeof(state->block)) || (state->buflen > state->block_len)) {
38 if (state->buflen == state->block_len) {
40 for (x = 0; x < state->block_len; x++) {
41 state->checksum[x] ^= state->block[x] ^ state->Lr[x];
45 for (x = 0; x < state->buflen; x++) {
46 state->checksum[x] ^= state->block[x];
48 state->checksum[x] ^= 0x80;
52 if ((err = cipher_descriptor[state->cipher_idx].ecb_encrypt(state->checksum, state->checksum, &state->key)) != CRYPT_OK) {
55 cipher_descriptor[state->cipher_idx].done(&state->key);
58 for (x = 0; x < state->block_len && x < (int)*outlen; x++) {
59 out[x] = state->checksum[x];
64 zeromem(state, sizeof(*state));