"+" bug in mac_key?
Taral
taralx at gmail.com
Sun Aug 7 14:48:03 PDT 2005
On 8/7/05, meepbear * <meepbear at hotmail.com> wrote:
> >The code is something like:
> >
> >if (ord($a[0]) & 0x80) $a = "\x00" . $a;
> >
> >in a perl-like language. Don't bother converting to hex.
>
> The shared secret is the result of gmp_powm() which returns a resource. How
> do you go from resource->binary MAC without converting to a numeric string
> somewhere along the line?
PHP's GMP interface is apparently lacking. :P
Anyway, the code above works for after the ->binary conversion,
regardless of your underlying bigint implementation, if any. (Note
that servers that don't do DH don't do bigints, but still have to do
proper padding.)
--
Taral <taralx at gmail.com>
"Computer science is no more about computers than astronomy is about
telescopes."
-- Edsger Dijkstra
More information about the yadis
mailing list