changed table lookup macros to static functions
simplifying last round in encryption function