fix DH.toPublic() and the Derive test