Lines Matching full:carry
69 /* pre-computed tables are "carry-less" values of modulus*(i+1) */
84 0xFFFFFFFFFFFFFFFFULL,0x00000001FFFFFFFFULL} /* this one is "carry-full" */
359 int carry;
426 carry = (int)(acc>>32);
433 carry = (int)bn_add_words(r_d, r_d, t_d, BN_NIST_192_TOP);
435 carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_192_TOP);
437 carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_192_TOP);
440 if (carry > 0)
441 carry = (int)bn_sub_words(r_d,r_d,_nist_p_192[carry-1],BN_NIST_192_TOP);
443 carry = 1;
446 * we need 'if (carry==0 || result>=modulus) result-=modulus;'
448 * 'tmp=result-modulus; if (!carry || !borrow) result=tmp;'
452 mask &= 0-(PTR_SIZE_INT)carry;
480 int carry;
562 carry = (int)(acc>>32);
564 rp[7] = carry;
572 carry = (int)bn_add_words(r_d, r_d, t_d, BN_NIST_224_TOP);
574 carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_224_TOP);
576 carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_224_TOP);
578 carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_224_TOP);
581 carry = (int)(r_d[BN_NIST_224_TOP-1]>>32);
586 if (carry > 0)
588 carry = (int)bn_sub_words(r_d,r_d,_nist_p_224[carry-1],BN_NIST_224_TOP);
590 carry=(int)(~(r_d[BN_NIST_224_TOP-1]>>32))&1;
593 else if (carry < 0)
596 * if bn_add_words yields no carry, then result
601 carry = (int)bn_add_words(r_d,r_d,_nist_p_224[-carry-1],BN_NIST_224_TOP);
602 mask = 0-(PTR_SIZE_INT)carry;
607 carry = 1;
611 mask &= 0-(PTR_SIZE_INT)carry;
638 int carry = 0;
749 carry = (int)(acc>>32);
759 carry = (int)bn_add_words(t_d, t_d, c_d, BN_NIST_256_TOP);
771 carry <<= 1;
772 carry |= c;
774 carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_256_TOP);
777 carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_256_TOP);
780 carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_256_TOP);
783 carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_256_TOP);
786 carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_256_TOP);
789 carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_256_TOP);
792 carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_256_TOP);
798 if (carry > 0)
799 carry = (int)bn_sub_words(r_d,r_d,_nist_p_256[carry-1],BN_NIST_256_TOP);
800 else if (carry < 0)
802 carry = (int)bn_add_words(r_d,r_d,_nist_p_256[-carry-1],BN_NIST_256_TOP);
803 mask = 0-(PTR_SIZE_INT)carry;
808 carry = 1;
811 mask &= 0-(PTR_SIZE_INT)carry;
842 int carry = 0;
969 carry = (int)(acc>>32);
990 carry = (int)bn_add_words(r_d+(128/BN_BITS2), r_d+(128/BN_BITS2),
993 carry += (int)bn_add_words(r_d, r_d, buf.bn, BN_NIST_384_TOP);
996 carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_384_TOP);
999 carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_384_TOP);
1002 carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_384_TOP);
1005 carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_384_TOP);
1008 carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_384_TOP);
1011 carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_384_TOP);
1014 carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_384_TOP);
1020 if (carry > 0)
1021 carry = (int)bn_sub_words(r_d,r_d,_nist_p_384[carry-1],BN_NIST_384_TOP);
1022 else if (carry < 0)
1024 carry = (int)bn_add_words(r_d,r_d,_nist_p_384[-carry-1],BN_NIST_384_TOP);
1025 mask = 0-(PTR_SIZE_INT)carry;
1030 carry = 1;
1033 mask &= 0-(PTR_SIZE_INT)carry;