If a wrong key is used to decrypt a message, the ESP crashes and restarts.
It seems that your library tries to access some part of the memory it shouldn't. I get this error:
Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.