Skip to content

Commit 11739a1

Browse files
committed
Execute move.sh - Rename files from bn_* to match the function names.
* git blame <renamed-file> is not affected * git log --follow <renamed-file> can be used to show log across renames
1 parent 5f7c2bc commit 11739a1

File tree

152 files changed

+1626
-1692
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+1626
-1692
lines changed

demo/test.c

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,61 +1540,61 @@ static int test_mp_incr(void)
15401540
mp_err e = MP_OKAY;
15411541

15421542
if ((e = mp_init_multi(&a, &b, NULL)) != MP_OKAY) {
1543-
goto LTM_ERR;
1543+
goto LBL_ERR;
15441544
}
15451545

15461546
/* Does it increment inside the limits of a MP_xBIT limb? */
15471547
mp_set(&a, MP_MASK/2);
15481548
if ((e = mp_incr(&a)) != MP_OKAY) {
1549-
goto LTM_ERR;
1549+
goto LBL_ERR;
15501550
}
15511551
if (mp_cmp_d(&a, (MP_MASK/2uL) + 1uL) != MP_EQ) {
1552-
goto LTM_ERR;
1552+
goto LBL_ERR;
15531553
}
15541554

15551555
/* Does it increment outside of the limits of a MP_xBIT limb? */
15561556
mp_set(&a, MP_MASK);
15571557
mp_set(&b, MP_MASK);
15581558
if ((e = mp_incr(&a)) != MP_OKAY) {
1559-
goto LTM_ERR;
1559+
goto LBL_ERR;
15601560
}
15611561
if ((e = mp_add_d(&b, 1uL, &b)) != MP_OKAY) {
1562-
goto LTM_ERR;
1562+
goto LBL_ERR;
15631563
}
15641564
if (mp_cmp(&a, &b) != MP_EQ) {
1565-
goto LTM_ERR;
1565+
goto LBL_ERR;
15661566
}
15671567

15681568
/* Does it increment from -1 to 0? */
15691569
mp_set(&a, 1uL);
15701570
a.sign = MP_NEG;
15711571
if ((e = mp_incr(&a)) != MP_OKAY) {
1572-
goto LTM_ERR;
1572+
goto LBL_ERR;
15731573
}
15741574
if (mp_cmp_d(&a, 0uL) != MP_EQ) {
1575-
goto LTM_ERR;
1575+
goto LBL_ERR;
15761576
}
15771577

15781578
/* Does it increment from -(MP_MASK + 1) to -MP_MASK? */
15791579
mp_set(&a, MP_MASK);
15801580
if ((e = mp_add_d(&a, 1uL, &a)) != MP_OKAY) {
1581-
goto LTM_ERR;
1581+
goto LBL_ERR;
15821582
}
15831583
a.sign = MP_NEG;
15841584
if ((e = mp_incr(&a)) != MP_OKAY) {
1585-
goto LTM_ERR;
1585+
goto LBL_ERR;
15861586
}
15871587
if (a.sign != MP_NEG) {
1588-
goto LTM_ERR;
1588+
goto LBL_ERR;
15891589
}
15901590
a.sign = MP_ZPOS;
15911591
if (mp_cmp_d(&a, MP_MASK) != MP_EQ) {
1592-
goto LTM_ERR;
1592+
goto LBL_ERR;
15931593
}
15941594

15951595
mp_clear_multi(&a, &b, NULL);
15961596
return EXIT_SUCCESS;
1597-
LTM_ERR:
1597+
LBL_ERR:
15981598
mp_clear_multi(&a, &b, NULL);
15991599
return EXIT_FAILURE;
16001600
}
@@ -1605,42 +1605,42 @@ static int test_mp_decr(void)
16051605
mp_err e = MP_OKAY;
16061606

16071607
if ((e = mp_init_multi(&a, &b, NULL)) != MP_OKAY) {
1608-
goto LTM_ERR;
1608+
goto LBL_ERR;
16091609
}
16101610

