Displaying 6 results from an estimated 6 matches for "mp_rand_n".
2010 Jun 13
2
[LLVMdev] Bignum development
...uint128_t v = (__uint128_t) a[0] + b[0];
> r[0] = (ul) v;
> cy = v >> 64;
>
> for (i = 1; i < n; i++) {
> __uint128_t u = (__uint128_t) a[i] + b[i] + cy;
> r[i] = (ul) u;
> cy = u >> BITS;
> }
>
> return cy;
> }
>
> void mp_rand_n(mp_dst r, mp_size n)
> {
> mp_size i;
>
> for (i = 0; i < n; i++)
> r[i] = ul_randlimb();
> }
>
> int main(void)
> {
>
> mp_ptr a, b, c;
> ul i;
>
> a = mp_init(1000);
> b = mp_init(1000);
> c = mp_init(1000);
>
> mp_rand...
2010 Jun 12
0
[LLVMdev] Bignum development
...src b, mp_size n)
{
long i;
ul cy;
const __uint128_t v = (__uint128_t) a[0] + b[0];
r[0] = (ul) v;
cy = v >> 64;
for (i = 1; i < n; i++) {
__uint128_t u = (__uint128_t) a[i] + b[i] + cy;
r[i] = (ul) u;
cy = u >> BITS;
}
return cy;
}
void mp_rand_n(mp_dst r, mp_size n)
{
mp_size i;
for (i = 0; i < n; i++)
r[i] = ul_randlimb();
}
int main(void)
{
mp_ptr a, b, c;
ul i;
a = mp_init(1000);
b = mp_init(1000);
c = mp_init(1000);
mp_rand_n(a, 1000);
mp_rand_n(b, 1000);
for (i = 0; i < 2400000; i++)...
2010 Jun 13
0
[LLVMdev] Bignum development
...] = (ul) v;
>> cy = v >> 64;
>>
>> for (i = 1; i < n; i++) {
>> __uint128_t u = (__uint128_t) a[i] + b[i] + cy;
>> r[i] = (ul) u;
>> cy = u >> BITS;
>> }
>>
>> return cy;
>> }
>>
>> void mp_rand_n(mp_dst r, mp_size n)
>> {
>> mp_size i;
>>
>> for (i = 0; i < n; i++)
>> r[i] = ul_randlimb();
>> }
>>
>> int main(void)
>> {
>>
>> mp_ptr a, b, c;
>> ul i;
>>
>> a = mp_init(1000);
>>...
2010 Jun 13
2
[LLVMdev] Bignum development
...;
>>>
>>> for (i = 1; i < n; i++) {
>>> __uint128_t u = (__uint128_t) a[i] + b[i] + cy;
>>> r[i] = (ul) u;
>>> cy = u >> BITS;
>>> }
>>>
>>> return cy;
>>> }
>>>
>>> void mp_rand_n(mp_dst r, mp_size n)
>>> {
>>> mp_size i;
>>>
>>> for (i = 0; i < n; i++)
>>> r[i] = ul_randlimb();
>>> }
>>>
>>> int main(void)
>>> {
>>>
>>> mp_ptr a, b, c;
>>> ul i;
>&g...
2010 Jun 11
3
[LLVMdev] Bignum development
On Fri, Jun 11, 2010 at 3:28 PM, Bill Hart <goodwillhart at googlemail.com> wrote:
> Hi Eli,
>
> On 11 June 2010 22:44, Eli Friedman <eli.friedman at gmail.com> wrote:
>> On Fri, Jun 11, 2010 at 10:37 AM, Bill Hart <goodwillhart at googlemail.com> wrote:
>>> a) What plans are there to support addition, subtraction,
>>> multiplication, division,
2010 Jun 11
4
[LLVMdev] Bignum development
Hi all,
After searching for a decent compiler backend for ages (google
sometimes isn't helpful), I recently stumbled upon LLVM. Woot!!
I work on bignum arithmetic (I'm a professional mathematician) and
have recently decided to switch from developing GPL'd bignum code to
BSD licensed code. (See http://www.mpir.org/ which I contributed to
for a while - a fork of GMP).
Please bear with