memset(running_tag,0,CRYPTO_BLOCKSIZE);/* Set running tag to zero */
/* Padding of A */
for(i=0;i<adlen;i++)
AD[i]=ad[i];
/* Pad A if it is incomplete OR if it is empty and there is no message either*/
if(ad_incomplete)
nbABlocks++;
AD[adlen]=0x80;
for(i=adlen+1;i<nbABlocks*CRYPTO_BLOCKSIZE;i++)
AD[i]=0x00;
/* Pad M if it is incomplete */
if(last_m_block_size!=0)
nbMBlocks++;
for(i=0;i<mlen;i++)
M[i]=m[i];
M[mlen]=0x80;
for(i=mlen+1;i<nbMBlocks*CRYPTO_BLOCKSIZE;i++)
M[i]=0x00;
/* Construct baseline tweakey: key and nonce part remains unchanged throughout the execution. Initialize the remainder of the tweakey state to zero. */