Lines Matching refs:pME

63 …UNK_T* gs_mont_add(BNU_CHUNK_T* pr, const BNU_CHUNK_T* pa, const BNU_CHUNK_T* pb, gsModEngine* pME)  in gs_mont_add()  argument
65 const BNU_CHUNK_T* pm = MOD_MODULUS(pME); in gs_mont_add()
66 int mLen = MOD_LEN(pME); in gs_mont_add()
69 BNU_CHUNK_T* pBuffer = gsModPoolAlloc(pME, polLength); in gs_mont_add()
76 gsModPoolFree(pME, polLength); in gs_mont_add()
88 …UNK_T* gs_mont_sub(BNU_CHUNK_T* pr, const BNU_CHUNK_T* pa, const BNU_CHUNK_T* pb, gsModEngine* pME) in gs_mont_sub() argument
90 const BNU_CHUNK_T* pm = MOD_MODULUS(pME); in gs_mont_sub()
91 int mLen = MOD_LEN(pME); in gs_mont_sub()
94 BNU_CHUNK_T* pBuffer = gsModPoolAlloc(pME, polLength); in gs_mont_sub()
101 gsModPoolFree(pME, polLength); in gs_mont_sub()
112 static BNU_CHUNK_T* gs_mont_neg(BNU_CHUNK_T* pr, const BNU_CHUNK_T* pa, gsModEngine* pME) in gs_mont_neg() argument
114 const BNU_CHUNK_T* pm = MOD_MODULUS(pME); in gs_mont_neg()
115 int mLen = MOD_LEN(pME); in gs_mont_neg()
118 BNU_CHUNK_T* pBuffer = gsModPoolAlloc(pME, polLength); in gs_mont_neg()
125 gsModPoolFree(pME, polLength); in gs_mont_neg()
136 static BNU_CHUNK_T* gs_mont_div2(BNU_CHUNK_T* pr, const BNU_CHUNK_T* pa, gsModEngine* pME) in gs_mont_div2() argument
138 const BNU_CHUNK_T* pm = MOD_MODULUS(pME); in gs_mont_div2()
139 int mLen = MOD_LEN(pME); in gs_mont_div2()
142 BNU_CHUNK_T* pBuffer = gsModPoolAlloc(pME, polLength); in gs_mont_div2()
154 gsModPoolFree(pME, polLength); in gs_mont_div2()
165 static BNU_CHUNK_T* gs_mont_mul2(BNU_CHUNK_T* pr, const BNU_CHUNK_T* pa, gsModEngine* pME) in gs_mont_mul2() argument
167 return gs_mont_add(pr, pa, pa, pME); in gs_mont_mul2()
177 static BNU_CHUNK_T* gs_mont_mul3(BNU_CHUNK_T* pr, const BNU_CHUNK_T* pa, gsModEngine* pME) in gs_mont_mul3() argument
180 BNU_CHUNK_T* pBuffer = gsModPoolAlloc(pME, polLength); in gs_mont_mul3()
183 gs_mont_add(pBuffer, pa, pa, pME); in gs_mont_mul3()
184 gs_mont_add(pr, pa, pBuffer, pME); in gs_mont_mul3()
186 gsModPoolFree(pME, polLength); in gs_mont_mul3()
198 static BNU_CHUNK_T* gs_mont_red(BNU_CHUNK_T* pr, BNU_CHUNK_T* prod, gsModEngine* pME) in gs_mont_red() argument
200 const BNU_CHUNK_T* pm = MOD_MODULUS(pME); in gs_mont_red()
201 BNU_CHUNK_T k0 = MOD_MNT_FACTOR(pME); in gs_mont_red()
202 int mLen = MOD_LEN(pME); in gs_mont_red()
238 static BNU_CHUNK_T* gs_mont_red(BNU_CHUNK_T* pr, BNU_CHUNK_T* prod, gsModEngine* pME) in gs_mont_red() argument
240 const BNU_CHUNK_T* pm = MOD_MODULUS(pME); in gs_mont_red()
241 BNU_CHUNK_T k0 = MOD_MNT_FACTOR(pME); in gs_mont_red()
242 int mLen = MOD_LEN(pME); in gs_mont_red()
250 static BNU_CHUNK_T* gs_mont_redX(BNU_CHUNK_T* pr, BNU_CHUNK_T* prod, gsModEngine* pME) in gs_mont_redX() argument
252 const BNU_CHUNK_T* pm = MOD_MODULUS(pME); in gs_mont_redX()
253 BNU_CHUNK_T k0 = MOD_MNT_FACTOR(pME); in gs_mont_redX()
254 int mLen = MOD_LEN(pME); in gs_mont_redX()
274 …UNK_T* gs_mont_mul(BNU_CHUNK_T* pr, const BNU_CHUNK_T* pa, const BNU_CHUNK_T* pb, gsModEngine* pME) in gs_mont_mul() argument
276 const BNU_CHUNK_T* pm = MOD_MODULUS(pME); in gs_mont_mul()
277 BNU_CHUNK_T m0 = MOD_MNT_FACTOR(pME); in gs_mont_mul()
278 int mLen = MOD_LEN(pME); in gs_mont_mul()
281 BNU_CHUNK_T* pBuffer = gsModPoolAlloc(pME, polLength); in gs_mont_mul()
333 gsModPoolFree(pME, polLength); in gs_mont_mul()
339 …UNK_T* gs_mont_mul(BNU_CHUNK_T* pr, const BNU_CHUNK_T* pa, const BNU_CHUNK_T* pb, gsModEngine* pME) in gs_mont_mul() argument
341 const BNU_CHUNK_T* pm = MOD_MODULUS(pME); in gs_mont_mul()
342 BNU_CHUNK_T m0 = MOD_MNT_FACTOR(pME); in gs_mont_mul()
343 int mLen = MOD_LEN(pME); in gs_mont_mul()
346 BNU_CHUNK_T* pProduct = gsModPoolAlloc(pME, polLength); in gs_mont_mul()
352 gsModPoolFree(pME, polLength); in gs_mont_mul()
357 …NK_T* gs_mont_mulX(BNU_CHUNK_T* pr, const BNU_CHUNK_T* pa, const BNU_CHUNK_T* pb, gsModEngine* pME) in gs_mont_mulX() argument
359 const BNU_CHUNK_T* pm = MOD_MODULUS(pME); in gs_mont_mulX()
360 BNU_CHUNK_T m0 = MOD_MNT_FACTOR(pME); in gs_mont_mulX()
361 int mLen = MOD_LEN(pME); in gs_mont_mulX()
364 BNU_CHUNK_T* pProduct = gsModPoolAlloc(pME, polLength); in gs_mont_mulX()
370 gsModPoolFree(pME, polLength); in gs_mont_mulX()
383 static BNU_CHUNK_T* gs_mont_sqr(BNU_CHUNK_T* pr, const BNU_CHUNK_T* pa, gsModEngine* pME) in gs_mont_sqr() argument
386 const BNU_CHUNK_T* pm = MOD_MODULUS(pME); in gs_mont_sqr()
387 BNU_CHUNK_T m0 = MOD_MNT_FACTOR(pME); in gs_mont_sqr()
388 int mLen = MOD_LEN(pME); in gs_mont_sqr()
391 BNU_CHUNK_T* pProduct = gsModPoolAlloc(pME, polLength); in gs_mont_sqr()
397 gsModPoolFree(pME, polLength); in gs_mont_sqr()
402 static BNU_CHUNK_T* gs_mont_sqrX(BNU_CHUNK_T* pr, const BNU_CHUNK_T* pa, gsModEngine* pME) in gs_mont_sqrX() argument
404 const BNU_CHUNK_T* pm = MOD_MODULUS(pME); in gs_mont_sqrX()
405 BNU_CHUNK_T m0 = MOD_MNT_FACTOR(pME); in gs_mont_sqrX()
406 int mLen = MOD_LEN(pME); in gs_mont_sqrX()
409 BNU_CHUNK_T* pProduct = gsModPoolAlloc(pME, polLength); in gs_mont_sqrX()
415 gsModPoolFree(pME, polLength); in gs_mont_sqrX()
427 static BNU_CHUNK_T* gs_mont_encode(BNU_CHUNK_T* pr, const BNU_CHUNK_T* pa, gsModEngine* pME) in gs_mont_encode() argument
430 const BNU_CHUNK_T* pm = MOD_MODULUS(pME); in gs_mont_encode()
431 BNU_CHUNK_T m0 = MOD_MNT_FACTOR(pME); in gs_mont_encode()
432 int mLen = MOD_LEN(pME); in gs_mont_encode()
435 BNU_CHUNK_T* pProduct = gsModPoolAlloc(pME, polLength); in gs_mont_encode()
438 cpMulAdc_BNU_school(pProduct, pa,mLen, MOD_MNT_R2(pME),mLen); in gs_mont_encode()
441 gsModPoolFree(pME, polLength); in gs_mont_encode()
446 static BNU_CHUNK_T* gs_mont_encodeX(BNU_CHUNK_T* pr, const BNU_CHUNK_T* pa, gsModEngine* pME) in gs_mont_encodeX() argument
449 const BNU_CHUNK_T* pm = MOD_MODULUS(pME); in gs_mont_encodeX()
450 BNU_CHUNK_T m0 = MOD_MNT_FACTOR(pME); in gs_mont_encodeX()
451 int mLen = MOD_LEN(pME); in gs_mont_encodeX()
454 BNU_CHUNK_T* pProduct = gsModPoolAlloc(pME, polLength); in gs_mont_encodeX()
457 cpMulAdx_BNU_school(pProduct, pa,mLen, MOD_MNT_R2(pME),mLen); in gs_mont_encodeX()
460 gsModPoolFree(pME, polLength); in gs_mont_encodeX()
472 static BNU_CHUNK_T* gs_mont_decode(BNU_CHUNK_T* pr, const BNU_CHUNK_T* pa, gsModEngine* pME) in gs_mont_decode() argument
474 int mLen = MOD_LEN(pME); in gs_mont_decode()
477 BNU_CHUNK_T* pProduct = gsModPoolAlloc(pME, polLength); in gs_mont_decode()
481 cpMontRedAdc_BNU(pr, pProduct, MOD_MODULUS(pME), mLen, MOD_MNT_FACTOR(pME)); in gs_mont_decode()
483 gsModPoolFree(pME, polLength); in gs_mont_decode()
488 static BNU_CHUNK_T* gs_mont_decodeX(BNU_CHUNK_T* pr, const BNU_CHUNK_T* pa, gsModEngine* pME) in gs_mont_decodeX() argument
490 int mLen = MOD_LEN(pME); in gs_mont_decodeX()
493 BNU_CHUNK_T* pProduct = gsModPoolAlloc(pME, polLength); in gs_mont_decodeX()
497 cpMontRedAdx_BNU(pr, pProduct, MOD_MODULUS(pME), mLen, MOD_MNT_FACTOR(pME)); in gs_mont_decodeX()
499 gsModPoolFree(pME, polLength); in gs_mont_decodeX()