[en] This paper studies the impact of jamming on the design of three-node two-hop cooperative amplify-and-forward (AF) communications with both half-duplex and full-duplex relaying. For the half-duplex relaying, the jammer is smart such that it can optimally allocate jamming power between listening and forwarding phases. Given separate source and relay power constraints, we derive the optimal jamming power allocation; with a total source and relay power constraint, we model the interaction between the legitimate system and the jammer as a noncooperative game and prove the existence and uniqueness of the Nash Equilibrium (NE). It is found that due to the fact that the end performance is limited by the weaker phase, the legitimate systems tries to balance the performance of two phases while the jammer attacks the system by making the two hops imbalanced. While for the full-duplex relaying, we show that if the self-interference can be properly controlled, it can bring substantial performance gain. Simulation results verify our analysis.