Refactor the common reading bits from the rekey protocol