complete GCM implementation