16111611
/* Does it decrement inside the limits of a MP_xBIT limb? */
16121612
mp_set(&a, MP_MASK/2);
16131613
if ((e = mp_decr(&a)) != MP_OKAY) {
1614-
goto LTM_ERR;
1614+
goto LBL_ERR;
16151615
}
16161616
if (mp_cmp_d(&a, (MP_MASK/2uL) - 1uL) != MP_EQ) {
1617-
goto LTM_ERR;
1617+
goto LBL_ERR;
16181618
}
16191619

16201620
/* Does it decrement outside of the limits of a MP_xBIT limb? */
16211621
mp_set(&a, MP_MASK);
16221622
if ((e = mp_add_d(&a, 1uL, &a)) != MP_OKAY) {
1623-
goto LTM_ERR;
1623+
goto LBL_ERR;
16241624
}
16251625
if ((e = mp_decr(&a)) != MP_OKAY) {
1626-
goto LTM_ERR;
1626+
goto LBL_ERR;
16271627
}
16281628
if (mp_cmp_d(&a, MP_MASK) != MP_EQ) {
1629-
goto LTM_ERR;
1629+
goto LBL_ERR;
16301630
}
16311631

16321632
/* Does it decrement from 0 to -1? */
16331633
mp_zero(&a);
16341634
if ((e = mp_decr(&a)) != MP_OKAY) {
1635-
goto LTM_ERR;
1635+
goto LBL_ERR;
16361636
}
16371637
if (a.sign == MP_NEG) {
16381638
a.sign = MP_ZPOS;
16391639
if (mp_cmp_d(&a, 1uL) != MP_EQ) {
1640-
goto LTM_ERR;
1640+
goto LBL_ERR;
16411641
}
16421642
} else {
1643-
goto LTM_ERR;
1643+
goto LBL_ERR;
16441644
}
16451645

16461646

@@ -1650,18 +1650,18 @@ static int test_mp_decr(void)
16501650
mp_set(&b, MP_MASK);
16511651
b.sign = MP_NEG;
16521652
if ((e = mp_sub_d(&b, 1uL, &b)) != MP_OKAY) {
1653-
goto LTM_ERR;
1653+
goto LBL_ERR;
16541654
}
16551655
if ((e = mp_decr(&a)) != MP_OKAY) {
1656-
goto LTM_ERR;
1656+
goto LBL_ERR;
16571657
}
16581658
if (mp_cmp(&a, &b) != MP_EQ) {
1659-
goto LTM_ERR;
1659+
goto LBL_ERR;
16601660
}
16611661

16621662
mp_clear_multi(&a, &b, NULL);
16631663
return EXIT_SUCCESS;
1664-
LTM_ERR:
1664+
LBL_ERR:
16651665
mp_clear_multi(&a, &b, NULL);
16661666
return EXIT_FAILURE;
16671667
}
@@ -1895,13 +1895,13 @@ static int test_mp_n_root(void)
18951895
mp_read_radix(&r, root[i][j-3], 10);
18961896
if (mp_cmp(&r, &c) != MP_EQ) {
18971897
fprintf(stderr, "mp_n_root failed at input #%d, root #%d\n", i, j);
1898-
goto LTM_ERR;
1898+
goto LBL_ERR;
18991899
}
19001900
}
19011901
}
19021902
mp_clear_multi(&a, &c, &r, NULL);
19031903
return EXIT_SUCCESS;
1904-
LTM_ERR:
1904+
LBL_ERR:
19051905
mp_clear_multi(&a, &c, &r, NULL);
19061906
return EXIT_FAILURE;
19071907
}
@@ -1918,31 +1918,31 @@ static int test_s_mp_balance_mul(void)
19181918
"HzrSq9WVt1jDTVlwUxSKqxctu2GVD+N8+SVGaPFRqdxyld6IxDBbj27BPJzYUdR96k3sWpkO8XnDBvupGPnehpQe4KlO/KmN1PjFov/UTZYM+LYzkFcBPyV6hkkL8ePC1rlFLAHzgJMBCXVp4mRqtkQrDsZXXlcqlbTFu69wF6zDEysiX2cAtn/kP9ldblJiwYPCD8hG";
19191919

19201920
if ((e = mp_init_multi(&a, &b, &c, NULL)) != MP_OKAY) {
1921-
goto LTM_ERR;
1921+
goto LBL_ERR;
19221922
}
19231923

