• Home
  • Raw
  • Download

Lines Matching refs:bignum

41 static void AssignHexString(Bignum* bignum, const char* str) {  in AssignHexString()  argument
42 bignum->AssignHexString(Vector<const char>(str, StrLength(str))); in AssignHexString()
46 static void AssignDecimalString(Bignum* bignum, const char* str) { in AssignDecimalString() argument
47 bignum->AssignDecimalString(Vector<const char>(str, StrLength(str))); in AssignDecimalString()
53 Bignum bignum; in TEST() local
55 bignum.AssignUInt16(0); in TEST()
56 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
58 bignum.AssignUInt16(0xA); in TEST()
59 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
61 bignum.AssignUInt16(0x20); in TEST()
62 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
66 bignum.AssignUInt64(0); in TEST()
67 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
69 bignum.AssignUInt64(0xA); in TEST()
70 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
72 bignum.AssignUInt64(0x20); in TEST()
73 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
75 bignum.AssignUInt64(0x100); in TEST()
76 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
80 bignum.AssignUInt64(0x12345678); in TEST()
81 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
85 bignum.AssignUInt64(big); in TEST()
86 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
90 bignum.AssignUInt64(big); in TEST()
91 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
94 bignum2.AssignBignum(bignum); in TEST()
98 AssignDecimalString(&bignum, "0"); in TEST()
99 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
102 AssignDecimalString(&bignum, "1"); in TEST()
103 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
106 AssignDecimalString(&bignum, "1234567890"); in TEST()
107 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
110 AssignHexString(&bignum, "0"); in TEST()
111 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
114 AssignHexString(&bignum, "123456789ABCDEF0"); in TEST()
115 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
122 Bignum bignum; in TEST() local
123 AssignHexString(&bignum, "0"); in TEST()
124 bignum.ShiftLeft(100); in TEST()
125 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
128 AssignHexString(&bignum, "1"); in TEST()
129 bignum.ShiftLeft(1); in TEST()
130 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
133 AssignHexString(&bignum, "1"); in TEST()
134 bignum.ShiftLeft(4); in TEST()
135 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
138 AssignHexString(&bignum, "1"); in TEST()
139 bignum.ShiftLeft(32); in TEST()
140 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
143 AssignHexString(&bignum, "1"); in TEST()
144 bignum.ShiftLeft(64); in TEST()
145 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
148 AssignHexString(&bignum, "123456789ABCDEF"); in TEST()
149 bignum.ShiftLeft(64); in TEST()
150 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
152 bignum.ShiftLeft(1); in TEST()
153 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
160 Bignum bignum; in TEST() local
161 AssignHexString(&bignum, "0"); in TEST()
162 bignum.AddUInt64(0xA); in TEST()
163 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
166 AssignHexString(&bignum, "1"); in TEST()
167 bignum.AddUInt64(0xA); in TEST()
168 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
171 AssignHexString(&bignum, "1"); in TEST()
172 bignum.AddUInt64(0x100); in TEST()
173 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
176 AssignHexString(&bignum, "1"); in TEST()
177 bignum.AddUInt64(0xFFFF); in TEST()
178 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
181 AssignHexString(&bignum, "FFFFFFF"); in TEST()
182 bignum.AddUInt64(0x1); in TEST()
183 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
186 AssignHexString(&bignum, "10000000000000000000000000000000000000000000"); in TEST()
187 bignum.AddUInt64(0xFFFF); in TEST()
188 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
191 AssignHexString(&bignum, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); in TEST()
192 bignum.AddUInt64(0x1); in TEST()
193 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
196 bignum.AssignUInt16(0x1); in TEST()
197 bignum.ShiftLeft(100); in TEST()
198 bignum.AddUInt64(1); in TEST()
199 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
202 bignum.AssignUInt16(0x1); in TEST()
203 bignum.ShiftLeft(100); in TEST()
204 bignum.AddUInt64(0xFFFF); in TEST()
205 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
208 AssignHexString(&bignum, "0"); in TEST()
209 bignum.AddUInt64(V8_2PART_UINT64_C(0xA, 00000000)); in TEST()
210 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
213 AssignHexString(&bignum, "1"); in TEST()
214 bignum.AddUInt64(V8_2PART_UINT64_C(0xA, 00000000)); in TEST()
215 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
218 AssignHexString(&bignum, "1"); in TEST()
219 bignum.AddUInt64(V8_2PART_UINT64_C(0x100, 00000000)); in TEST()
220 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
223 AssignHexString(&bignum, "1"); in TEST()
224 bignum.AddUInt64(V8_2PART_UINT64_C(0xFFFF, 00000000)); in TEST()
225 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
228 AssignHexString(&bignum, "FFFFFFF"); in TEST()
229 bignum.AddUInt64(V8_2PART_UINT64_C(0x1, 00000000)); in TEST()
230 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
233 AssignHexString(&bignum, "10000000000000000000000000000000000000000000"); in TEST()
234 bignum.AddUInt64(V8_2PART_UINT64_C(0xFFFF, 00000000)); in TEST()
235 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
238 AssignHexString(&bignum, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); in TEST()
239 bignum.AddUInt64(V8_2PART_UINT64_C(0x1, 00000000)); in TEST()
240 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
243 bignum.AssignUInt16(0x1); in TEST()
244 bignum.ShiftLeft(100); in TEST()
245 bignum.AddUInt64(V8_2PART_UINT64_C(0x1, 00000000)); in TEST()
246 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
249 bignum.AssignUInt16(0x1); in TEST()
250 bignum.ShiftLeft(100); in TEST()
251 bignum.AddUInt64(V8_2PART_UINT64_C(0xFFFF, 00000000)); in TEST()
252 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
259 Bignum bignum; in TEST() local
263 AssignHexString(&bignum, "0"); in TEST()
264 bignum.AddBignum(other); in TEST()
265 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
268 AssignHexString(&bignum, "1"); in TEST()
269 bignum.AddBignum(other); in TEST()
270 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
273 AssignHexString(&bignum, "FFFFFFF"); in TEST()
274 bignum.AddBignum(other); in TEST()
275 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
278 AssignHexString(&bignum, "FFFFFFFFFFFFFF"); in TEST()
279 bignum.AddBignum(other); in TEST()
280 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
283 AssignHexString(&bignum, "10000000000000000000000000000000000000000000"); in TEST()
284 bignum.AddBignum(other); in TEST()
285 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
290 AssignHexString(&bignum, "1"); in TEST()
291 bignum.AddBignum(other); in TEST()
292 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
295 AssignHexString(&bignum, "FFFFFFF"); in TEST()
296 bignum.AddBignum(other); in TEST()
297 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
300 AssignHexString(&bignum, "10000000000000000000000000000000000000000000"); in TEST()
301 bignum.AddBignum(other); in TEST()
302 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
305 AssignHexString(&bignum, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); in TEST()
306 bignum.AddBignum(other); in TEST()
307 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
310 bignum.AssignUInt16(0x1); in TEST()
311 bignum.ShiftLeft(100); in TEST()
312 bignum.AddBignum(other); in TEST()
313 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
319 bignum.AssignUInt16(0x1); in TEST()
320 bignum.AddBignum(other); in TEST()
321 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
324 AssignHexString(&bignum, "FFFFFFF"); in TEST()
325 bignum.AddBignum(other); in TEST()
326 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
329 AssignHexString(&bignum, "10000000000000000000000000000000000000000000"); in TEST()
330 bignum.AddBignum(other); in TEST()
331 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
334 AssignHexString(&bignum, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); in TEST()
335 bignum.AddBignum(other); in TEST()
336 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
339 bignum.AssignUInt16(0x1); in TEST()
340 bignum.ShiftLeft(100); in TEST()
341 bignum.AddBignum(other); in TEST()
342 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
349 Bignum bignum; in TEST() local
352 AssignHexString(&bignum, "1"); in TEST()
354 bignum.SubtractBignum(other); in TEST()
355 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
358 AssignHexString(&bignum, "2"); in TEST()
360 bignum.SubtractBignum(other); in TEST()
361 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
364 AssignHexString(&bignum, "10000000"); in TEST()
366 bignum.SubtractBignum(other); in TEST()
367 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
370 AssignHexString(&bignum, "100000000000000"); in TEST()
372 bignum.SubtractBignum(other); in TEST()
373 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
376 AssignHexString(&bignum, "10000000000000000000000000000000000000000001"); in TEST()
378 bignum.SubtractBignum(other); in TEST()
379 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
382 AssignHexString(&bignum, "1000000000001"); in TEST()
384 bignum.SubtractBignum(other); in TEST()
385 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
388 AssignHexString(&bignum, "100000FFFFFFF"); in TEST()
390 bignum.SubtractBignum(other); in TEST()
391 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
394 AssignHexString(&bignum, "10000000000000000000000000000001000000000000"); in TEST()
396 bignum.SubtractBignum(other); in TEST()
397 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
400 AssignHexString(&bignum, "1000000000000000000000000000000FFFFFFFFFFFF"); in TEST()
402 bignum.SubtractBignum(other); in TEST()
403 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
406 bignum.AssignUInt16(0x1); in TEST()
407 bignum.ShiftLeft(100); in TEST()
410 bignum.SubtractBignum(other); in TEST()
411 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
418 bignum.AssignUInt16(0x1); in TEST()
419 bignum.ShiftLeft(100); in TEST()
421 bignum.SubtractBignum(other); in TEST()
422 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
428 AssignHexString(&bignum, "FFFFFFF"); in TEST()
429 bignum.ShiftLeft(60); in TEST()
431 bignum.SubtractBignum(other); in TEST()
432 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
435 AssignHexString(&bignum, "10000000000000000000000000000000000000000000"); in TEST()
436 bignum.SubtractBignum(other); in TEST()
437 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
440 AssignHexString(&bignum, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); in TEST()
441 bignum.SubtractBignum(other); in TEST()
442 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
449 Bignum bignum; in TEST() local
451 AssignHexString(&bignum, "0"); in TEST()
452 bignum.MultiplyByUInt32(0x25); in TEST()
453 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
456 AssignHexString(&bignum, "2"); in TEST()
457 bignum.MultiplyByUInt32(0x5); in TEST()
458 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
461 AssignHexString(&bignum, "10000000"); in TEST()
462 bignum.MultiplyByUInt32(0x9); in TEST()
463 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
466 AssignHexString(&bignum, "100000000000000"); in TEST()
467 bignum.MultiplyByUInt32(0xFFFF); in TEST()
468 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
471 AssignHexString(&bignum, "100000000000000"); in TEST()
472 bignum.MultiplyByUInt32(0xFFFFFFFF); in TEST()
473 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
476 AssignHexString(&bignum, "1234567ABCD"); in TEST()
477 bignum.MultiplyByUInt32(0xFFF); in TEST()
478 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
481 AssignHexString(&bignum, "1234567ABCD"); in TEST()
482 bignum.MultiplyByUInt32(0xFFFFFFF); in TEST()
483 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
486 AssignHexString(&bignum, "FFFFFFFFFFFFFFFF"); in TEST()
487 bignum.MultiplyByUInt32(0x2); in TEST()
488 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
491 AssignHexString(&bignum, "FFFFFFFFFFFFFFFF"); in TEST()
492 bignum.MultiplyByUInt32(0x4); in TEST()
493 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
496 AssignHexString(&bignum, "FFFFFFFFFFFFFFFF"); in TEST()
497 bignum.MultiplyByUInt32(0xF); in TEST()
498 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
501 AssignHexString(&bignum, "FFFFFFFFFFFFFFFF"); in TEST()
502 bignum.MultiplyByUInt32(0xFFFFFF); in TEST()
503 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
506 bignum.AssignUInt16(0x1); in TEST()
507 bignum.ShiftLeft(100); in TEST()
509 bignum.MultiplyByUInt32(2); in TEST()
510 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
513 bignum.AssignUInt16(0x1); in TEST()
514 bignum.ShiftLeft(100); in TEST()
516 bignum.MultiplyByUInt32(0xF); in TEST()
517 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
520 bignum.AssignUInt16(0xFFFF); in TEST()
521 bignum.ShiftLeft(100); in TEST()
523 bignum.MultiplyByUInt32(0xFFFF); in TEST()
524 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
527 bignum.AssignUInt16(0xFFFF); in TEST()
528 bignum.ShiftLeft(100); in TEST()
530 bignum.MultiplyByUInt32(0xFFFFFFFF); in TEST()
531 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
534 bignum.AssignUInt16(0xFFFF); in TEST()
535 bignum.ShiftLeft(100); in TEST()
537 bignum.MultiplyByUInt32(0xFFFFFFFF); in TEST()
538 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
541 AssignDecimalString(&bignum, "15611230384529777"); in TEST()
542 bignum.MultiplyByUInt32(10000000); in TEST()
543 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
550 Bignum bignum; in TEST() local
552 AssignHexString(&bignum, "0"); in TEST()
553 bignum.MultiplyByUInt64(0x25); in TEST()
554 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
557 AssignHexString(&bignum, "2"); in TEST()
558 bignum.MultiplyByUInt64(0x5); in TEST()
559 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
562 AssignHexString(&bignum, "10000000"); in TEST()
563 bignum.MultiplyByUInt64(0x9); in TEST()
564 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
567 AssignHexString(&bignum, "100000000000000"); in TEST()
568 bignum.MultiplyByUInt64(0xFFFF); in TEST()
569 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
572 AssignHexString(&bignum, "100000000000000"); in TEST()
573 bignum.MultiplyByUInt64(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF)); in TEST()
574 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
577 AssignHexString(&bignum, "1234567ABCD"); in TEST()
578 bignum.MultiplyByUInt64(0xFFF); in TEST()
579 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
582 AssignHexString(&bignum, "1234567ABCD"); in TEST()
583 bignum.MultiplyByUInt64(V8_2PART_UINT64_C(0xFF, FFFFFFFF)); in TEST()
584 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
587 AssignHexString(&bignum, "FFFFFFFFFFFFFFFF"); in TEST()
588 bignum.MultiplyByUInt64(0x2); in TEST()
589 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
592 AssignHexString(&bignum, "FFFFFFFFFFFFFFFF"); in TEST()
593 bignum.MultiplyByUInt64(0x4); in TEST()
594 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
597 AssignHexString(&bignum, "FFFFFFFFFFFFFFFF"); in TEST()
598 bignum.MultiplyByUInt64(0xF); in TEST()
599 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
602 AssignHexString(&bignum, "FFFFFFFFFFFFFFFF"); in TEST()
603 bignum.MultiplyByUInt64(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF)); in TEST()
604 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
607 bignum.AssignUInt16(0x1); in TEST()
608 bignum.ShiftLeft(100); in TEST()
610 bignum.MultiplyByUInt64(2); in TEST()
611 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
614 bignum.AssignUInt16(0x1); in TEST()
615 bignum.ShiftLeft(100); in TEST()
617 bignum.MultiplyByUInt64(0xF); in TEST()
618 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
621 bignum.AssignUInt16(0xFFFF); in TEST()
622 bignum.ShiftLeft(100); in TEST()
624 bignum.MultiplyByUInt64(0xFFFF); in TEST()
625 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
628 bignum.AssignUInt16(0xFFFF); in TEST()
629 bignum.ShiftLeft(100); in TEST()
631 bignum.MultiplyByUInt64(0xFFFFFFFF); in TEST()
632 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
635 bignum.AssignUInt16(0xFFFF); in TEST()
636 bignum.ShiftLeft(100); in TEST()
638 bignum.MultiplyByUInt64(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF)); in TEST()
639 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
642 AssignDecimalString(&bignum, "15611230384529777"); in TEST()
643 bignum.MultiplyByUInt64(V8_2PART_UINT64_C(0x8ac72304, 89e80000)); in TEST()
644 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
651 Bignum bignum; in TEST() local
653 AssignDecimalString(&bignum, "1234"); in TEST()
654 bignum.MultiplyByPowerOfTen(1); in TEST()
655 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
658 AssignDecimalString(&bignum, "1234"); in TEST()
659 bignum.MultiplyByPowerOfTen(2); in TEST()
660 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
663 AssignDecimalString(&bignum, "1234"); in TEST()
664 bignum.MultiplyByPowerOfTen(3); in TEST()
665 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
668 AssignDecimalString(&bignum, "1234"); in TEST()
669 bignum.MultiplyByPowerOfTen(4); in TEST()
670 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
673 AssignDecimalString(&bignum, "1234"); in TEST()
674 bignum.MultiplyByPowerOfTen(5); in TEST()
675 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
678 AssignDecimalString(&bignum, "1234"); in TEST()
679 bignum.MultiplyByPowerOfTen(6); in TEST()
680 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
683 AssignDecimalString(&bignum, "1234"); in TEST()
684 bignum.MultiplyByPowerOfTen(7); in TEST()
685 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
688 AssignDecimalString(&bignum, "1234"); in TEST()
689 bignum.MultiplyByPowerOfTen(8); in TEST()
690 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
693 AssignDecimalString(&bignum, "1234"); in TEST()
694 bignum.MultiplyByPowerOfTen(9); in TEST()
695 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
698 AssignDecimalString(&bignum, "1234"); in TEST()
699 bignum.MultiplyByPowerOfTen(10); in TEST()
700 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
703 AssignDecimalString(&bignum, "1234"); in TEST()
704 bignum.MultiplyByPowerOfTen(11); in TEST()
705 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
708 AssignDecimalString(&bignum, "1234"); in TEST()
709 bignum.MultiplyByPowerOfTen(12); in TEST()
710 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
713 AssignDecimalString(&bignum, "1234"); in TEST()
714 bignum.MultiplyByPowerOfTen(13); in TEST()
715 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
718 AssignDecimalString(&bignum, "1234"); in TEST()
719 bignum.MultiplyByPowerOfTen(14); in TEST()
720 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
723 AssignDecimalString(&bignum, "1234"); in TEST()
724 bignum.MultiplyByPowerOfTen(15); in TEST()
725 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
728 AssignDecimalString(&bignum, "1234"); in TEST()
729 bignum.MultiplyByPowerOfTen(16); in TEST()
730 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
733 AssignDecimalString(&bignum, "1234"); in TEST()
734 bignum.MultiplyByPowerOfTen(17); in TEST()
735 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
738 AssignDecimalString(&bignum, "1234"); in TEST()
739 bignum.MultiplyByPowerOfTen(18); in TEST()
740 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
743 AssignDecimalString(&bignum, "1234"); in TEST()
744 bignum.MultiplyByPowerOfTen(19); in TEST()
745 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
748 AssignDecimalString(&bignum, "1234"); in TEST()
749 bignum.MultiplyByPowerOfTen(20); in TEST()
750 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
753 AssignDecimalString(&bignum, "1234"); in TEST()
754 bignum.MultiplyByPowerOfTen(21); in TEST()
755 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
758 AssignDecimalString(&bignum, "1234"); in TEST()
759 bignum.MultiplyByPowerOfTen(22); in TEST()
760 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
763 AssignDecimalString(&bignum, "1234"); in TEST()
764 bignum.MultiplyByPowerOfTen(23); in TEST()
765 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
768 AssignDecimalString(&bignum, "1234"); in TEST()
769 bignum.MultiplyByPowerOfTen(24); in TEST()
770 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
773 AssignDecimalString(&bignum, "1234"); in TEST()
774 bignum.MultiplyByPowerOfTen(25); in TEST()
775 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
778 AssignDecimalString(&bignum, "1234"); in TEST()
779 bignum.MultiplyByPowerOfTen(26); in TEST()
780 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
783 AssignDecimalString(&bignum, "1234"); in TEST()
784 bignum.MultiplyByPowerOfTen(27); in TEST()
785 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
788 AssignDecimalString(&bignum, "1234"); in TEST()
789 bignum.MultiplyByPowerOfTen(28); in TEST()
790 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
793 AssignDecimalString(&bignum, "1234"); in TEST()
794 bignum.MultiplyByPowerOfTen(29); in TEST()
795 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
798 AssignDecimalString(&bignum, "1234"); in TEST()
799 bignum.MultiplyByPowerOfTen(30); in TEST()
800 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
803 AssignDecimalString(&bignum, "1234"); in TEST()
804 bignum.MultiplyByPowerOfTen(31); in TEST()
805 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
808 AssignDecimalString(&bignum, "1234"); in TEST()
809 bignum.MultiplyByPowerOfTen(50); in TEST()
810 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
813 AssignDecimalString(&bignum, "1234"); in TEST()
814 bignum.MultiplyByPowerOfTen(100); in TEST()
815 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
819 AssignDecimalString(&bignum, "1234"); in TEST()
820 bignum.MultiplyByPowerOfTen(200); in TEST()
821 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
826 AssignDecimalString(&bignum, "1234"); in TEST()
827 bignum.MultiplyByPowerOfTen(500); in TEST()
828 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
837 AssignDecimalString(&bignum, "1234"); in TEST()
838 bignum.MultiplyByPowerOfTen(1000); in TEST()
839 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
876 bignum.AssignBignum(bignum2); in TEST()
877 bignum.MultiplyByPowerOfTen(1); in TEST()
878 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
887 bignum.AssignBignum(bignum2); in TEST()
888 bignum.MultiplyByPowerOfTen(2); in TEST()
889 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
898 bignum.AssignBignum(bignum2); in TEST()
899 bignum.MultiplyByPowerOfTen(5); in TEST()
900 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
909 bignum.AssignBignum(bignum2); in TEST()
910 bignum.MultiplyByPowerOfTen(10); in TEST()
911 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
920 bignum.AssignBignum(bignum2); in TEST()
921 bignum.MultiplyByPowerOfTen(50); in TEST()
922 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
932 bignum.AssignBignum(bignum2); in TEST()
933 bignum.MultiplyByPowerOfTen(100); in TEST()
934 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
945 bignum.AssignBignum(bignum2); in TEST()
946 bignum.MultiplyByPowerOfTen(200); in TEST()
947 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
959 bignum.AssignBignum(bignum2); in TEST()
960 bignum.MultiplyByPowerOfTen(500); in TEST()
961 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
981 Bignum bignum; in TEST() local
985 bignum.AssignUInt16(10); in TEST()
987 CHECK_EQ(5, bignum.DivideModuloIntBignum(other)); in TEST()
988 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
991 bignum.AssignUInt16(10); in TEST()
992 bignum.ShiftLeft(500); in TEST()
995 CHECK_EQ(5, bignum.DivideModuloIntBignum(other)); in TEST()
998 bignum.AssignUInt16(11); in TEST()
1000 CHECK_EQ(5, bignum.DivideModuloIntBignum(other)); in TEST()
1001 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1004 bignum.AssignUInt16(10); in TEST()
1005 bignum.ShiftLeft(500); in TEST()
1007 bignum.AddBignum(other); in TEST()
1010 CHECK_EQ(5, bignum.DivideModuloIntBignum(other)); in TEST()
1011 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1014 bignum.AssignUInt16(10); in TEST()
1015 bignum.ShiftLeft(500); in TEST()
1016 other.AssignBignum(bignum); in TEST()
1017 bignum.MultiplyByUInt32(0x1234); in TEST()
1019 bignum.AddBignum(third); in TEST()
1020 CHECK_EQ(0x1234, bignum.DivideModuloIntBignum(other)); in TEST()
1021 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1024 bignum.AssignUInt16(10); in TEST()
1026 CHECK_EQ(0, bignum.DivideModuloIntBignum(other)); in TEST()
1027 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1030 AssignHexString(&bignum, "12345678"); in TEST()
1032 CHECK_EQ(5, bignum.DivideModuloIntBignum(other)); in TEST()
1033 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1036 AssignHexString(&bignum, "70000001"); in TEST()
1038 CHECK_EQ(3, bignum.DivideModuloIntBignum(other)); in TEST()
1039 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1042 AssignHexString(&bignum, "28000000"); in TEST()
1044 CHECK_EQ(2, bignum.DivideModuloIntBignum(other)); in TEST()
1045 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1048 bignum.AssignUInt16(10); in TEST()
1049 bignum.ShiftLeft(500); in TEST()
1050 other.AssignBignum(bignum); in TEST()
1051 bignum.MultiplyByUInt32(0x1234); in TEST()
1054 CHECK_EQ(0x1234, bignum.DivideModuloIntBignum(other)); in TEST()
1055 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1057 CHECK_EQ(0, bignum.DivideModuloIntBignum(other)); in TEST()
1058 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1360 Bignum bignum; in TEST() local
1363 bignum.AssignUInt16(1); in TEST()
1364 bignum.Square(); in TEST()
1365 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1368 bignum.AssignUInt16(2); in TEST()
1369 bignum.Square(); in TEST()
1370 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1373 bignum.AssignUInt16(10); in TEST()
1374 bignum.Square(); in TEST()
1375 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1378 AssignHexString(&bignum, "FFFFFFF"); in TEST()
1379 bignum.Square(); in TEST()
1380 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1383 AssignHexString(&bignum, "FFFFFFFFFFFFFF"); in TEST()
1384 bignum.Square(); in TEST()
1385 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1391 Bignum bignum; in TEST() local
1394 bignum.AssignPowerUInt16(1, 0); in TEST()
1395 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1398 bignum.AssignPowerUInt16(1, 1); in TEST()
1399 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1402 bignum.AssignPowerUInt16(1, 2); in TEST()
1403 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1406 bignum.AssignPowerUInt16(2, 0); in TEST()
1407 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1410 bignum.AssignPowerUInt16(2, 1); in TEST()
1411 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1414 bignum.AssignPowerUInt16(2, 2); in TEST()
1415 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1418 bignum.AssignPowerUInt16(16, 1); in TEST()
1419 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1422 bignum.AssignPowerUInt16(16, 2); in TEST()
1423 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1426 bignum.AssignPowerUInt16(16, 5); in TEST()
1427 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1430 bignum.AssignPowerUInt16(16, 8); in TEST()
1431 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1434 bignum.AssignPowerUInt16(16, 16); in TEST()
1435 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1438 bignum.AssignPowerUInt16(16, 30); in TEST()
1439 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1442 bignum.AssignPowerUInt16(10, 0); in TEST()
1443 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1446 bignum.AssignPowerUInt16(10, 1); in TEST()
1447 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1450 bignum.AssignPowerUInt16(10, 2); in TEST()
1451 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1454 bignum.AssignPowerUInt16(10, 5); in TEST()
1455 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1458 bignum.AssignPowerUInt16(10, 8); in TEST()
1459 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1462 bignum.AssignPowerUInt16(10, 16); in TEST()
1463 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1466 bignum.AssignPowerUInt16(10, 30); in TEST()
1467 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1470 bignum.AssignPowerUInt16(10, 31); in TEST()
1471 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1474 bignum.AssignPowerUInt16(2, 0); in TEST()
1475 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1478 bignum.AssignPowerUInt16(2, 100); in TEST()
1479 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1482 bignum.AssignPowerUInt16(17, 0); in TEST()
1483 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1486 bignum.AssignPowerUInt16(17, 99); in TEST()
1487 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()
1492 bignum.AssignPowerUInt16(0xFFFF, 99); in TEST()
1493 CHECK(bignum.ToHexString(buffer, kBufferSize)); in TEST()