A colorless all-optical scheme performing the subtraction and addition of phases between phase-shift keying (PSK) signals exploiting cascaded sum and difference frequency generation in a periodically poled lithium niobate waveguide is introduced and experimentally demonstrated. The subtraction of phases of two 40 Gb/s differential quadrature PSK signals has been experimentally tested and performances have been analyzed in terms of bit error rate measurements.