fix timing vulnerability in verify_gateway_signature

see https://en.wikipedia.org/wiki/Timing_attack
Merge pull request #3 from anfedorov/master

fix timing vulnerability in verify_gateway_signature