Trying to get an intuition about the hashing that Monero is doing.
Let P represent a point on the Ed25519 curve that's also a part of the group.
Let H represent a hash function.
Let E(P) be the function that encodes P into a 32-byte repesentation.
Let D(b) be the function that decodes a 32-byte representation to a point on the curve.
The Monero source code for hash_to_ec function, which maps an Ed25519 Point to another Ed25519 Point does something like this:
H_p(P) = 8*D(H(E(P)))
Why the 8?
Also, the derivation_to_scalar function, which maps an Ed25519 Point to a scalar does something like this:
H_s(P) = H(H(8*E(P)) || output_index)
see https://github.com/monero-project/monero/blob/1a4298685aa9e694bc555ae69be59d14d3790465/src/crypto/crypto.cpp#L139 and https://github.com/monero-project/monero/blob/1a4298685aa9e694bc555ae69be59d14d3790465/src/crypto/crypto.cpp#L154
I can understand concatenating the output_index, but I don't understand why the multiply by 8 is there.
Can someone shed light on either/both of these constructions? The only guess I have is that somehow, multiplying by 8 after hashing guarantees the resulting point is in the Group.