The cohomology of Massey-Peterson algebras