+ }
+
+ // format and add keys to block dump output
+ if (hasAuthKey) {
+ // if we didn't swapendian before - do it now for the sprint_hex call
+ // NOTE: default entry is bigendian (unless swapped), sprint_hex outputs little endian
+ // need to swap to keep it the same
+ if (!swapEndian){
+ authKeyPtr = SwapEndian64(authenticationkey, dataLen, (dataLen == 16) ? 8 : 4);
+ } else {
+ authKeyPtr = authenticationkey;
+ }
+
+ if (tagtype & UL_C){ //add 4 pages
+ memcpy(data + Pages*4, authKeyPtr, dataLen);
+ Pages += dataLen/4;
+ } else { // 2nd page from end
+ memcpy(data + (Pages*4) - 8, authenticationkey, dataLen);
+ }
+ }
+
+ //add *special* blocks to dump