similar android source code checks for integrity:

https://android.googlesource.com/platform/libcore/+/cec4dd4b1d33f78997603d0f89c0d0e56e64dbcd/luni/src/main/java/org/bouncycastle/crypto/engines/AESWrapEngine.java 

throws exception if checksum fails.