Home | History | Annotate | Download | only in mtest

Lines Matching refs:MP_OKAY

96   "boolean true",            /* MP_OKAY, MP_YES      */
232 Initialize a new zero-valued mp_int. Returns MP_OKAY if successful,
254 if((res = mp_init(&mp[pos])) != MP_OKAY)
258 return MP_OKAY;
276 precision; returns MP_OKAY if successful, or MP_MEM if memory could
291 return MP_OKAY;
302 Initialize mp as an exact copy of from. Returns MP_OKAY if
312 return MP_OKAY;
322 return MP_OKAY;
343 return MP_OKAY;
381 return MP_OKAY;
502 return MP_OKAY; /* shortcut for zero */
506 if((res = s_mp_mul_2d(mp, CHAR_BIT)) != MP_OKAY)
511 if(res != MP_OKAY)
519 return MP_OKAY;
539 mp_err res = MP_OKAY;
543 if((res = mp_copy(a, b)) != MP_OKAY)
577 if((res = mp_copy(a, b)) != MP_OKAY)
581 if((res = s_mp_add_d(b, d)) != MP_OKAY)
585 if((res = s_mp_sub_d(b, d)) != MP_OKAY)
598 return MP_OKAY;
621 return MP_OKAY;
624 if((res = mp_copy(a, b)) != MP_OKAY)
643 if((res = mp_copy(a, c)) != MP_OKAY)
688 return MP_OKAY;
702 if((res = mp_copy(a, q)) != MP_OKAY)
712 if((res = mp_init_copy(&qp, a)) != MP_OKAY)
745 if((res = mp_copy(a, c)) != MP_OKAY)
750 return MP_OKAY;
765 if((res = mp_init(&s)) != MP_OKAY)
767 if((res = mp_init_copy(&x, a)) != MP_OKAY)
774 if((res = s_mp_mul(&s, &x)) != MP_OKAY)
780 if((res = s_mp_sqr(&x)) != MP_OKAY)
816 if((res = mp_copy(a, b)) != MP_OKAY)
821 return MP_OKAY;
841 if((res = mp_copy(a, b)) != MP_OKAY)
849 return MP_OKAY;
877 if((res = s_mp_add(c, a)) != MP_OKAY)
880 if(c != a && (res = mp_copy(a, c)) != MP_OKAY)
883 if((res = s_mp_add(c, b)) != MP_OKAY)
896 if((res = mp_init_copy(&tmp, a)) != MP_OKAY)
898 if((res = s_mp_sub(&tmp, b)) != MP_OKAY) {
908 if(c != a && (res = mp_copy(a, c)) != MP_OKAY)
910 if((res = s_mp_sub(c, b)) != MP_OKAY)
918 return MP_OKAY;
926 if((res = mp_init_copy(&tmp, b)) != MP_OKAY)
928 if((res = s_mp_sub(&tmp, a)) != MP_OKAY) {
938 if(c != b && (res = mp_copy(b, c)) != MP_OKAY)
940 if((res = s_mp_sub(c, a)) != MP_OKAY)
949 return MP_OKAY;
972 if((res = s_mp_add(c, b)) != MP_OKAY)
975 if(c != b && ((res = mp_copy(b, c)) != MP_OKAY))
977 if((res = s_mp_add(c, a)) != MP_OKAY)
986 if((res = mp_init_copy(&tmp, a)) != MP_OKAY)
988 if((res = s_mp_sub(&tmp, b)) != MP_OKAY) {
996 if(c != a && ((res = mp_copy(a, c)) != MP_OKAY))
999 if((res = s_mp_sub(c, b)) != MP_OKAY)
1005 return MP_OKAY;
1011 if((res = mp_init_copy(&tmp, b)) != MP_OKAY)
1014 if((res = s_mp_sub(&tmp, a)) != MP_OKAY) {
1022 if(c != b && ((res = mp_copy(b, c)) != MP_OKAY))
1025 if((res = s_mp_sub(c, a)) != MP_OKAY)
1035 return MP_OKAY;
1059 if((res = s_mp_mul(c, a)) != MP_OKAY)
1063 if((res = mp_copy(a, c)) != MP_OKAY)
1066 if((res = s_mp_mul(c, b)) != MP_OKAY)
1075 return MP_OKAY;
1095 if((res = mp_copy(a, c)) != MP_OKAY)
1099 return MP_OKAY;
1116 if((res = mp_copy(a, b)) != MP_OKAY)
1119 if((res = s_mp_sqr(b)) != MP_OKAY)
1124 return MP_OKAY;
1159 if((res = mp_copy(a, r)) != MP_OKAY)
1166 return MP_OKAY;
1182 return MP_OKAY;
1188 if((res = mp_init_copy(&qtmp, a)) != MP_OKAY)
1190 if((res = mp_init_copy(&rtmp, b)) != MP_OKAY)
1193 if((res = s_mp_div(&qtmp, &rtmp)) != MP_OKAY)
1234 if((res = mp_copy(a, q)) != MP_OKAY)
1241 if((res = mp_copy(a, r)) != MP_OKAY)
1247 return MP_OKAY;
1274 if((res = mp_init(&s)) != MP_OKAY)
1279 if((res = mp_init_copy(&x, a)) != MP_OKAY)
1289 if((res = s_mp_mul(&s, &x)) != MP_OKAY)
1295 if((res = s_mp_sqr(&x)) != MP_OKAY)
1305 if((res = s_mp_mul(&s, &x)) != MP_OKAY)
1311 if((res = s_mp_sqr(&x)) != MP_OKAY)
1377 if((res = mp_div(a, m, NULL, c)) != MP_OKAY)
1381 if((res = mp_add(c, m, c)) != MP_OKAY)
1386 if((res = mp_copy(a, c)) != MP_OKAY)
1390 if((res = mp_add(c, m, c)) != MP_OKAY)
1400 return MP_OKAY;
1421 if((res = mp_div_d(a, d, NULL, &rem)) != MP_OKAY)
1434 return MP_OKAY;
1471 if((res = mp_init_size(&t, USED(a))) != MP_OKAY)
1475 if((res = mp_init_copy(&x, a)) != MP_OKAY)
1484 if((res = mp_sqr(&t, &t)) != MP_OKAY ||
1485 (res = mp_sub(&t, a, &t)) != MP_OKAY)
1490 if((res = mp_div(&t, &x, &t, NULL)) != MP_OKAY)
1499 if((res = mp_sub(&x, &t, &x)) != MP_OKAY)
1539 if((res = mp_add(a, b, c)) != MP_OKAY)
1541 if((res = mp_mod(c, m, c)) != MP_OKAY)
1544 return MP_OKAY;
1564 if((res = mp_sub(a, b, c)) != MP_OKAY)
1566 if((res = mp_mod(c, m, c)) != MP_OKAY)
1569 return MP_OKAY;
1589 if((res = mp_mul(a, b, c)) != MP_OKAY)
1591 if((res = mp_mod(c, m, c)) != MP_OKAY)
1594 return MP_OKAY;
1609 if((res = mp_sqr(a, c)) != MP_OKAY
1611 if((res = mp_mod(c, m, c)) != MP_OKAY)
1614 return MP_OKAY;
1647 if((res = mp_init(&s)) != MP_OKAY)
1649 if((res = mp_init_copy(&x, a)) != MP_OKAY)
1651 if((res = mp_mod(&x, m, &x)) != MP_OKAY ||
1652 (res = mp_init(&mu)) != MP_OKAY)
1660 if((res = mp_div(&mu, m, &mu, NULL)) != MP_OKAY)
1670 if((res = s_mp_mul(&s, &x)) != MP_OKAY)
1672 if((res = s_mp_reduce(&s, m, &mu)) != MP_OKAY)
1678 if((res = s_mp_sqr(&x)) != MP_OKAY)
1680 if((res = s_mp_reduce(&x, m, &mu)) != MP_OKAY)
1690 if((res = s_mp_mul(&s, &x)) != MP_OKAY)
1692 if((res = s_mp_reduce(&s, m, &mu)) != MP_OKAY)
1698 if((res = s_mp_sqr(&x)) != MP_OKAY)
1700 if((res = s_mp_reduce(&x, m, &mu)) != MP_OKAY)
1728 if((res = mp_init(&s)) != MP_OKAY)
1730 if((res = mp_init_copy(&x, a)) != MP_OKAY)
1737 if((res = s_mp_mul(&s, &x)) != MP_OKAY ||
1738 (res = mp_mod(&s, m, &s)) != MP_OKAY)
1744 if((res = s_mp_sqr(&x)) != MP_OKAY ||
1745 (res = mp_mod(&x, m, &x)) != MP_OKAY)
1935 if((res = mp_init(&t)) != MP_OKAY)
1937 if((res = mp_init_copy(&u, a)) != MP_OKAY)
1939 if((res = mp_init_copy(&v, b)) != MP_OKAY)
1954 if((res = mp_copy(&v, &t)) != MP_OKAY)
1964 if((res = mp_copy(&u, &t)) != MP_OKAY)
1975 if((res = mp_copy(&t, &u)) != MP_OKAY)
1979 if((res = mp_copy(&t, &v)) != MP_OKAY)
1989 if((res = mp_sub(&u, &v, &t)) != MP_OKAY)
2029 if((res = mp_init(&gcd)) != MP_OKAY)
2031 if((res = mp_init(&prod)) != MP_OKAY)
2034 if((res = mp_mul(a, b, &prod)) != MP_OKAY)
2036 if((res = mp_gcd(a, b, &gcd)) != MP_OKAY)
2073 if((res = mp_init(&u)) != MP_OKAY) goto CLEANUP;
2075 if((res = mp_init(&v)) != MP_OKAY) goto CLEANUP;
2077 if((res = mp_init(&gx)) != MP_OKAY) goto CLEANUP;
2079 if((res = mp_init(&A)) != MP_OKAY) goto CLEANUP;
2081 if((res = mp_init(&B)) != MP_OKAY) goto CLEANUP;
2083 if((res = mp_init(&C)) != MP_OKAY) goto CLEANUP;
2085 if((res = mp_init(&D)) != MP_OKAY) goto CLEANUP;
2087 if((res = mp_init_copy(&xc, a)) != MP_OKAY) goto CLEANUP;
2090 if((res = mp_init_copy(&yc, b)) != MP_OKAY) goto CLEANUP;
2100 if((res = s_mp_mul_2(&gx)) != MP_OKAY)
2116 if((res = mp_add(&A, &yc, &A)) != MP_OKAY) goto CLEANUP;
2118 if((res = mp_sub(&B, &xc, &B)) != MP_OKAY) goto CLEANUP;
2129 if((res = mp_add(&C, &yc, &C)) != MP_OKAY) goto CLEANUP;
2131 if((res = mp_sub(&D, &xc, &D)) != MP_OKAY) goto CLEANUP;
2137 if((res = mp_sub(&u, &v, &u)) != MP_OKAY) goto CLEANUP;
2138 if((res = mp_sub(&A, &C, &A)) != MP_OKAY) goto CLEANUP;
2139 if((res = mp_sub(&B, &D, &B)) != MP_OKAY) goto CLEANUP;
2142 if((res = mp_sub(&v, &u, &v)) != MP_OKAY) goto CLEANUP;
2143 if((res = mp_sub(&C, &A, &C)) != MP_OKAY) goto CLEANUP;
2144 if((res = mp_sub(&D, &B, &D)) != MP_OKAY) goto CLEANUP;
2151 if((res = mp_copy(&C, x)) != MP_OKAY) goto CLEANUP;
2154 if((res = mp_copy(&D, y)) != MP_OKAY) goto CLEANUP;
2157 if((res = mp_mul(&gx, &v, g)) != MP_OKAY) goto CLEANUP;
2193 if((res = mp_init(&g)) != MP_OKAY)
2195 if((res = mp_init(&x)) != MP_OKAY)
2198 if((res = mp_xgcd(a, m, &g, &x, NULL)) != MP_OKAY)
2270 if((res = mp_read_unsigned_bin(mp, str + 1, len - 1)) == MP_OKAY) {
2329 if((res = s_mp_mul_2d(mp, CHAR_BIT)) != MP_OKAY)
2332 if((res = mp_add_d(mp, str[ix], mp)) != MP_OKAY)
2336 return MP_OKAY;
2385 return MP_OKAY;
2419 return MP_OKAY;
2487 if((res = s_mp_mul_d(mp, radix)) != MP_OKAY)
2489 if((res = s_mp_add_d(mp, val)) != MP_OKAY)
2499 return MP_OKAY;
2561 if((res = mp_init_copy(&tmp, mp)) != MP_OKAY)
2569 if((res = s_mp_div_d(&tmp, rdx, &rem)) != MP_OKAY) {
2601 return MP_OKAY;
2635 if(ec < MP_LAST_CODE || ec > MP_OKAY) {
2675 return MP_OKAY;
2690 if(min > ALLOC(mp) && (res = s_mp_grow(mp, min)) != MP_OKAY)
2697 return MP_OKAY;
2823 return MP_OKAY;
2825 if((res = s_mp_pad(mp, USED(mp) + p)) != MP_OKAY)
2839 return MP_OKAY;
2916 if((res = s_mp_grow(mp, ALLOC(mp) + 1)) != MP_OKAY)
2925 return MP_OKAY;
2975 if((res = s_mp_lshd(mp, d / DIGIT_BIT)) != MP_OKAY)
2986 if((res = s_mp_grow(mp, used + 1)) != MP_OKAY)
3008 return MP_OKAY;
3108 if((res = s_mp_pad(mp, USED(mp) + 1)) != MP_OKAY)
3114 return MP_OKAY;
3149 return MP_OKAY;
3176 if((res = s_mp_pad(a, max + 1)) != MP_OKAY)
3197 return MP_OKAY;
3224 if((res = mp_init_size(&quot, USED(mp))) != MP_OKAY)
3252 return MP_OKAY;
3273 if((used > USED(a)) && (res = s_mp_pad(a, used)) != MP_OKAY)
3307 if((res = s_mp_pad(a, used + 1)) != MP_OKAY)
3313 return MP_OKAY;
3362 return MP_OKAY;
3374 if((res = mp_init_copy(&q, x)) != MP_OKAY)
3393 if((res = mp_sub(x, &q, x)) != MP_OKAY)
3399 if((res = s_mp_lshd(&q, um + 1)) != MP_OKAY)
3401 if((res = mp_add(x, &q, x)) != MP_OKAY)
3407 if((res = s_mp_sub(x, m)) != MP_OKAY)
3431 if((res = mp_init_size(&tmp, ua + ub)) != MP_OKAY)
3465 return MP_OKAY;
3519 if((res = mp_init_size(&tmp, 2 * used)) != MP_OKAY)
3611 return MP_OKAY;
3643 return MP_OKAY;
3647 if((res = mp_init_size(&quot, USED(a))) != MP_OKAY)
3651 if((res = mp_init_size(&t, USED(a))) != MP_OKAY)
3655 if((res = mp_init_size(&rem, USED(a))) != MP_OKAY)
3667 if((res = s_mp_lshd(&rem, 1)) != MP_OKAY)
3670 if((res = s_mp_lshd(&quot, 1)) != MP_OKAY)
3695 if((res = s_mp_mul_d(&t, q)) != MP_OKAY)
3710 if((res = s_mp_sub(&rem, &t)) != MP_OKAY)
3758 if((res = s_mp_pad(a, dig + 1)) != MP_OKAY)
3763 return MP_OKAY;