Implement step 2 in jpake exchange, some add. restructuring.