dh question

Brad Fitzpatrick brad at danga.com
Tue Jun 7 15:56:12 PDT 2005

On Tue, 7 Jun 2005, Paul Crowley wrote:

> Brad Fitzpatrick wrote:
> > When I run H() on gx^y mod p, what are the actual bytes I'm running H()
> > on?
> As far as cryptographic security goes, any of those are fine, so long as
> different integers always result in different inputs to H.  My
> preference for the map from integers to bytes is two's complement MSB,
> which Java uses and understands.  Since all our integers are positive,
> that just means adding a 0 byte at the start if the high bit is set.
> This map comes up twice, once for the hash function and once for the
> integer transit encoding (followed by Base64).

Which means it should be defined, right?  The different times this comes
up aren't purely implementor-only decisions... they affect the other

I'll go with 2's complement MSB, then, if you add it to the spec.  Unless
that's silly and we can ignore negative numbers.

I'm concerned where people's libraries may do one thing vs. another for
them and they might not have ways to change it?  No clue.

- Brad

More information about the yadis mailing list