19241924
if ((e = mp_read_radix(&a, na, 64)) != MP_OKAY) {
1925-
goto LTM_ERR;
1925+
goto LBL_ERR;
19261926
}
19271927
if ((e = mp_read_radix(&b, nb, 64)) != MP_OKAY) {
1928-
goto LTM_ERR;
1928+
goto LBL_ERR;
19291929
}
19301930

19311931
if ((e = s_mp_balance_mul(&a, &b, &c)) != MP_OKAY) {
1932-
goto LTM_ERR;
1932+
goto LBL_ERR;
19331933
}
19341934

19351935
if ((e = mp_read_radix(&b, nc, 64)) != MP_OKAY) {
1936-
goto LTM_ERR;
1936+
goto LBL_ERR;
19371937
}
19381938

19391939
if (mp_cmp(&b, &c) != MP_EQ) {
1940-
goto LTM_ERR;
1940+
goto LBL_ERR;
19411941
}
19421942

19431943
mp_clear_multi(&a, &b, &c, NULL);
19441944
return EXIT_SUCCESS;
1945-
LTM_ERR:
1945+
LBL_ERR:
19461946
mp_clear_multi(&a, &b, &c, NULL);
19471947
return EXIT_FAILURE;
19481948
}
@@ -1954,30 +1954,30 @@ static int test_s_mp_karatsuba_mul(void)
19541954
int size, err;
19551955

19561956
if ((err = mp_init_multi(&a, &b, &c, &d, NULL)) != MP_OKAY) {
1957-
goto LTM_ERR;
1957+
goto LBL_ERR;
19581958
}
19591959
for (size = MP_KARATSUBA_MUL_CUTOFF; size < MP_KARATSUBA_MUL_CUTOFF + 20; size++) {
19601960
if ((err = mp_rand(&a, size)) != MP_OKAY) {
1961-
goto LTM_ERR;
1961+
goto LBL_ERR;
19621962
}
19631963
if ((err = mp_rand(&b, size)) != MP_OKAY) {
1964-
goto LTM_ERR;
1964+
goto LBL_ERR;
19651965
}
19661966
if ((err = s_mp_karatsuba_mul(&a, &b, &c)) != MP_OKAY) {
1967-
goto LTM_ERR;
1967+
goto LBL_ERR;
19681968
}
19691969
if ((err = s_mp_mul(&a,&b,&d)) != MP_OKAY) {
1970-
goto LTM_ERR;
1970+
goto LBL_ERR;
19711971
}
19721972
if (mp_cmp(&c, &d) != MP_EQ) {
19731973
fprintf(stderr, "Karatsuba multiplication failed at size %d\n", size);
1974-
goto LTM_ERR;
1974+
goto LBL_ERR;
19751975
}
19761976
}
19771977

19781978
mp_clear_multi(&a, &b, &c, &d, NULL);
19791979
return EXIT_SUCCESS;
1980-
LTM_ERR:
1980+
LBL_ERR:
19811981
mp_clear_multi(&a, &b, &c, &d, NULL);
19821982
return EXIT_FAILURE;
19831983
}
@@ -1988,27 +1988,27 @@ static int test_s_mp_karatsuba_sqr(void)
19881988
int size, err;
19891989

19901990
if ((err = mp_init_multi(&a, &b, &c, NULL)) != MP_OKAY) {
1991-
goto LTM_ERR;
1991+
goto LBL_ERR;
19921992
}
19931993
for (size = MP_KARATSUBA_SQR_CUTOFF; size < MP_KARATSUBA_SQR_CUTOFF + 20; size++) {
19941994
if ((err = mp_rand(&a, size)) != MP_OKAY) {
1995-
goto LTM_ERR;
1995+
goto LBL_ERR;
19961996
}
19971997
if ((err = s_mp_karatsuba_sqr(&a, &b)) != MP_OKAY) {
1998-
goto LTM_ERR;
1998+
goto LBL_ERR;
19991999
}
20002000
if ((err = s_mp_sqr(&a, &c)) != MP_OKAY) {
2001-
goto LTM_ERR;
2001+
goto LBL_ERR;
20022002
}
20032003
if (mp_cmp(&b, &c) != MP_EQ) {
20042004
fprintf(stderr, "Karatsuba squaring failed at size %d\n", size);
2005-
goto LTM_ERR;
2005+
goto LBL_ERR;
20062006
}
20072007
}
20082008

