add void as for other macros
move aes buffer
rename tmp variable to prevent nested reuse
additional debug output
use standard int types