make the aead work a bit more generic (#3761)

2 files changed