verify sign algorithm