|
![](/i/fill.gif) |
Lars Rohwedder <rok### [at] gmx de> wrote:
> >>> Which value of Secret2 would allow the * (without overloading) to
> >>> reverse the value with a value of Inverse_of_secret2.
> >>
> >> if SECRET2 is be 123456789, its inverse is 16969517551553616445.
> >>
> >> It is just the "multiplicative inverse modulo 2^64".
> >>
> >> Note the arithmetics of unsigned integer data types is always
> >> "modulo" 2^BITSIZE of that data type.
> >
> > You use the crypto-version of the * operation (from Nist), not the
> > usual multiplication.
> No, it is just the integer multiplication that is done by nerly every
> common CPU, so the usual computer arithmetics. That is no crypto foo.
> Btw, the GCC translates integer divisions (with constant divisor) to
> "multiplications with the inverse element", because multiplications are
> faster than divisions on many CPUs.
Doesn't division via multiplication require a right-sift, though?
In other words, dividing an integer value by a constant can be done as
(value * x) >> y
where x and y are some magic integers calculated from the divisor?
Can it really be done with just a multiplication?
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |