poly.update(additionalData, 0, additionalData.length);
if (additionalData.length % 16 != 0) {
int round = 16-(additionalData.length%16);
poly.update(new byte[round], 0, round);
poly.update(ciphertext, 0, ciphertext.length);
if (ciphertext.length % 16 != 0) {
int round = 16-(ciphertext.length%16);
poly.update(new byte[round], 0, round);
additionalDataLength = new byte[8];
poly.update(additionalDataLength, 0, 8);
byte[] ciphertextLength = Pack.longToLittleEndian(ciphertext.length);
poly.update(ciphertextLength, 0, 8);