We can form a graph with $10$ vertices each representing a person. Since each one has exactly one adversary, it forms a $1-1$ correspondence among the $10$ people and excluding the adversaries we can draw $8$ outgoing edges for each of the $10$ vertices representing a given handshake. This will mean a total degree of $10 \times 8 = 80$ and corresponds to $80/2 = 40$ edges which represents $40$ distinct handshakes.