implementation of the GCM