@isislovecruft and @hdevalence notified me that AGL's Elligator code might be flawed and thus should not be used. We should follow up with them on the exact details. A good documentation for Elligator that could be used for a reimplementation is https://whispersystems.org/docs/specifications/xeddsa/#hashing-to-a-point-with-elligator-2.