Home
last modified time | relevance | path

Searched refs:bitLength (Results 1 – 23 of 23) sorted by relevance

/libcore/luni/src/test/java/libcore/java/math/
DBigIntegerTest.java93 assertTrue(b.toString() + " " + b.bitLength(), b.bitLength() <= 128); in test_Constructor_ILjava_util_Random()
96 assertTrue(b.toString() + " " + b.bitLength(), b.bitLength() <= 16); in test_Constructor_ILjava_util_Random()
99 assertTrue(b.toString() + " " + b.bitLength(), b.bitLength() <= 5); in test_Constructor_ILjava_util_Random()
108 assertEquals(b.toString(), 128, b.bitLength()); in test_Constructor_IILjava_util_Random()
112 assertEquals(b.toString(), 16, b.bitLength()); in test_Constructor_IILjava_util_Random()
116 assertEquals(b.toString(), 5, b.bitLength()); in test_Constructor_IILjava_util_Random()
126 assertEquals(b.toString(), 2, b.bitLength()); in test_Constructor_IILjava_util_Random()
147 assertEquals(b.toString(), 128, b.bitLength()); in test_probablePrime()
151 assertEquals(b.toString(), 16, b.bitLength()); in test_probablePrime()
155 assertEquals(b.toString(), 5, b.bitLength()); in test_probablePrime()
/libcore/luni/src/main/java/java/math/
DBigDecimal.java185 LONG_FIVE_POW_BIT_LENGTH[i] = bitLength(LONG_FIVE_POW[i]);
188 LONG_POWERS_OF_TEN_BIT_LENGTH[i] = bitLength(MathUtils.LONG_POWERS_OF_TEN[i]);
217 private transient int bitLength; field in BigDecimal
240 this.bitLength = bitLength(smallValue); in BigDecimal()
246 this.bitLength = bitLength(smallValue); in BigDecimal()
345 bitLength = bitLength(smallValue); in BigDecimal()
489 int mantissaBits = bitLength(mantissa); in BigDecimal()
491 bitLength = mantissaBits == 0 ? 0 : mantissaBits - scale; in BigDecimal()
492 if(bitLength < 64) { in BigDecimal()
506 bitLength = bitLength(smallValue); in BigDecimal()
[all …]
DBigInteger.java163 public BigInteger(int bitLength, int certainty, Random random) { in BigInteger() argument
164 if (bitLength < 2) { in BigInteger()
165 throw new ArithmeticException("bitLength < 2: " + bitLength); in BigInteger()
167 if (bitLength < 16) { in BigInteger()
171 candidate = random.nextInt() & ((1 << bitLength) - 1); in BigInteger()
172 candidate |= (1 << (bitLength - 1)); // Set top bit. in BigInteger()
173 if (bitLength > 2) { in BigInteger()
183 setBigInt(BigInt.generatePrimeDefault(bitLength)); in BigInteger()
184 } while (bitLength() != bitLength); in BigInteger()
518 public int bitLength() { in bitLength() method in BigInteger
[all …]
DBigInt.java219 int actualByteCount = (NativeBN.bitLength(this.bignum) + 7) / 8; in twosCompFitsIntoBytes()
223 int bitLength() { in bitLength() method in BigInt
224 return NativeBN.bitLength(this.bignum); in bitLength()
339 static BigInt generatePrimeDefault(int bitLength) { in generatePrimeDefault() argument
341 NativeBN.BN_generate_prime_ex(r.bignum, bitLength, false, 0, 0, 0); in generatePrimeDefault()
DNativeBN.java74 public static native int bitLength(long a); in bitLength() method in NativeBN
DPrimality.java94 if (ni.bitLength() <= 10) { in nextProbablePrime()
DConversion.java76 int resLengthInChars = (int) (val.abs().bitLength() / bitsForRadixDigit + ((sign < 0) ? 1 in bigInteger2String()
430 int bitLen = val.abs().bitLength(); in bigInteger2Double()
DBitLevel.java41 static int bitLength(BigInteger val) { in bitLength() method in BitLevel
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/
DOldBigIntegerTest.java86 assertEquals(i, bi.bitLength()); in test_ConstructorIILjava_util_Random()
176 for (int bitLength = 100; bitLength <= 600; bitLength += 100) { in test_isProbablePrimeI()
177 BigInteger a = BigInteger.probablePrime(bitLength, rand); in test_isProbablePrimeI()
178 BigInteger b = BigInteger.probablePrime(bitLength, rand); in test_isProbablePrimeI()
182 " (bitLength = " + bitLength + ")", in test_isProbablePrimeI()
222 for (int bitLength = 50; bitLength <= 1050; bitLength += 100) { in test_probablePrime()
223 BigInteger a = BigInteger.probablePrime(bitLength, rand); in test_probablePrime()
DBigIntegerConstructorsTest.java745 assertTrue("incorrect bitLength", aNumber.bitLength() <= bitLen); in testConstructorRandom()
757 assertEquals(b.toString(), bits, b.bitLength()); in testConstructorPrime()
762 assertEquals(b.toString(), bits, b.bitLength()); in testConstructorPrime()
767 assertEquals(b.toString(), bits, b.bitLength()); in testConstructorPrime()
773 assertEquals(b.toString(), bits, b.bitLength()); in testConstructorPrime()
778 assertTrue(b.toString(), b.bitLength() <= bits); in testConstructorPrime()
783 assertTrue(b.toString(), b.bitLength() <= bits); in testConstructorPrime()
DBigIntegerHashCodeTest.java44 aNumber1.divide(aNumber2).bitLength(); in testSameObject()
DBigIntegerTest.java760 int len = Math.max(i1.bitLength(), i2.bitLength()) + 66; in test_andLjava_math_BigInteger()
776 int len = Math.max(i1.bitLength(), i2.bitLength()) + 66; in test_orLjava_math_BigInteger()
792 int len = Math.max(i1.bitLength(), i2.bitLength()) + 66; in test_xorLjava_math_BigInteger()
807 int len = i1.bitLength() + 66; in test_not()
821 int len = Math.max(i1.bitLength(), i2.bitLength()) + 66; in test_andNotLjava_math_BigInteger()
DBigIntegerOperateBitsTest.java61 assertEquals(0, aNumber.bitLength()); in testBitLengthZero()
71 assertEquals(108, aNumber.bitLength()); in testBitLengthPositive1()
81 assertEquals(96, aNumber.bitLength()); in testBitLengthPositive2()
91 assertEquals(81, aNumber.bitLength()); in testBitLengthPositive3()
101 assertEquals(108, aNumber.bitLength()); in testBitLengthNegative1()
111 assertEquals(96, aNumber.bitLength()); in testBitLengthNegative2()
121 assertEquals(80, aNumber.bitLength()); in testBitLengthNegative3()
/libcore/luni/src/main/java/java/lang/
DHexStringParser.java234 int bitLength = countBitsLength(mantissa); in fitMantissaInDesiredWidth() local
235 if (bitLength > desiredWidth) { in fitMantissaInDesiredWidth()
236 discardTrailingBits(bitLength - desiredWidth); in fitMantissaInDesiredWidth()
238 mantissa <<= (desiredWidth - bitLength); in fitMantissaInDesiredWidth()
/libcore/luni/src/main/java/java/security/spec/
DEllipticCurve.java92 if (!(this.a.bitLength() <= fieldSizeInBits)) { in EllipticCurve()
95 if (!(this.b.bitLength() <= fieldSizeInBits)) { in EllipticCurve()
DECFieldFp.java56 return p.bitLength(); in getFieldSize()
DECFieldF2m.java90 if ((this.rp.bitLength() != (m+1)) || in ECFieldF2m()
/libcore/support/src/test/java/libcore/javax/net/ssl/
DRandomPrivateKeyX509ExtendedKeyManager.java58 int keyLengthBits = originalKeySpec.getModulus().bitLength(); in getPrivateKey()
/libcore/luni/src/test/java/libcore/java/security/
DSignatureTest.java1265 final int oneTooBig = RSA_2048_modulus.bitLength() - 10; in testSign_NONEwithRSA_Key_DataTooLarge_Failure()
1287 final int oneTooBig = RSA_2048_modulus.bitLength() - 10; in testSign_NONEwithRSA_Key_DataTooLarge_SingleByte_Failure()
1310 final int oneTooBig = RSA_2048_modulus.bitLength() + 1; in testVerify_NONEwithRSA_Key_DataTooLarge_Failure()
1332 final int tooBig = RSA_2048_modulus.bitLength() * 2; in testVerify_NONEwithRSA_Key_DataTooLarge_SingleByte_Failure()
/libcore/luni/src/main/java/java/text/
DNumberFormat.java297 (object instanceof BigInteger && ((BigInteger) object).bitLength() < 64)) { in format()
DDecimalFormat.java696 char[] chars = (bigInteger.bitLength() < 64) in format()
/libcore/luni/src/main/native/
Djava_math_NativeBN.cpp588 NATIVE_METHOD(NativeBN, bitLength, "(J)I"),
/libcore/luni/src/test/java/libcore/javax/crypto/
DCipherTest.java2304 final int modulusInBytes = RSA_2048_modulus.bitLength() / 8; in testRSA_ECB_NoPadding_GetOutputSize_Success()