Lines Matching refs:length

43 static uint32_t add( const uint32_t *x, const uint32_t *y, uint32_t *result, uint8_t length){  in add()  argument
46 for(v = 0;v<length;v++){ in add()
57 static uint32_t sub( const uint32_t *x, const uint32_t *y, uint32_t *result, uint8_t length){ in sub() argument
60 for(v = 0;v < length; v++){ in sub()
108 static void setZero(uint32_t *A, const int length){ in setZero() argument
109 memset(A, 0x0, length * sizeof(uint32_t)); in setZero()
115 static void copy(const uint32_t *from, uint32_t *to, uint8_t length){ in copy() argument
116 memcpy(to, from, length * sizeof(uint32_t)); in copy()
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
126 for (i = length-1; i >= 0; --i) in isGreater()
159 static int fieldMult(const uint32_t *x, const uint32_t *y, uint32_t *result, uint8_t length){ in fieldMult() argument
160 uint32_t temp[length * 2]; in fieldMult()
161 setZero(temp, length * 2); in fieldMult()
162 setZero(result, length * 2); in fieldMult()
165 for (k = 0; k < length; k++){ in fieldMult()
166 for (n = 0; n < length; n++){ in fieldMult()
170 add(&temp[n+k], &result[n+k], &result[n+k], (length * 2) - (n + k)); in fieldMult()
172 setZero(temp, length * 2); in fieldMult()
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()
280 copy(A, result, length); in fieldModO()
284 rshiftby(A, length, q1_q3, 9, ecc_order_k - 1); in fieldModO()
641 uint32_t ecc_add( const uint32_t *x, const uint32_t *y, uint32_t *result, uint8_t length) in ecc_add() argument
643 return add(x, y, result, length); in ecc_add()
645 uint32_t ecc_sub( const uint32_t *x, const uint32_t *y, uint32_t *result, uint8_t length) in ecc_sub() argument
647 return sub(x, y, result, length); in ecc_sub()
657 int ecc_fieldMult(const uint32_t *x, const uint32_t *y, uint32_t *result, uint8_t length) in ecc_fieldMult() argument
659 return fieldMult(x, y, result, length); in ecc_fieldMult()
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()
673 void ecc_copy(const uint32_t *from, uint32_t *to, uint8_t length) in ecc_copy() argument
675 copy(from, to, length); in ecc_copy()
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()
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()