gstar and ghash implementation