You need to use Xor to recover the data. The spec is trying to explain that you need to round up the block length to a multiple of 16 because each crypto block is length 16 due to being 128 bit AES block. If your data is not a multiple of 16 then there will junk padding so you need to trim the resulting XOR by your data length which you have to infer from the packet size.
So if you have a block called "YOURDATA" encoded ==> XXXXXXXX
XXXXXXXX <
XOR
XXXXXXXXXXXXXXXX << Crypto Block Length = 16 because blocks are length 16
=
YOURDATA???????? <
Then trim YOURDATA???????? to length 8
=
YOURDATA
BTW - you can refer to the source code on the TTN git site for some implementation guidance