gpd and efs, rewritten on java