[auto_group] Add public key optimization for encryption schemes