Encoding scalar values to points on Ed25519
The problem may that ed25519-donna uses a decompression that inverts points. That's fixable, but from the description of the problem I think you might be mangling the point encoding somehow, and it isn't quite clear how.