arnaucube
arnaucube/circomPublic Self-hosted repository
circom/c/buildasm/main.c
c/buildasm/main.cRaw
 1#include <stdio.h>
 2#include <stdlib.h>
 3#include "fr.h"
 4
 5int main() {
 6
 7    FrElement a = { 0, Fr_LONGMONTGOMERY, {1,1,1,1}};
 8    FrElement b = { 0, Fr_LONGMONTGOMERY, {2,2,2,2}};
 9
10/*
11    FrElement a={0x43e1f593f0000000ULL,0x2833e84879b97091ULL,0xb85045b68181585dULL,0x30644e72e131a029ULL};
12    FrElement b = {3,0,0,0};
13
14    FrElement c;
15*/
16//    Fr_add(&(c[0]), a, a);
17//    Fr_add(&(c[0]), c, b);
18
19/*
20    for (int i=0; i<1000000000; i++) {
21        Fr_mul(&c, &a, &b);
22    }
23
24    Fr_mul(&c,&a, &b);
25*/
26
27    FrElement a1[10];
28    FrElement a2[10];
29    for (int i=0; i<10; i++) {
30        a1[i].type = Fr_LONGMONTGOMERY;
31        a1[i].shortVal =0;
32        for (int j=0; j<Fr_N64; j++) {
33            a2[i].longVal[j] = i;
34        }
35    }
36
37    Fr_copyn(a2, a1, 10);
38
39    for (int i=0; i<10; i++) {
40        char *c1 = Fr_element2str(&a1[i]);
41        char *c2 = Fr_element2str(&a2[i]);
42        printf("%s\n%s\n\n", c1, c2);
43        free(c1);
44        free(c2);
45    }
46
47    // printf("%llu, %llu, %llu, %llu\n", c.longVal[0], c.longVal[1], c.longVal[2], c.longVal[3]);
48}