• Home
  • Raw
  • Download

Lines Matching refs:bn

318     BIGNUM *bn = BN_new();  in set_signed_bn()  local
320 if (bn == NULL) in set_signed_bn()
322 if (!BN_set_word(bn, value < 0 ? -value : value)) { in set_signed_bn()
323 BN_free(bn); in set_signed_bn()
326 BN_set_negative(bn, value < 0); in set_signed_bn()
327 return bn; in set_signed_bn()
1845 BIGNUM *bn = NULL; in test_dec2bn() local
1848 if (!TEST_int_eq(parsedecBN(&bn, "0"), 1) in test_dec2bn()
1849 || !TEST_BN_eq_word(bn, 0) in test_dec2bn()
1850 || !TEST_BN_eq_zero(bn) in test_dec2bn()
1851 || !TEST_BN_le_zero(bn) in test_dec2bn()
1852 || !TEST_BN_ge_zero(bn) in test_dec2bn()
1853 || !TEST_BN_even(bn)) in test_dec2bn()
1855 BN_free(bn); in test_dec2bn()
1856 bn = NULL; in test_dec2bn()
1858 if (!TEST_int_eq(parsedecBN(&bn, "256"), 3) in test_dec2bn()
1859 || !TEST_BN_eq_word(bn, 256) in test_dec2bn()
1860 || !TEST_BN_ge_zero(bn) in test_dec2bn()
1861 || !TEST_BN_gt_zero(bn) in test_dec2bn()
1862 || !TEST_BN_ne_zero(bn) in test_dec2bn()
1863 || !TEST_BN_even(bn)) in test_dec2bn()
1865 BN_free(bn); in test_dec2bn()
1866 bn = NULL; in test_dec2bn()
1868 if (!TEST_int_eq(parsedecBN(&bn, "-42"), 3) in test_dec2bn()
1869 || !TEST_BN_abs_eq_word(bn, 42) in test_dec2bn()
1870 || !TEST_BN_lt_zero(bn) in test_dec2bn()
1871 || !TEST_BN_le_zero(bn) in test_dec2bn()
1872 || !TEST_BN_ne_zero(bn) in test_dec2bn()
1873 || !TEST_BN_even(bn)) in test_dec2bn()
1875 BN_free(bn); in test_dec2bn()
1876 bn = NULL; in test_dec2bn()
1878 if (!TEST_int_eq(parsedecBN(&bn, "1"), 1) in test_dec2bn()
1879 || !TEST_BN_eq_word(bn, 1) in test_dec2bn()
1880 || !TEST_BN_ne_zero(bn) in test_dec2bn()
1881 || !TEST_BN_gt_zero(bn) in test_dec2bn()
1882 || !TEST_BN_ge_zero(bn) in test_dec2bn()
1883 || !TEST_BN_eq_one(bn) in test_dec2bn()
1884 || !TEST_BN_odd(bn)) in test_dec2bn()
1886 BN_free(bn); in test_dec2bn()
1887 bn = NULL; in test_dec2bn()
1889 if (!TEST_int_eq(parsedecBN(&bn, "-0"), 2) in test_dec2bn()
1890 || !TEST_BN_eq_zero(bn) in test_dec2bn()
1891 || !TEST_BN_ge_zero(bn) in test_dec2bn()
1892 || !TEST_BN_le_zero(bn) in test_dec2bn()
1893 || !TEST_BN_even(bn)) in test_dec2bn()
1895 BN_free(bn); in test_dec2bn()
1896 bn = NULL; in test_dec2bn()
1898 if (!TEST_int_eq(parsedecBN(&bn, "42trailing garbage is ignored"), 2) in test_dec2bn()
1899 || !TEST_BN_abs_eq_word(bn, 42) in test_dec2bn()
1900 || !TEST_BN_ge_zero(bn) in test_dec2bn()
1901 || !TEST_BN_gt_zero(bn) in test_dec2bn()
1902 || !TEST_BN_ne_zero(bn) in test_dec2bn()
1903 || !TEST_BN_even(bn)) in test_dec2bn()
1908 BN_free(bn); in test_dec2bn()
1914 BIGNUM *bn = NULL; in test_hex2bn() local
1917 if (!TEST_int_eq(parseBN(&bn, "0"), 1) in test_hex2bn()
1918 || !TEST_BN_eq_zero(bn) in test_hex2bn()
1919 || !TEST_BN_ge_zero(bn) in test_hex2bn()
1920 || !TEST_BN_even(bn)) in test_hex2bn()
1922 BN_free(bn); in test_hex2bn()
1923 bn = NULL; in test_hex2bn()
1925 if (!TEST_int_eq(parseBN(&bn, "256"), 3) in test_hex2bn()
1926 || !TEST_BN_eq_word(bn, 0x256) in test_hex2bn()
1927 || !TEST_BN_ge_zero(bn) in test_hex2bn()
1928 || !TEST_BN_gt_zero(bn) in test_hex2bn()
1929 || !TEST_BN_ne_zero(bn) in test_hex2bn()
1930 || !TEST_BN_even(bn)) in test_hex2bn()
1932 BN_free(bn); in test_hex2bn()
1933 bn = NULL; in test_hex2bn()
1935 if (!TEST_int_eq(parseBN(&bn, "-42"), 3) in test_hex2bn()
1936 || !TEST_BN_abs_eq_word(bn, 0x42) in test_hex2bn()
1937 || !TEST_BN_lt_zero(bn) in test_hex2bn()
1938 || !TEST_BN_le_zero(bn) in test_hex2bn()
1939 || !TEST_BN_ne_zero(bn) in test_hex2bn()
1940 || !TEST_BN_even(bn)) in test_hex2bn()
1942 BN_free(bn); in test_hex2bn()
1943 bn = NULL; in test_hex2bn()
1945 if (!TEST_int_eq(parseBN(&bn, "cb"), 2) in test_hex2bn()
1946 || !TEST_BN_eq_word(bn, 0xCB) in test_hex2bn()
1947 || !TEST_BN_ge_zero(bn) in test_hex2bn()
1948 || !TEST_BN_gt_zero(bn) in test_hex2bn()
1949 || !TEST_BN_ne_zero(bn) in test_hex2bn()
1950 || !TEST_BN_odd(bn)) in test_hex2bn()
1952 BN_free(bn); in test_hex2bn()
1953 bn = NULL; in test_hex2bn()
1955 if (!TEST_int_eq(parseBN(&bn, "-0"), 2) in test_hex2bn()
1956 || !TEST_BN_eq_zero(bn) in test_hex2bn()
1957 || !TEST_BN_ge_zero(bn) in test_hex2bn()
1958 || !TEST_BN_le_zero(bn) in test_hex2bn()
1959 || !TEST_BN_even(bn)) in test_hex2bn()
1961 BN_free(bn); in test_hex2bn()
1962 bn = NULL; in test_hex2bn()
1964 if (!TEST_int_eq(parseBN(&bn, "abctrailing garbage is ignored"), 3) in test_hex2bn()
1965 || !TEST_BN_eq_word(bn, 0xabc) in test_hex2bn()
1966 || !TEST_BN_ge_zero(bn) in test_hex2bn()
1967 || !TEST_BN_gt_zero(bn) in test_hex2bn()
1968 || !TEST_BN_ne_zero(bn) in test_hex2bn()
1969 || !TEST_BN_even(bn)) in test_hex2bn()
1974 BN_free(bn); in test_hex2bn()
1980 BIGNUM *bn = NULL; in test_asc2bn() local
1983 if (!TEST_ptr(bn = BN_new())) in test_asc2bn()
1986 if (!TEST_true(BN_asc2bn(&bn, "0")) in test_asc2bn()
1987 || !TEST_BN_eq_zero(bn) in test_asc2bn()
1988 || !TEST_BN_ge_zero(bn)) in test_asc2bn()
1991 if (!TEST_true(BN_asc2bn(&bn, "256")) in test_asc2bn()
1992 || !TEST_BN_eq_word(bn, 256) in test_asc2bn()
1993 || !TEST_BN_ge_zero(bn)) in test_asc2bn()
1996 if (!TEST_true(BN_asc2bn(&bn, "-42")) in test_asc2bn()
1997 || !TEST_BN_abs_eq_word(bn, 42) in test_asc2bn()
1998 || !TEST_BN_lt_zero(bn)) in test_asc2bn()
2001 if (!TEST_true(BN_asc2bn(&bn, "0x1234")) in test_asc2bn()
2002 || !TEST_BN_eq_word(bn, 0x1234) in test_asc2bn()
2003 || !TEST_BN_ge_zero(bn)) in test_asc2bn()
2006 if (!TEST_true(BN_asc2bn(&bn, "0X1234")) in test_asc2bn()
2007 || !TEST_BN_eq_word(bn, 0x1234) in test_asc2bn()
2008 || !TEST_BN_ge_zero(bn)) in test_asc2bn()
2011 if (!TEST_true(BN_asc2bn(&bn, "-0xabcd")) in test_asc2bn()
2012 || !TEST_BN_abs_eq_word(bn, 0xabcd) in test_asc2bn()
2013 || !TEST_BN_lt_zero(bn)) in test_asc2bn()
2016 if (!TEST_true(BN_asc2bn(&bn, "-0")) in test_asc2bn()
2017 || !TEST_BN_eq_zero(bn) in test_asc2bn()
2018 || !TEST_BN_ge_zero(bn)) in test_asc2bn()
2021 if (!TEST_true(BN_asc2bn(&bn, "123trailing garbage is ignored")) in test_asc2bn()
2022 || !TEST_BN_eq_word(bn, 123) in test_asc2bn()
2023 || !TEST_BN_ge_zero(bn)) in test_asc2bn()
2028 BN_free(bn); in test_asc2bn()
2046 BIGNUM *bn = NULL; in test_mpi() local
2050 if (!TEST_ptr(bn = BN_new()) in test_mpi()
2051 || !TEST_true(BN_asc2bn(&bn, test->base10))) in test_mpi()
2053 mpi_len = BN_bn2mpi(bn, NULL); in test_mpi()
2057 if (!TEST_size_t_eq(mpi_len2 = BN_bn2mpi(bn, scratch), mpi_len) in test_mpi()
2064 if (!TEST_BN_eq(bn, bn2)) { in test_mpi()
2072 BN_free(bn); in test_mpi()
2078 BIGNUM *bn = NULL; in test_rand() local
2081 if (!TEST_ptr(bn = BN_new())) in test_rand()
2085 if (!TEST_false(BN_rand(bn, 0, 0 /* top */ , 0 /* bottom */ )) in test_rand()
2086 || !TEST_false(BN_rand(bn, 0, 1 /* top */ , 1 /* bottom */ )) in test_rand()
2087 || !TEST_true(BN_rand(bn, 1, 0 /* top */ , 0 /* bottom */ )) in test_rand()
2088 || !TEST_BN_eq_one(bn) in test_rand()
2089 || !TEST_false(BN_rand(bn, 1, 1 /* top */ , 0 /* bottom */ )) in test_rand()
2090 || !TEST_true(BN_rand(bn, 1, -1 /* top */ , 1 /* bottom */ )) in test_rand()
2091 || !TEST_BN_eq_one(bn) in test_rand()
2092 || !TEST_true(BN_rand(bn, 2, 1 /* top */ , 0 /* bottom */ )) in test_rand()
2093 || !TEST_BN_eq_word(bn, 3)) in test_rand()
2098 BN_free(bn); in test_rand()