sign algorithm start