+@@ -344,8 +344,7 @@ class CryptAlgo(object):
+ encryptor = cipher.encryptor()
+
+ if self.is_aead:
+- aad = struct.pack('!LL', esp.spi, esp.seq)
+- encryptor.authenticate_additional_data(aad)
++ encryptor.authenticate_additional_data(sa.build_aead(esp))
+ data = encryptor.update(data) + encryptor.finalize()
+ data += encryptor.tag[:self.icv_size]
+ else:
+@@ -380,10 +379,7 @@ class CryptAlgo(object):
+
+ if self.is_aead:
+ # Tag value check is done during the finalize method
+- decryptor.authenticate_additional_data(
+- struct.pack('!LL', esp.spi, esp.seq)
+- )
+-
++ decryptor.authenticate_additional_data(sa.build_aead(esp))
+ try:
+ data = decryptor.update(data) + decryptor.finalize()
+ except InvalidTag as err:
+@@ -518,12 +514,16 @@ class AuthAlgo(object):