Lines Matching refs:A

108 static void setZero(uint32_t *A, const int length){  in setZero()  argument
109 memset(A, 0x0, length * sizeof(uint32_t)); in setZero()
119 static int isSame(const uint32_t *A, const uint32_t *B, uint8_t length){ in isSame() argument
120 return !memcmp(A, B, length * sizeof(uint32_t)); in isSame()
124 static int isGreater(const uint32_t *A, const uint32_t *B, uint8_t length){ in isGreater() argument
128 if(A[i] > B[i]) in isGreater()
130 if(A[i] < B[i]) in isGreater()
180 static void fieldModP(uint32_t *A, const uint32_t *B) in fieldModP() argument
188 copy(B,A,arrayLength); in fieldModP()
195 fieldAdd(A,tempm,ecc_prime_r,tempm2); in fieldModP()
197 fieldAdd(tempm2,tempm,ecc_prime_r,A); in fieldModP()
203 fieldAdd(A,tempm,ecc_prime_r,tempm2); in fieldModP()
205 fieldAdd(tempm2,tempm,ecc_prime_r,A); in fieldModP()
211 fieldAdd(A,tempm,ecc_prime_r,tempm2); in fieldModP()
218 fieldAdd(tempm2,tempm,ecc_prime_r,A); in fieldModP()
225 fieldSub(A,tempm,ecc_prime_m,tempm2); in fieldModP()
232 fieldSub(tempm2,tempm,ecc_prime_m,A); in fieldModP()
239 fieldSub(A,tempm,ecc_prime_m,tempm2); in fieldModP()
247 fieldSub(tempm2,tempm,ecc_prime_m,A); in fieldModP()
248 if(isGreater(A, ecc_prime_m, arrayLength) >= 0){ in fieldModP()
249 fieldSub(A, ecc_prime_m, ecc_prime_m, tempm); in fieldModP()
250 copy(tempm, A, arrayLength); in fieldModP()
271 static void fieldModO(const uint32_t *A, uint32_t *result, uint8_t length) { in fieldModO() argument
278 if (length == arrayLength && isGreater(A, ecc_order_m, arrayLength) <= 0) { in fieldModO()
279 if (A != result) in fieldModO()
280 copy(A, result, length); in fieldModO()
284 rshiftby(A, length, q1_q3, 9, ecc_order_k - 1); in fieldModO()
296 sub(A, q2_tmp, result, 9); in fieldModO()
302 static int isOne(const uint32_t* A){ in isOne() argument
305 if (A[n]!=0) in isOne()
308 if ((n==8)&&(A[0]==1)) in isOne()
314 static int isZero(const uint32_t* A){ in isZero() argument
317 if (A[n] == 0) r++; in isZero()
322 static void rshift(uint32_t* A){ in rshift() argument
327 n = A[i]&0x1; in rshift()
328 A[i] = A[i]>>1 | nOld<<31; in rshift()
353 static void fieldInv(const uint32_t *A, const uint32_t *modulus, const uint32_t *reducer, uint32_t … in fieldInv() argument
363 copy(A,u,arrayLength); in fieldInv()
661 void ecc_fieldModP(uint32_t *A, const uint32_t *B) in ecc_fieldModP() argument
663 fieldModP(A, B); in ecc_fieldModP()
665 void ecc_fieldModO(const uint32_t *A, uint32_t *result, uint8_t length) in ecc_fieldModO() argument
667 fieldModO(A, result, length); in ecc_fieldModO()
669 void ecc_fieldInv(const uint32_t *A, const uint32_t *modulus, const uint32_t *reducer, uint32_t *B) in ecc_fieldInv() argument
671 fieldInv(A, modulus, reducer, B); in ecc_fieldInv()
677 int ecc_isSame(const uint32_t *A, const uint32_t *B, uint8_t length) in ecc_isSame() argument
679 return isSame(A, B, length); in ecc_isSame()
681 void ecc_setZero(uint32_t *A, const int length) in ecc_setZero() argument
683 setZero(A, length); in ecc_setZero()
685 int ecc_isOne(const uint32_t* A) in ecc_isOne() argument
687 return isOne(A); in ecc_isOne()
689 void ecc_rshift(uint32_t* A) in ecc_rshift() argument
691 rshift(A); in ecc_rshift()
693 int ecc_isGreater(const uint32_t *A, const uint32_t *B, uint8_t length) in ecc_isGreater() argument
695 return isGreater(A, B , length); in ecc_isGreater()