added constant time compare function to compare signs