A provably secure secret handshake with controlled matching