2025-10-02 9:00 AM
The reference manual mentions that data swapping can be used when e.g. processing ASCII, but I'm not clear on exactly what it does. If I set it to byte mode, does that mean I can write single byte values padded to 32 bits with zeros into the FIFO? And with the bit mode, can I write single bits padded to 32 with zeros? What if I don't pad with zeros and just write 31 random bits plus the 1 bit I care about?
Obviously I can gather the bits together into a 32 bit word and write it in one go, but that will involve the CPU. If I can write bits, or even just bytes, with DMA, it will improve performance considerably.
Solved! Go to Solution.
2025-10-03 5:53 AM
Hello @qua,
Data swapping is essential for managing endianness and ensuring that the memory data format aligns with the cryptographic hardware's requirements. This alignment is critical for correct encryption, decryption, and tag generation. In byte mode, it rearranges the order of bytes to ensure proper alignment, particularly in AES operations where the hardware processes 32-bit words. Proper padding and alignment are critical to avoid errors and maintain data integrity during cryptographic operations.
Best regards,
2025-10-03 5:53 AM
Hello @qua,
Data swapping is essential for managing endianness and ensuring that the memory data format aligns with the cryptographic hardware's requirements. This alignment is critical for correct encryption, decryption, and tag generation. In byte mode, it rearranges the order of bytes to ensure proper alignment, particularly in AES operations where the hardware processes 32-bit words. Proper padding and alignment are critical to avoid errors and maintain data integrity during cryptographic operations.
Best regards,
2025-10-03 6:02 AM
Thanks, but if it's endianess what is the bit level swapping and zero padding for?
2025-10-03 6:27 AM - edited 2025-10-03 6:27 AM
2025-10-03 6:51 AM
So basically
- Bit level swapping is if you reversed the bit order on a parallel bus to make routing easier.
- Zero padding is so you don't have to manually zero the bits, e.g. if you want to DMA data directly into the FIFO.
Is that a reasonable summary?
2025-10-03 6:57 AM
Yes it is.