Optimized branch added, also the expanded key has been moved to shared memory