in src/gcm.c [196:214]
int GCM_add_header(gcm* g,const char *header,int len)
{
/* Add some header. Won't be encrypted, but will be authenticated. len is length of header */
int j=0;
if (g->status!=GCM_ACCEPTING_HEADER) return 0;
while (j<len)
{
for (int i=0; i<16 && j<len; i++,j++)
{
g->stateX[i]^=header[j];
g->lenA[1]++;
if (g->lenA[1]==0) g->lenA[0]++;
}
gf2mul(g);
}
if (len%16!=0) g->status=GCM_ACCEPTING_CIPHER;
return 1;
}