20092009
mp_clear_multi(&a, &b, &c, NULL);
20102010
return EXIT_SUCCESS;
2011-
LTM_ERR:
2011+
LBL_ERR:
20122012
mp_clear_multi(&a, &b, &c, NULL);
20132013
return EXIT_FAILURE;
20142014
}
@@ -2019,30 +2019,30 @@ static int test_s_mp_toom_mul(void)
20192019
int size, err;
20202020

20212021
if ((err = mp_init_multi(&a, &b, &c, &d, NULL)) != MP_OKAY) {
2022-
goto LTM_ERR;
2022+
goto LBL_ERR;
20232023
}
20242024
for (size = MP_TOOM_MUL_CUTOFF; size < MP_TOOM_MUL_CUTOFF + 20; size++) {
20252025
if ((err = mp_rand(&a, size)) != MP_OKAY) {
2026-
goto LTM_ERR;
2026+
goto LBL_ERR;
20272027
}
20282028
if ((err = mp_rand(&b, size)) != MP_OKAY) {
2029-
goto LTM_ERR;
2029+
goto LBL_ERR;
20302030
}
20312031
if ((err = s_mp_toom_mul(&a, &b, &c)) != MP_OKAY) {
2032-
goto LTM_ERR;
2032+
goto LBL_ERR;
20332033
}
20342034
if ((err = s_mp_mul(&a,&b,&d)) != MP_OKAY) {
2035-
goto LTM_ERR;
2035+
goto LBL_ERR;
20362036
}
20372037
if (mp_cmp(&c, &d) != MP_EQ) {
20382038
fprintf(stderr, "Toom-Cook 3-way multiplication failed at size %d\n", size);
2039-
goto LTM_ERR;
2039+
goto LBL_ERR;
20402040
}
20412041
}
20422042

20432043
mp_clear_multi(&a, &b, &c, &d, NULL);
20442044
return EXIT_SUCCESS;
2045-
LTM_ERR:
2045+
LBL_ERR:
20462046
mp_clear_multi(&a, &b, &c, &d, NULL);
20472047
return EXIT_FAILURE;
20482048
}
@@ -2053,27 +2053,27 @@ static int test_s_mp_toom_sqr(void)
20532053
int size, err;
20542054

20552055
if ((err = mp_init_multi(&a, &b, &c, NULL)) != MP_OKAY) {
2056-
goto LTM_ERR;
2056+
goto LBL_ERR;
20572057
}
20582058
for (size = MP_TOOM_SQR_CUTOFF; size < MP_TOOM_SQR_CUTOFF + 20; size++) {
20592059
if ((err = mp_rand(&a, size)) != MP_OKAY) {
2060-
goto LTM_ERR;
2060+
goto LBL_ERR;
20612061
}
20622062
if ((err = s_mp_toom_sqr(&a, &b)) != MP_OKAY) {
2063-
goto LTM_ERR;
2063+
goto LBL_ERR;
20642064
}
20652065
if ((err = s_mp_sqr(&a, &c)) != MP_OKAY) {
2066-
goto LTM_ERR;
2066+
goto LBL_ERR;
20672067
}
20682068
if (mp_cmp(&b, &c) != MP_EQ) {
20692069
fprintf(stderr, "Toom-Cook 3-way squaring failed at size %d\n", size);
2070-
goto LTM_ERR;
2070+
goto LBL_ERR;
20712071
}
20722072
}
20732073

20742074
mp_clear_multi(&a, &b, &c, NULL);
20752075
return EXIT_SUCCESS;
2076-
LTM_ERR:
2076+
LBL_ERR:
20772077
mp_clear_multi(&a, &b, &c, NULL);
20782078
return EXIT_FAILURE;
20792079
}

0 commit comments

Comments
 (0)