removed use of memcpy inside ctr encryption