Lines Matching refs:gcm
27 int gcm_done(gcm_state *gcm, in gcm_done() argument
33 LTC_ARGCHK(gcm != NULL); in gcm_done()
37 if (gcm->buflen > 16 || gcm->buflen < 0) { in gcm_done()
41 if ((err = cipher_is_valid(gcm->cipher)) != CRYPT_OK) { in gcm_done()
46 if (gcm->mode != GCM_MODE_TEXT) { in gcm_done()
51 if (gcm->buflen) { in gcm_done()
52 gcm->pttotlen += gcm->buflen * CONST64(8); in gcm_done()
53 gcm_mult_h(gcm, gcm->X); in gcm_done()
57 STORE64H(gcm->totlen, gcm->buf); in gcm_done()
58 STORE64H(gcm->pttotlen, gcm->buf+8); in gcm_done()
60 gcm->X[x] ^= gcm->buf[x]; in gcm_done()
62 gcm_mult_h(gcm, gcm->X); in gcm_done()
65 … if ((err = cipher_descriptor[gcm->cipher].ecb_encrypt(gcm->Y_0, gcm->buf, &gcm->K)) != CRYPT_OK) { in gcm_done()
69 tag[x] = gcm->buf[x] ^ gcm->X[x]; in gcm_done()
73 cipher_descriptor[gcm->cipher].done(&gcm->K); in gcm_done()