crypto: simplify protocol check