Working aes in generator. But some memleaks.