There are several cheap radio modules (nRF24L01 for example) that are only capable of transmitting a 32 byte packets. That is too small for including a HMAC computed with any modern protocol and an IV. Now, I've read that it is possible to send authentication data in one packet and the data itself in a subsequent packets, however in some radio modules it is possible to receive packets from other nodes in between the correct packets, so it looks like some sort of authentication is needed in every packet.
Is there a protocol or a library for that kind of communication?
I've tried to reduce the MTU of my wireguard VPN to 32 and it worked, but i am not sure if it is 32 bytes of data or 32 bytes per whole packet.
I've tried to reduce the MTU of my wireguard VPN to 32 and it worked, but i am not sure if it is 32 bytes of data or 32 bytes per whole packet.
If that's working, that's probably completely fine. The MTU is how many bytes get sent in the packet. As long as there is a way to reassemble the packets in the right order and detect missing packets, then it doesn't matter what the MTU is (within some limits; obviously a single byte MTU is going to be a problem). In your example of an appended HMAC, it doesn't have to fit in a single packet. I've sent secured messages of arbitrary length over Bluetooth in 20 byte chunks.
If you want something convenient, your wireguard solution is probably fine, or consider something like nerfnet which will give you standard TCP, which you can perform TLS over. The whole point of a protocol like TCP is to provide reliable communication over an unreliable transport, with the illusion of a "stream" that is really just "chunks of bytes no larger than the MTU."