@@ -1501,61 +1501,61 @@ static int test_mp_incr(void)
1501
1501
mp_err e = MP_OKAY ;
1502
1502
1503
1503
if ((e = mp_init_multi (& a , & b , NULL )) != MP_OKAY ) {
1504
- goto LTM_ERR ;
1504
+ goto LBL_ERR ;
1505
1505
}
1506
1506
1507
1507
/* Does it increment inside the limits of a MP_xBIT limb? */
1508
1508
mp_set (& a , MP_MASK /2 );
1509
1509
if ((e = mp_incr (& a )) != MP_OKAY ) {
1510
- goto LTM_ERR ;
1510
+ goto LBL_ERR ;
1511
1511
}
1512
1512
if (mp_cmp_d (& a , (MP_MASK /2uL ) + 1uL ) != MP_EQ ) {
1513
- goto LTM_ERR ;
1513
+ goto LBL_ERR ;
1514
1514
}
1515
1515
1516
1516
/* Does it increment outside of the limits of a MP_xBIT limb? */
1517
1517
mp_set (& a , MP_MASK );
1518
1518
mp_set (& b , MP_MASK );
1519
1519
if ((e = mp_incr (& a )) != MP_OKAY ) {
1520
- goto LTM_ERR ;
1520
+ goto LBL_ERR ;
1521
1521
}
1522
1522
if ((e = mp_add_d (& b , 1uL , & b )) != MP_OKAY ) {
1523
- goto LTM_ERR ;
1523
+ goto LBL_ERR ;
1524
1524
}
1525
1525
if (mp_cmp (& a , & b ) != MP_EQ ) {
1526
- goto LTM_ERR ;
1526
+ goto LBL_ERR ;
1527
1527
}
1528
1528
1529
1529
/* Does it increment from -1 to 0? */
1530
1530
mp_set (& a , 1uL );
1531
1531
a .sign = MP_NEG ;
1532
1532
if ((e = mp_incr (& a )) != MP_OKAY ) {
1533
- goto LTM_ERR ;
1533
+ goto LBL_ERR ;
1534
1534
}
1535
1535
if (mp_cmp_d (& a , 0uL ) != MP_EQ ) {
1536
- goto LTM_ERR ;
1536
+ goto LBL_ERR ;
1537
1537
}
1538
1538
1539
1539
/* Does it increment from -(MP_MASK + 1) to -MP_MASK? */
1540
1540
mp_set (& a , MP_MASK );
1541
1541
if ((e = mp_add_d (& a , 1uL , & a )) != MP_OKAY ) {
1542
- goto LTM_ERR ;
1542
+ goto LBL_ERR ;
1543
1543
}
1544
1544
a .sign = MP_NEG ;
1545
1545
if ((e = mp_incr (& a )) != MP_OKAY ) {
1546
- goto LTM_ERR ;
1546
+ goto LBL_ERR ;
1547
1547
}
1548
1548
if (a .sign != MP_NEG ) {
1549
- goto LTM_ERR ;
1549
+ goto LBL_ERR ;
1550
1550
}
1551
1551
a .sign = MP_ZPOS ;
1552
1552
if (mp_cmp_d (& a , MP_MASK ) != MP_EQ ) {
1553
- goto LTM_ERR ;
1553
+ goto LBL_ERR ;
1554
1554
}
1555
1555
1556
1556
mp_clear_multi (& a , & b , NULL );
1557
1557
return EXIT_SUCCESS ;
1558
- LTM_ERR :
1558
+ LBL_ERR :
1559
1559
mp_clear_multi (& a , & b , NULL );
1560
1560
return EXIT_FAILURE ;
1561
1561
}
@@ -1566,42 +1566,42 @@ static int test_mp_decr(void)
1566
1566
mp_err e = MP_OKAY ;
1567
1567
1568
1568
if ((e = mp_init_multi (& a , & b , NULL )) != MP_OKAY ) {
1569
- goto LTM_ERR ;
1569
+ goto LBL_ERR ;
1570
1570
}
1571
1571
1572
1572
/* Does it decrement inside the limits of a MP_xBIT limb? */
1573
1573
mp_set (& a , MP_MASK /2 );
1574
1574
if ((e = mp_decr (& a )) != MP_OKAY ) {
1575
- goto LTM_ERR ;
1575
+ goto LBL_ERR ;
1576
1576
}
1577
1577
if (mp_cmp_d (& a , (MP_MASK /2uL ) - 1uL ) != MP_EQ ) {
1578
- goto LTM_ERR ;
1578
+ goto LBL_ERR ;
1579
1579
}
1580
1580
1581
1581
/* Does it decrement outside of the limits of a MP_xBIT limb? */
1582
1582
mp_set (& a , MP_MASK );
1583
1583
if ((e = mp_add_d (& a , 1uL , & a )) != MP_OKAY ) {
1584
- goto LTM_ERR ;
1584
+ goto LBL_ERR ;
1585
1585
}
1586
1586
if ((e = mp_decr (& a )) != MP_OKAY ) {
1587
- goto LTM_ERR ;
1587
+ goto LBL_ERR ;
1588
1588
}
1589
1589
if (mp_cmp_d (& a , MP_MASK ) != MP_EQ ) {
1590
- goto LTM_ERR ;
1590
+ goto LBL_ERR ;
1591
1591
}
1592
1592
1593
1593
/* Does it decrement from 0 to -1? */
1594
1594
mp_zero (& a );
1595
1595
if ((e = mp_decr (& a )) != MP_OKAY ) {
1596
- goto LTM_ERR ;
1596
+ goto LBL_ERR ;
1597
1597
}
1598
1598
if (a .sign == MP_NEG ) {
1599
1599
a .sign = MP_ZPOS ;
1600
1600
if (mp_cmp_d (& a , 1uL ) != MP_EQ ) {
1601
- goto LTM_ERR ;
1601
+ goto LBL_ERR ;
1602
1602
}
1603
1603
} else {
1604
- goto LTM_ERR ;
1604
+ goto LBL_ERR ;
1605
1605
}
1606
1606
1607
1607
@@ -1611,18 +1611,18 @@ static int test_mp_decr(void)
1611
1611
mp_set (& b , MP_MASK );
1612
1612
b .sign = MP_NEG ;
1613
1613
if ((e = mp_sub_d (& b , 1uL , & b )) != MP_OKAY ) {
1614
- goto LTM_ERR ;
1614
+ goto LBL_ERR ;
1615
1615
}
1616
1616
if ((e = mp_decr (& a )) != MP_OKAY ) {
1617
- goto LTM_ERR ;
1617
+ goto LBL_ERR ;
1618
1618
}
1619
1619
if (mp_cmp (& a , & b ) != MP_EQ ) {
1620
- goto LTM_ERR ;
1620
+ goto LBL_ERR ;
1621
1621
}
1622
1622
1623
1623
mp_clear_multi (& a , & b , NULL );
1624
1624
return EXIT_SUCCESS ;
1625
- LTM_ERR :
1625
+ LBL_ERR :
1626
1626
mp_clear_multi (& a , & b , NULL );
1627
1627
return EXIT_FAILURE ;
1628
1628
}
@@ -1856,13 +1856,13 @@ static int test_mp_root_u32(void)
1856
1856
mp_read_radix (& r , root [i ][j - 3 ], 10 );
1857
1857
if (mp_cmp (& r , & c ) != MP_EQ ) {
1858
1858
fprintf (stderr , "mp_root_u32 failed at input #%d, root #%d\n" , i , j );
1859
- goto LTM_ERR ;
1859
+ goto LBL_ERR ;
1860
1860
}
1861
1861
}
1862
1862
}
1863
1863
mp_clear_multi (& a , & c , & r , NULL );
1864
1864
return EXIT_SUCCESS ;
1865
- LTM_ERR :
1865
+ LBL_ERR :
1866
1866
mp_clear_multi (& a , & c , & r , NULL );
1867
1867
return EXIT_FAILURE ;
1868
1868
}
@@ -1879,31 +1879,31 @@ static int test_s_mp_balance_mul(void)
1879
1879
"HzrSq9WVt1jDTVlwUxSKqxctu2GVD+N8+SVGaPFRqdxyld6IxDBbj27BPJzYUdR96k3sWpkO8XnDBvupGPnehpQe4KlO/KmN1PjFov/UTZYM+LYzkFcBPyV6hkkL8ePC1rlFLAHzgJMBCXVp4mRqtkQrDsZXXlcqlbTFu69wF6zDEysiX2cAtn/kP9ldblJiwYPCD8hG" ;
1880
1880
1881
1881
if ((e = mp_init_multi (& a , & b , & c , NULL )) != MP_OKAY ) {
1882
- goto LTM_ERR ;
1882
+ goto LBL_ERR ;
1883
1883
}
1884
1884
1885
1885
if ((e = mp_read_radix (& a , na , 64 )) != MP_OKAY ) {
1886
- goto LTM_ERR ;
1886
+ goto LBL_ERR ;
1887
1887
}
1888
1888
if ((e = mp_read_radix (& b , nb , 64 )) != MP_OKAY ) {
1889
- goto LTM_ERR ;
1889
+ goto LBL_ERR ;
1890
1890
}
1891
1891
1892
1892
if ((e = s_mp_balance_mul (& a , & b , & c )) != MP_OKAY ) {
1893
- goto LTM_ERR ;
1893
+ goto LBL_ERR ;
1894
1894
}
1895
1895
1896
1896
if ((e = mp_read_radix (& b , nc , 64 )) != MP_OKAY ) {
1897
- goto LTM_ERR ;
1897
+ goto LBL_ERR ;
1898
1898
}
1899
1899
1900
1900
if (mp_cmp (& b , & c ) != MP_EQ ) {
1901
- goto LTM_ERR ;
1901
+ goto LBL_ERR ;
1902
1902
}
1903
1903
1904
1904
mp_clear_multi (& a , & b , & c , NULL );
1905
1905
return EXIT_SUCCESS ;
1906
- LTM_ERR :
1906
+ LBL_ERR :
1907
1907
mp_clear_multi (& a , & b , & c , NULL );
1908
1908
return EXIT_FAILURE ;
1909
1909
}
@@ -1915,30 +1915,30 @@ static int test_s_mp_karatsuba_mul(void)
1915
1915
int size , err ;
1916
1916
1917
1917
if ((err = mp_init_multi (& a , & b , & c , & d , NULL )) != MP_OKAY ) {
1918
- goto LTM_ERR ;
1918
+ goto LBL_ERR ;
1919
1919
}
1920
1920
for (size = MP_KARATSUBA_MUL_CUTOFF ; size < MP_KARATSUBA_MUL_CUTOFF + 20 ; size ++ ) {
1921
1921
if ((err = mp_rand (& a , size )) != MP_OKAY ) {
1922
- goto LTM_ERR ;
1922
+ goto LBL_ERR ;
1923
1923
}
1924
1924
if ((err = mp_rand (& b , size )) != MP_OKAY ) {
1925
- goto LTM_ERR ;
1925
+ goto LBL_ERR ;
1926
1926
}
1927
1927
if ((err = s_mp_karatsuba_mul (& a , & b , & c )) != MP_OKAY ) {
1928
- goto LTM_ERR ;
1928
+ goto LBL_ERR ;
1929
1929
}
1930
1930
if ((err = s_mp_mul (& a ,& b ,& d )) != MP_OKAY ) {
1931
- goto LTM_ERR ;
1931
+ goto LBL_ERR ;
1932
1932
}
1933
1933
if (mp_cmp (& c , & d ) != MP_EQ ) {
1934
1934
fprintf (stderr , "Karatsuba multiplication failed at size %d\n" , size );
1935
- goto LTM_ERR ;
1935
+ goto LBL_ERR ;
1936
1936
}
1937
1937
}
1938
1938
1939
1939
mp_clear_multi (& a , & b , & c , & d , NULL );
1940
1940
return EXIT_SUCCESS ;
1941
- LTM_ERR :
1941
+ LBL_ERR :
1942
1942
mp_clear_multi (& a , & b , & c , & d , NULL );
1943
1943
return EXIT_FAILURE ;
1944
1944
}
@@ -1949,27 +1949,27 @@ static int test_s_mp_karatsuba_sqr(void)
1949
1949
int size , err ;
1950
1950
1951
1951
if ((err = mp_init_multi (& a , & b , & c , NULL )) != MP_OKAY ) {
1952
- goto LTM_ERR ;
1952
+ goto LBL_ERR ;
1953
1953
}
1954
1954
for (size = MP_KARATSUBA_SQR_CUTOFF ; size < MP_KARATSUBA_SQR_CUTOFF + 20 ; size ++ ) {
1955
1955
if ((err = mp_rand (& a , size )) != MP_OKAY ) {
1956
- goto LTM_ERR ;
1956
+ goto LBL_ERR ;
1957
1957
}
1958
1958
if ((err = s_mp_karatsuba_sqr (& a , & b )) != MP_OKAY ) {
1959
- goto LTM_ERR ;
1959
+ goto LBL_ERR ;
1960
1960
}
1961
1961
if ((err = s_mp_sqr (& a , & c )) != MP_OKAY ) {
1962
- goto LTM_ERR ;
1962
+ goto LBL_ERR ;
1963
1963
}
1964
1964
if (mp_cmp (& b , & c ) != MP_EQ ) {
1965
1965
fprintf (stderr , "Karatsuba squaring failed at size %d\n" , size );
1966
- goto LTM_ERR ;
1966
+ goto LBL_ERR ;
1967
1967
}
1968
1968
}
1969
1969
1970
1970
mp_clear_multi (& a , & b , & c , NULL );
1971
1971
return EXIT_SUCCESS ;
1972
- LTM_ERR :
1972
+ LBL_ERR :
1973
1973
mp_clear_multi (& a , & b , & c , NULL );
1974
1974
return EXIT_FAILURE ;
1975
1975
}
@@ -1980,30 +1980,30 @@ static int test_s_mp_toom_mul(void)
1980
1980
int size , err ;
1981
1981
1982
1982
if ((err = mp_init_multi (& a , & b , & c , & d , NULL )) != MP_OKAY ) {
1983
- goto LTM_ERR ;
1983
+ goto LBL_ERR ;
1984
1984
}
1985
1985
for (size = MP_TOOM_MUL_CUTOFF ; size < MP_TOOM_MUL_CUTOFF + 20 ; size ++ ) {
1986
1986
if ((err = mp_rand (& a , size )) != MP_OKAY ) {
1987
- goto LTM_ERR ;
1987
+ goto LBL_ERR ;
1988
1988
}
1989
1989
if ((err = mp_rand (& b , size )) != MP_OKAY ) {
1990
- goto LTM_ERR ;
1990
+ goto LBL_ERR ;
1991
1991
}
1992
1992
if ((err = s_mp_toom_mul (& a , & b , & c )) != MP_OKAY ) {
1993
- goto LTM_ERR ;
1993
+ goto LBL_ERR ;
1994
1994
}
1995
1995
if ((err = s_mp_mul (& a ,& b ,& d )) != MP_OKAY ) {
1996
- goto LTM_ERR ;
1996
+ goto LBL_ERR ;
1997
1997
}
1998
1998
if (mp_cmp (& c , & d ) != MP_EQ ) {
1999
1999
fprintf (stderr , "Toom-Cook 3-way multiplication failed at size %d\n" , size );
2000
- goto LTM_ERR ;
2000
+ goto LBL_ERR ;
2001
2001
}
2002
2002
}
2003
2003
2004
2004
mp_clear_multi (& a , & b , & c , & d , NULL );
2005
2005
return EXIT_SUCCESS ;
2006
- LTM_ERR :
2006
+ LBL_ERR :
2007
2007
mp_clear_multi (& a , & b , & c , & d , NULL );
2008
2008
return EXIT_FAILURE ;
2009
2009
}
@@ -2014,27 +2014,27 @@ static int test_s_mp_toom_sqr(void)
2014
2014
int size , err ;
2015
2015
2016
2016
if ((err = mp_init_multi (& a , & b , & c , NULL )) != MP_OKAY ) {
2017
- goto LTM_ERR ;
2017
+ goto LBL_ERR ;
2018
2018
}
2019
2019
for (size = MP_TOOM_SQR_CUTOFF ; size < MP_TOOM_SQR_CUTOFF + 20 ; size ++ ) {
2020
2020
if ((err = mp_rand (& a , size )) != MP_OKAY ) {
2021
- goto LTM_ERR ;
2021
+ goto LBL_ERR ;
2022
2022
}
2023
2023
if ((err = s_mp_toom_sqr (& a , & b )) != MP_OKAY ) {
2024
- goto LTM_ERR ;
2024
+ goto LBL_ERR ;
2025
2025
}
2026
2026
if ((err = s_mp_sqr (& a , & c )) != MP_OKAY ) {
2027
- goto LTM_ERR ;
2027
+ goto LBL_ERR ;
2028
2028
}
2029
2029
if (mp_cmp (& b , & c ) != MP_EQ ) {
2030
2030
fprintf (stderr , "Toom-Cook 3-way squaring failed at size %d\n" , size );
2031
- goto LTM_ERR ;
2031
+ goto LBL_ERR ;
2032
2032
}
2033
2033
}
2034
2034
2035
2035
mp_clear_multi (& a , & b , & c , NULL );
2036
2036
return EXIT_SUCCESS ;
2037
- LTM_ERR :
2037
+ LBL_ERR :
2038
2038
mp_clear_multi (& a , & b , & c , NULL );
2039
2039
return EXIT_FAILURE ;
2040
2040
}
0 commit comments