1

Providing working example for the essence of sc_reduce32 at Why is sc_reduce32 needed? created another question.

% echo deefd263cbfed62a3711dd133df3ccbd1c4dc4aac21d7405fd667498bf8ebaa1 | sc_reduce32 9ca838c2c31f1fbad7f030b68a3017ed1b4dc4aac21d7405fd667498bf8eba01

The command above is suffixed with the byte 0x01. Trying to understand what is the purpose of this byte? For the URL above, three major steps was used to compute the normalized private key from the curve order for either ed25519 or cv25519. Another person independently made a similar computation and concluded it was unclear what the traceability for the extra 8 byte.

skaht
  • 1,576
  • 11
  • 19

1 Answers1

3

All sc_reduce32 does is perform mod l where l = 7237005577332262213973186563042994240857116359379907606001950938285454250989. Byte sequences are little endian.

Your input deefd263cbfed62a3711dd133df3ccbd1c4dc4aac21d7405fd667498bf8ebaa1 is the number 73151987389341079160941681836269938279688779415452276994447379963081137516510, and 73151987389341079160941681836269938279688779415452276994447379963081137516510 mod 7237005577332262213973186563042994240857116359379907606001950938285454250989 is 781931616018457021209816205839995871117615821653200934427870580226595006620, which in little endian bytes is 9ca838c2c31f1fbad7f030b68a3017ed1b4dc4aac21d7405fd667498bf8eba01.

Your result is therefore correct. There are no 'extra' bytes. The input and output are both 32 byte sequences.

knaccc
  • 8,518
  • 17
  • 23