fixed issues with aes hw implementation