RF: better implementation of verify(), cross-platform