The Porsche and Subaru engines are just boxer engines and Porsche and Subaru use both boxer engines in their cars.
The boxer engine is just a flat engine which has horizontally opposed cylinders and pistons.
So yes Subaru and Porsche makes there own Porsche and Subaru engines for use in both the Subaru or Porsche Cars.
Most car manufacturers do make their own engines for their vehicles such as GM making their own engines for Chevy and GM vehicles.
If you look on the engine block somewhere there should be a stamped marking in the engine stating if the engine was made by Subaru or Porsche.