Lines Matching defs:bn
81 #include <openssl/bn.h>
1542 ScopedBIGNUM bn;
1543 int ret = DecimalToBIGNUM(&bn, "0");
1544 if (ret != 1 || !BN_is_zero(bn.get()) || BN_is_negative(bn.get())) {
1549 ret = DecimalToBIGNUM(&bn, "256");
1550 if (ret != 3 || !BN_is_word(bn.get(), 256) || BN_is_negative(bn.get())) {
1555 ret = DecimalToBIGNUM(&bn, "-42");
1556 if (ret != 3 || !BN_abs_is_word(bn.get(), 42) || !BN_is_negative(bn.get())) {
1561 ret = DecimalToBIGNUM(&bn, "-0");
1562 if (ret != 2 || !BN_is_zero(bn.get()) || BN_is_negative(bn.get())) {
1567 ret = DecimalToBIGNUM(&bn, "42trailing garbage is ignored");
1568 if (ret != 2 || !BN_abs_is_word(bn.get(), 42) || BN_is_negative(bn.get())) {
1577 ScopedBIGNUM bn;
1578 int ret = HexToBIGNUM(&bn, "0");
1579 if (ret != 1 || !BN_is_zero(bn.get()) || BN_is_negative(bn.get())) {
1584 ret = HexToBIGNUM(&bn, "256");
1585 if (ret != 3 || !BN_is_word(bn.get(), 0x256) || BN_is_negative(bn.get())) {
1590 ret = HexToBIGNUM(&bn, "-42");
1591 if (ret != 3 || !BN_abs_is_word(bn.get(), 0x42) || !BN_is_negative(bn.get())) {
1596 ret = HexToBIGNUM(&bn, "-0");
1597 if (ret != 2 || !BN_is_zero(bn.get()) || BN_is_negative(bn.get())) {
1602 ret = HexToBIGNUM(&bn, "abctrailing garbage is ignored");
1603 if (ret != 3 || !BN_is_word(bn.get(), 0xabc) || BN_is_negative(bn.get())) {
1620 ScopedBIGNUM bn = ASCIIToBIGNUM("0");
1621 if (!bn || !BN_is_zero(bn.get()) || BN_is_negative(bn.get())) {
1626 bn = ASCIIToBIGNUM("256");
1627 if (!bn || !BN_is_word(bn.get(), 256) || BN_is_negative(bn.get())) {
1632 bn = ASCIIToBIGNUM("-42");
1633 if (!bn || !BN_abs_is_word(bn.get(), 42) || !BN_is_negative(bn.get())) {
1638 bn = ASCIIToBIGNUM("0x1234");
1639 if (!bn || !BN_is_word(bn.get(), 0x1234) || BN_is_negative(bn.get())) {
1644 bn = ASCIIToBIGNUM("0X1234");
1645 if (!bn || !BN_is_word(bn.get(), 0x1234) || BN_is_negative(bn.get())) {
1650 bn = ASCIIToBIGNUM("-0xabcd");
1651 if (!bn || !BN_abs_is_word(bn.get(), 0xabcd) || !BN_is_negative(bn.get())) {
1656 bn = ASCIIToBIGNUM("-0");
1657 if (!bn || !BN_is_zero(bn.get()) || BN_is_negative(bn.get())) {
1662 bn = ASCIIToBIGNUM("123trailing garbage is ignored");
1663 if (!bn || !BN_is_word(bn.get(), 123) || BN_is_negative(bn.get())) {
1691 ScopedBIGNUM bn(ASCIIToBIGNUM(test.base10));
1692 const size_t mpi_len = BN_bn2mpi(bn.get(), NULL);
1699 const size_t mpi_len2 = BN_bn2mpi(bn.get(), scratch);
1719 if (BN_cmp(bn.get(), bn2.get()) != 0) {
1729 ScopedBIGNUM bn(BN_new());
1730 if (!bn) {
1736 if (!BN_rand(bn.get(), 0, 0 /* top */, 0 /* bottom */) ||
1737 !BN_is_zero(bn.get())) {
1741 if (!BN_rand(bn.get(), 0, 1 /* top */, 1 /* bottom */) ||
1742 !BN_is_zero(bn.get())) {
1747 if (!BN_rand(bn.get(), 1, 0 /* top */, 0 /* bottom */) ||
1748 !BN_is_word(bn.get(), 1)) {
1752 if (!BN_rand(bn.get(), 1, 1 /* top */, 0 /* bottom */) ||
1753 !BN_is_word(bn.get(), 1)) {
1757 if (!BN_rand(bn.get(), 1, -1 /* top */, 1 /* bottom */) ||
1758 !BN_is_word(bn.get(), 1)) {
1763 if (!BN_rand(bn.get(), 2, 1 /* top */, 0 /* bottom */) ||
1764 !BN_is_word(bn.get(), 3)) {
1814 ScopedBIGNUM bn = ASCIIToBIGNUM(test.value_ascii);
1815 if (!bn) {
1830 if (BN_cmp(bn.get(), bn2.get()) != 0) {
1841 !BN_bn2cbb(&cbb, bn.get()) ||
1859 if (BN_cmp(bn.get(), bn2.get()) != 0) {
1866 ScopedBIGNUM bn(BN_new());
1867 if (!bn) {
1872 if (BN_cbs2unsigned(&cbs, bn.get())) {
1881 if (BN_cbs2unsigned_buggy(&cbs, bn.get())) {
1890 ScopedBIGNUM bn(BN_new());
1891 if (!bn) {
1897 if (BN_cbs2unsigned(&cbs, bn.get())) {
1910 if (!BN_cbs2unsigned_buggy(&cbs, bn.get()) || CBS_len(&cbs) != 0) {
1915 if (BN_cmp(bn.get(), bn2.get()) != 0) {
1922 ScopedBIGNUM bn = ASCIIToBIGNUM("-1");
1923 if (!bn) {
1929 BN_bn2cbb(&cbb, bn.get())) {