This is what the C code does, see egg/egg-dh.c:340. https://bugzilla.gnome.org/show_bug.cgi?id=768112