36 using namespace v8::internal;
39 static const int kBufferSize = 1024;
41 static void AssignHexString(
Bignum* bignum,
const char* str) {
46 static void AssignDecimalString(
Bignum* bignum,
const char* str) {
52 char buffer[kBufferSize];
87 CHECK_EQ(
"FFFFFFFFFFFFFFFF", buffer);
92 CHECK_EQ(
"123456789ABCDEF0", buffer);
96 CHECK_EQ(
"123456789ABCDEF0", buffer);
98 AssignDecimalString(&bignum,
"0");
102 AssignDecimalString(&bignum,
"1");
106 AssignDecimalString(&bignum,
"1234567890");
110 AssignHexString(&bignum,
"0");
114 AssignHexString(&bignum,
"123456789ABCDEF0");
116 CHECK_EQ(
"123456789ABCDEF0", buffer);
121 char buffer[kBufferSize];
123 AssignHexString(&bignum,
"0");
128 AssignHexString(&bignum,
"1");
133 AssignHexString(&bignum,
"1");
138 AssignHexString(&bignum,
"1");
143 AssignHexString(&bignum,
"1");
146 CHECK_EQ(
"10000000000000000", buffer);
148 AssignHexString(&bignum,
"123456789ABCDEF");
151 CHECK_EQ(
"123456789ABCDEF0000000000000000", buffer);
154 CHECK_EQ(
"2468ACF13579BDE0000000000000000", buffer);
159 char buffer[kBufferSize];
161 AssignHexString(&bignum,
"0");
166 AssignHexString(&bignum,
"1");
171 AssignHexString(&bignum,
"1");
176 AssignHexString(&bignum,
"1");
181 AssignHexString(&bignum,
"FFFFFFF");
186 AssignHexString(&bignum,
"10000000000000000000000000000000000000000000");
189 CHECK_EQ(
"1000000000000000000000000000000000000000FFFF", buffer);
191 AssignHexString(&bignum,
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
194 CHECK_EQ(
"100000000000000000000000000000000000000000000", buffer);
200 CHECK_EQ(
"10000000000000000000000001", buffer);
206 CHECK_EQ(
"1000000000000000000000FFFF", buffer);
208 AssignHexString(&bignum,
"0");
213 AssignHexString(&bignum,
"1");
218 AssignHexString(&bignum,
"1");
223 AssignHexString(&bignum,
"1");
228 AssignHexString(&bignum,
"FFFFFFF");
233 AssignHexString(&bignum,
"10000000000000000000000000000000000000000000");
236 CHECK_EQ(
"10000000000000000000000000000000FFFF00000000", buffer);
238 AssignHexString(&bignum,
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
241 CHECK_EQ(
"1000000000000000000000000000000000000FFFFFFFF", buffer);
247 CHECK_EQ(
"10000000000000000100000000", buffer);
253 CHECK_EQ(
"10000000000000FFFF00000000", buffer);
258 char buffer[kBufferSize];
262 AssignHexString(&other,
"1");
263 AssignHexString(&bignum,
"0");
268 AssignHexString(&bignum,
"1");
273 AssignHexString(&bignum,
"FFFFFFF");
278 AssignHexString(&bignum,
"FFFFFFFFFFFFFF");
281 CHECK_EQ(
"100000000000000", buffer);
283 AssignHexString(&bignum,
"10000000000000000000000000000000000000000000");
286 CHECK_EQ(
"10000000000000000000000000000000000000000001", buffer);
288 AssignHexString(&other,
"1000000000000");
290 AssignHexString(&bignum,
"1");
295 AssignHexString(&bignum,
"FFFFFFF");
300 AssignHexString(&bignum,
"10000000000000000000000000000000000000000000");
303 CHECK_EQ(
"10000000000000000000000000000001000000000000", buffer);
305 AssignHexString(&bignum,
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
308 CHECK_EQ(
"1000000000000000000000000000000FFFFFFFFFFFF", buffer);
314 CHECK_EQ(
"10000000000001000000000000", buffer);
322 CHECK_EQ(
"10000000000000000000000000001", buffer);
324 AssignHexString(&bignum,
"FFFFFFF");
327 CHECK_EQ(
"1000000000000000000000FFFFFFF", buffer);
329 AssignHexString(&bignum,
"10000000000000000000000000000000000000000000");
332 CHECK_EQ(
"10000000000000010000000000000000000000000000", buffer);
334 AssignHexString(&bignum,
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
337 CHECK_EQ(
"100000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFF", buffer);
343 CHECK_EQ(
"10010000000000000000000000000", buffer);
348 char buffer[kBufferSize];
352 AssignHexString(&bignum,
"1");
353 AssignHexString(&other,
"0");
358 AssignHexString(&bignum,
"2");
359 AssignHexString(&other,
"0");
364 AssignHexString(&bignum,
"10000000");
365 AssignHexString(&other,
"1");
370 AssignHexString(&bignum,
"100000000000000");
371 AssignHexString(&other,
"1");
376 AssignHexString(&bignum,
"10000000000000000000000000000000000000000001");
377 AssignHexString(&other,
"1");
380 CHECK_EQ(
"10000000000000000000000000000000000000000000", buffer);
382 AssignHexString(&bignum,
"1000000000001");
383 AssignHexString(&other,
"1000000000000");
388 AssignHexString(&bignum,
"100000FFFFFFF");
389 AssignHexString(&other,
"1000000000000");
394 AssignHexString(&bignum,
"10000000000000000000000000000001000000000000");
395 AssignHexString(&other,
"1000000000000");
398 CHECK_EQ(
"10000000000000000000000000000000000000000000", buffer);
400 AssignHexString(&bignum,
"1000000000000000000000000000000FFFFFFFFFFFF");
401 AssignHexString(&other,
"1000000000000");
404 CHECK_EQ(
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", buffer);
409 AssignHexString(&other,
"1000000000000");
412 CHECK_EQ(
"FFFFFFFFFFFFF000000000000", buffer);
414 AssignHexString(&other,
"1000000000000");
423 CHECK_EQ(
"F000000000000000000000000", buffer);
428 AssignHexString(&bignum,
"FFFFFFF");
433 CHECK_EQ(
"FFFFFFEFFFFFF800000000", buffer);
435 AssignHexString(&bignum,
"10000000000000000000000000000000000000000000");
438 CHECK_EQ(
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF800000000", buffer);
440 AssignHexString(&bignum,
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
443 CHECK_EQ(
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFF", buffer);
448 char buffer[kBufferSize];
451 AssignHexString(&bignum,
"0");
456 AssignHexString(&bignum,
"2");
461 AssignHexString(&bignum,
"10000000");
466 AssignHexString(&bignum,
"100000000000000");
469 CHECK_EQ(
"FFFF00000000000000", buffer);
471 AssignHexString(&bignum,
"100000000000000");
474 CHECK_EQ(
"FFFFFFFF00000000000000", buffer);
476 AssignHexString(&bignum,
"1234567ABCD");
481 AssignHexString(&bignum,
"1234567ABCD");
484 CHECK_EQ(
"12345679998A985433", buffer);
486 AssignHexString(&bignum,
"FFFFFFFFFFFFFFFF");
489 CHECK_EQ(
"1FFFFFFFFFFFFFFFE", buffer);
491 AssignHexString(&bignum,
"FFFFFFFFFFFFFFFF");
494 CHECK_EQ(
"3FFFFFFFFFFFFFFFC", buffer);
496 AssignHexString(&bignum,
"FFFFFFFFFFFFFFFF");
499 CHECK_EQ(
"EFFFFFFFFFFFFFFF1", buffer);
501 AssignHexString(&bignum,
"FFFFFFFFFFFFFFFF");
504 CHECK_EQ(
"FFFFFEFFFFFFFFFF000001", buffer);
511 CHECK_EQ(
"20000000000000000000000000", buffer);
518 CHECK_EQ(
"F0000000000000000000000000", buffer);
525 CHECK_EQ(
"FFFE00010000000000000000000000000", buffer);
532 CHECK_EQ(
"FFFEFFFF00010000000000000000000000000", buffer);
539 CHECK_EQ(
"FFFEFFFF00010000000000000000000000000", buffer);
541 AssignDecimalString(&bignum,
"15611230384529777");
544 CHECK_EQ(
"210EDD6D4CDD2580EE80", buffer);
549 char buffer[kBufferSize];
552 AssignHexString(&bignum,
"0");
557 AssignHexString(&bignum,
"2");
562 AssignHexString(&bignum,
"10000000");
567 AssignHexString(&bignum,
"100000000000000");
570 CHECK_EQ(
"FFFF00000000000000", buffer);
572 AssignHexString(&bignum,
"100000000000000");
575 CHECK_EQ(
"FFFFFFFFFFFFFFFF00000000000000", buffer);
577 AssignHexString(&bignum,
"1234567ABCD");
582 AssignHexString(&bignum,
"1234567ABCD");
585 CHECK_EQ(
"1234567ABCBDCBA985433", buffer);
587 AssignHexString(&bignum,
"FFFFFFFFFFFFFFFF");
590 CHECK_EQ(
"1FFFFFFFFFFFFFFFE", buffer);
592 AssignHexString(&bignum,
"FFFFFFFFFFFFFFFF");
595 CHECK_EQ(
"3FFFFFFFFFFFFFFFC", buffer);
597 AssignHexString(&bignum,
"FFFFFFFFFFFFFFFF");
600 CHECK_EQ(
"EFFFFFFFFFFFFFFF1", buffer);
602 AssignHexString(&bignum,
"FFFFFFFFFFFFFFFF");
605 CHECK_EQ(
"FFFFFFFFFFFFFFFE0000000000000001", buffer);
612 CHECK_EQ(
"20000000000000000000000000", buffer);
619 CHECK_EQ(
"F0000000000000000000000000", buffer);
626 CHECK_EQ(
"FFFE00010000000000000000000000000", buffer);
633 CHECK_EQ(
"FFFEFFFF00010000000000000000000000000", buffer);
640 CHECK_EQ(
"FFFEFFFFFFFFFFFF00010000000000000000000000000", buffer);
642 AssignDecimalString(&bignum,
"15611230384529777");
645 CHECK_EQ(
"1E10EE4B11D15A7F3DE7F3C7680000", buffer);
650 char buffer[kBufferSize];
653 AssignDecimalString(&bignum,
"1234");
658 AssignDecimalString(&bignum,
"1234");
663 AssignDecimalString(&bignum,
"1234");
668 AssignDecimalString(&bignum,
"1234");
673 AssignDecimalString(&bignum,
"1234");
678 AssignDecimalString(&bignum,
"1234");
683 AssignDecimalString(&bignum,
"1234");
688 AssignDecimalString(&bignum,
"1234");
693 AssignDecimalString(&bignum,
"1234");
698 AssignDecimalString(&bignum,
"1234");
703 AssignDecimalString(&bignum,
"1234");
708 AssignDecimalString(&bignum,
"1234");
713 AssignDecimalString(&bignum,
"1234");
718 AssignDecimalString(&bignum,
"1234");
721 CHECK_EQ(
"1B667A56D488000", buffer);
723 AssignDecimalString(&bignum,
"1234");
726 CHECK_EQ(
"11200C7644D50000", buffer);
728 AssignDecimalString(&bignum,
"1234");
731 CHECK_EQ(
"AB407C9EB0520000", buffer);
733 AssignDecimalString(&bignum,
"1234");
736 CHECK_EQ(
"6B084DE32E3340000", buffer);
738 AssignDecimalString(&bignum,
"1234");
741 CHECK_EQ(
"42E530ADFCE0080000", buffer);
743 AssignDecimalString(&bignum,
"1234");
746 CHECK_EQ(
"29CF3E6CBE0C0500000", buffer);
748 AssignDecimalString(&bignum,
"1234");
751 CHECK_EQ(
"1A218703F6C783200000", buffer);
753 AssignDecimalString(&bignum,
"1234");
756 CHECK_EQ(
"1054F4627A3CB1F400000", buffer);
758 AssignDecimalString(&bignum,
"1234");
761 CHECK_EQ(
"A3518BD8C65EF38800000", buffer);
763 AssignDecimalString(&bignum,
"1234");
766 CHECK_EQ(
"6612F7677BFB5835000000", buffer);
768 AssignDecimalString(&bignum,
"1234");
771 CHECK_EQ(
"3FCBDAA0AD7D17212000000", buffer);
773 AssignDecimalString(&bignum,
"1234");
776 CHECK_EQ(
"27DF68A46C6E2E74B4000000", buffer);
778 AssignDecimalString(&bignum,
"1234");
781 CHECK_EQ(
"18EBA166C3C4DD08F08000000", buffer);
783 AssignDecimalString(&bignum,
"1234");
786 CHECK_EQ(
"F9344E03A5B0A259650000000", buffer);
788 AssignDecimalString(&bignum,
"1234");
791 CHECK_EQ(
"9BC0B0C2478E6577DF20000000", buffer);
793 AssignDecimalString(&bignum,
"1234");
796 CHECK_EQ(
"61586E796CB8FF6AEB740000000", buffer);
798 AssignDecimalString(&bignum,
"1234");
801 CHECK_EQ(
"3CD7450BE3F39FA2D32880000000", buffer);
803 AssignDecimalString(&bignum,
"1234");
806 CHECK_EQ(
"26068B276E7843C5C3F9500000000", buffer);
808 AssignDecimalString(&bignum,
"1234");
811 CHECK_EQ(
"149D1B4CFED03B23AB5F4E1196EF45C08000000000000", buffer);
813 AssignDecimalString(&bignum,
"1234");
816 CHECK_EQ(
"5827249F27165024FBC47DFCA9359BF316332D1B91ACEECF471FBAB06D9B2"
817 "0000000000000000000000000", buffer);
819 AssignDecimalString(&bignum,
"1234");
822 CHECK_EQ(
"64C1F5C06C3816AFBF8DAFD5A3D756365BB0FD020E6F084E759C1F7C99E4F"
823 "55B9ACC667CEC477EB958C2AEEB3C6C19BA35A1AD30B35C51EB72040920000"
824 "0000000000000000000000000000000000000000000000", buffer);
826 AssignDecimalString(&bignum,
"1234");
829 CHECK_EQ(
"96741A625EB5D7C91039FEB5C5ACD6D9831EDA5B083D800E6019442C8C8223"
830 "3EAFB3501FE2058062221E15121334928880827DEE1EC337A8B26489F3A40A"
831 "CB440A2423734472D10BFCE886F41B3AF9F9503013D86D088929CA86EEB4D8"
832 "B9C831D0BD53327B994A0326227CFD0ECBF2EB48B02387AAE2D4CCCDF1F1A1"
833 "B8CC4F1FA2C56AD40D0E4DAA9C28CDBF0A549098EA13200000000000000000"
834 "00000000000000000000000000000000000000000000000000000000000000"
835 "0000000000000000000000000000000000000000000000", buffer);
837 AssignDecimalString(&bignum,
"1234");
840 CHECK_EQ(
"1258040F99B1CD1CC9819C676D413EA50E4A6A8F114BB0C65418C62D399B81"
841 "6361466CA8E095193E1EE97173553597C96673AF67FAFE27A66E7EF2E5EF2E"
842 "E3F5F5070CC17FE83BA53D40A66A666A02F9E00B0E11328D2224B8694C7372"
843 "F3D536A0AD1985911BD361496F268E8B23112500EAF9B88A9BC67B2AB04D38"
844 "7FEFACD00F5AF4F764F9ABC3ABCDE54612DE38CD90CB6647CA389EA0E86B16"
845 "BF7A1F34086E05ADBE00BD1673BE00FAC4B34AF1091E8AD50BA675E0381440"
846 "EA8E9D93E75D816BAB37C9844B1441C38FC65CF30ABB71B36433AF26DD97BD"
847 "ABBA96C03B4919B8F3515B92826B85462833380DC193D79F69D20DD6038C99"
848 "6114EF6C446F0BA28CC772ACBA58B81C04F8FFDE7B18C4E5A3ABC51E637FDF"
849 "6E37FDFF04C940919390F4FF92000000000000000000000000000000000000"
850 "00000000000000000000000000000000000000000000000000000000000000"
851 "00000000000000000000000000000000000000000000000000000000000000"
852 "00000000000000000000000000000000000000000000000000000000000000"
853 "0000000000000000000000000000", buffer);
856 AssignHexString(&bignum2,
"3DA774C07FB5DF54284D09C675A492165B830D5DAAEB2A7501"
857 "DA17CF9DFA1CA2282269F92A25A97314296B717E3DCBB9FE17"
858 "41A842FE2913F540F40796F2381155763502C58B15AF7A7F88"
859 "6F744C9164FF409A28F7FA0C41F89ED79C1BE9F322C8578B97"
860 "841F1CBAA17D901BE1230E3C00E1C643AF32638B5674E01FEA"
861 "96FC90864E621B856A9E1CE56E6EB545B9C2F8F0CC10DDA88D"
862 "CC6D282605F8DB67044F2DFD3695E7BA63877AE16701536AE6"
863 "567C794D0BFE338DFBB42D92D4215AF3BB22BF0A8B283FDDC2"
866 CHECK_EQ(
"3DA774C07FB5DF54284D09C675A492165B830D5DAAEB2A7501"
867 "DA17CF9DFA1CA2282269F92A25A97314296B717E3DCBB9FE17"
868 "41A842FE2913F540F40796F2381155763502C58B15AF7A7F88"
869 "6F744C9164FF409A28F7FA0C41F89ED79C1BE9F322C8578B97"
870 "841F1CBAA17D901BE1230E3C00E1C643AF32638B5674E01FEA"
871 "96FC90864E621B856A9E1CE56E6EB545B9C2F8F0CC10DDA88D"
872 "CC6D282605F8DB67044F2DFD3695E7BA63877AE16701536AE6"
873 "567C794D0BFE338DFBB42D92D4215AF3BB22BF0A8B283FDDC2"
874 "C667A10958EA6D2", buffer);
879 CHECK_EQ(
"2688A8F84FD1AB949930261C0986DB4DF931E85A8AD2FA8921284EE1C2BC51"
880 "E55915823BBA5789E7EC99E326EEE69F543ECE890929DED9AC79489884BE57"
881 "630AD569E121BB76ED8DAC8FB545A8AFDADF1F8860599AFC47A93B6346C191"
882 "7237F5BD36B73EB29371F4A4EE7A116CB5E8E5808D1BEA4D7F7E3716090C13"
883 "F29E5DDA53F0FD513362A2D20F6505314B9419DB967F8A8A89589FC43917C3"
884 "BB892062B17CBE421DB0D47E34ACCCE060D422CFF60DCBD0277EE038BD509C"
885 "7BC494D8D854F5B76696F927EA99BC00C4A5D7928434", buffer);
890 CHECK_EQ(
"1815699B31E30B3CDFBE17D185F44910BBBF313896C3DC95B4B9314D19B5B32"
891 "F57AD71655476B630F3E02DF855502394A74115A5BA2B480BCBCD5F52F6F69D"
892 "E6C5622CB5152A54788BD9D14B896DE8CB73B53C3800DDACC9C51E0C38FAE76"
893 "2F9964232872F9C2738E7150C4AE3F1B18F70583172706FAEE26DC5A78C77A2"
894 "FAA874769E52C01DA5C3499F233ECF3C90293E0FB69695D763DAA3AEDA5535B"
895 "43DAEEDF6E9528E84CEE0EC000C3C8495C1F9C89F6218AF4C23765261CD5ADD"
896 "0787351992A01E5BB8F2A015807AE7A6BB92A08", buffer);
901 CHECK_EQ(
"5E13A4863ADEE3E5C9FE8D0A73423D695D62D8450CED15A8C9F368952C6DC3"
902 "F0EE7D82F3D1EFB7AF38A3B3920D410AFCAD563C8F5F39116E141A3C5C14B3"
903 "58CD73077EA35AAD59F6E24AD98F10D5555ABBFBF33AC361EAF429FD5FBE94"
904 "17DA9EF2F2956011F9F93646AA38048A681D984ED88127073443247CCC167C"
905 "B354A32206EF5A733E73CF82D795A1AD598493211A6D613C39515E0E0F6304"
906 "DCD9C810F3518C7F6A7CB6C81E99E02FCC65E8FDB7B7AE97306CC16A8631CE"
907 "0A2AEF6568276BE4C176964A73C153FDE018E34CB4C2F40", buffer);
912 CHECK_EQ(
"8F8CB8EB51945A7E815809F6121EF2F4E61EF3405CD9432CAD2709749EEAFD"
913 "1B81E843F14A3667A7BDCCC9E0BB795F63CDFDB62844AC7438976C885A0116"
914 "29607DA54F9C023CC366570B7637ED0F855D931752038A614922D0923E382C"
915 "B8E5F6C975672DB76E0DE471937BB9EDB11E28874F1C122D5E1EF38CECE9D0"
916 "0723056BCBD4F964192B76830634B1D322B7EB0062F3267E84F5C824343A77"
917 "4B7DCEE6DD464F01EBDC8C671BB18BB4EF4300A42474A6C77243F2A12B03BF"
918 "0443C38A1C0D2701EDB393135AE0DEC94211F9D4EB51F990800", buffer);
923 CHECK_EQ(
"107A8BE345E24407372FC1DE442CBA696BC23C4FFD5B4BDFD9E5C39559815"
924 "86628CF8472D2D589F2FC2BAD6E0816EC72CBF85CCA663D8A1EC6C51076D8"
925 "2D247E6C26811B7EC4D4300FB1F91028DCB7B2C4E7A60C151161AA7E65E79"
926 "B40917B12B2B5FBE7745984D4E8EFA31F9AE6062427B068B144A9CB155873"
927 "E7C0C9F0115E5AC72DC5A73C4796DB970BF9205AB8C77A6996EB1B417F9D1"
928 "6232431E6313C392203601B9C22CC10DDA88DCC6D282605F8DB67044F2DFD"
929 "3695E7BA63877AE16701536AE6567C794D0BFE338DFBB42D924CF964BD2C0"
930 "F586E03A2FCD35A408000000000000", buffer);
935 CHECK_EQ(
"46784A90ACD0ED3E7759CC585FB32D36EB6034A6F78D92604E3BAA5ED3D8B"
936 "6E60E854439BE448897FB4B7EA5A3D873AA0FCB3CFFD80D0530880E45F511"
937 "722A50CE7E058B5A6F5464DB7500E34984EE3202A9441F44FA1554C0CEA96"
938 "B438A36F25E7C9D56D71AE2CD313EC37534DA299AC0854FC48591A7CF3171"
939 "31265AA4AE62DE32344CE7BEEEF894AE686A2DAAFE5D6D9A10971FFD9C064"
940 "5079B209E1048F58B5192D41D84336AC4C8C489EEF00939CFC9D55C122036"
941 "01B9C22CC10DDA88DCC6D282605F8DB67044F2DFD3695E7BA3F67B96D3A32"
942 "E11FB5561B68744C4035B0800DC166D49D98E3FD1D5BB2000000000000000"
943 "0000000000", buffer);
948 CHECK_EQ(
"508BD351221DF139D72D88CDC0416845A53EE2D0E6B98352509A9AC312F8C"
949 "6CB1A144889416201E0B6CE66EA3EBE259B5FD79ECFC1FD77963CE516CC7E"
950 "2FE73D4B5B710C19F6BCB092C7A2FD76286543B8DBD2C596DFF2C896720BA"
951 "DFF7BC9C366ACEA3A880AEC287C5E6207DF2739B5326FC19D773BD830B109"
952 "ED36C7086544BF8FDB9D4B73719C2B5BC2F571A5937EC46876CD428281F6B"
953 "F287E1E07F25C1B1D46BC37324FF657A8B2E0071DB83B86123CA34004F406"
954 "001082D7945E90C6E8C9A9FEC2B44BE0DDA46E9F52B152E4D1336D2FCFBC9"
955 "96E30CA0082256737365158FE36482AA7EB9DAF2AB128F10E7551A3CD5BE6"
956 "0A922F3A7D5EED38B634A7EC95BCF7021BA6820A292000000000000000000"
957 "00000000000000000000000000000000", buffer);
962 CHECK_EQ(
"7845F900E475B5086885BAAAE67C8E85185ACFE4633727F82A4B06B5582AC"
963 "BE933C53357DA0C98C20C5AC900C4D76A97247DF52B79F48F9E35840FB715"
964 "D392CE303E22622B0CF82D9471B398457DD3196F639CEE8BBD2C146873841"
965 "F0699E6C41F04FC7A54B48CEB995BEB6F50FE81DE9D87A8D7F849CC523553"
966 "7B7BBBC1C7CAAFF6E9650BE03B308C6D31012AEF9580F70D3EE2083ADE126"
967 "8940FA7D6308E239775DFD2F8C97FF7EBD525DAFA6512216F7047A62A93DC"
968 "38A0165BDC67E250DCC96A0181DE935A70B38704DC71819F02FC5261FF7E1"
969 "E5F11907678B0A3E519FF4C10A867B0C26CE02BE6960BA8621A87303C101C"
970 "3F88798BB9F7739655946F8B5744E6B1EAF10B0C5621330F0079209033C69"
971 "20DE2E2C8D324F0624463735D482BF291926C22A910F5B80FA25170B6B57D"
972 "8D5928C7BCA3FE87461275F69BD5A1B83181DAAF43E05FC3C72C4E93111B6"
973 "6205EBF49B28FEDFB7E7526CBDA658A332000000000000000000000000000"
974 "0000000000000000000000000000000000000000000000000000000000000"
975 "0000000000000000000000000000000000000", buffer);
980 char buffer[kBufferSize];
1025 AssignHexString(&other,
"1234567890");
1030 AssignHexString(&bignum,
"12345678");
1031 AssignHexString(&other,
"3789012");
1036 AssignHexString(&bignum,
"70000001");
1037 AssignHexString(&other,
"1FFFFFFF");
1042 AssignHexString(&bignum,
"28000000");
1043 AssignHexString(&other,
"12A05F20");
1084 AssignHexString(&bignum1,
"1234567890ABCDEF12345");
1085 AssignHexString(&bignum2,
"1234567890ABCDEF12345");
1088 AssignHexString(&bignum1,
"1234567890ABCDEF12345");
1089 AssignHexString(&bignum2,
"1234567890ABCDEF12346");
1093 AssignHexString(&bignum1,
"1234567890ABCDEF12345");
1095 AssignHexString(&bignum2,
"1234567890ABCDEF12345");
1099 AssignHexString(&bignum1,
"1234567890ABCDEF12345");
1101 AssignHexString(&bignum2,
"1234567890ABCDEF12346");
1108 AssignHexString(&bignum2,
"10000000000000000");
1114 AssignHexString(&bignum2,
"10000000000000001");
1120 AssignHexString(&bignum2,
"10000000000000001");
1125 AssignHexString(&bignum1,
"FFFFFFFFFFFFFFFF");
1131 AssignHexString(&bignum1,
"FFFFFFFFFFFFFFFF");
1138 AssignHexString(&bignum1,
"FFFFFFFFFFFFFFFF");
1145 AssignHexString(&bignum1,
"FFFFFFFFFFFFFFFF");
1152 AssignHexString(&bignum1,
"100000000000000");
1158 AssignHexString(&bignum1,
"100000000000001");
1164 AssignHexString(&bignum1,
"200000000000000");
1196 AssignHexString(&a,
"1234567890ABCDEF12345");
1198 AssignHexString(&c,
"1234567890ABCDEF12345");
1201 AssignHexString(&a,
"1234567890ABCDEF12344");
1203 AssignHexString(&c,
"1234567890ABCDEF12345");
1206 AssignHexString(&a,
"1234567890");
1208 AssignHexString(&b,
"ABCDEF12345");
1209 AssignHexString(&c,
"1234567890ABCDEF12345");
1212 AssignHexString(&a,
"1234567890");
1214 AssignHexString(&b,
"ABCDEF12344");
1215 AssignHexString(&c,
"1234567890ABCDEF12345");
1218 AssignHexString(&a,
"1234567890");
1220 AssignHexString(&b,
"ABCDEF12346");
1221 AssignHexString(&c,
"1234567890ABCDEF12345");
1224 AssignHexString(&a,
"1234567891");
1226 AssignHexString(&b,
"ABCDEF12345");
1227 AssignHexString(&c,
"1234567890ABCDEF12345");
1230 AssignHexString(&a,
"1234567889");
1232 AssignHexString(&b,
"ABCDEF12345");
1233 AssignHexString(&c,
"1234567890ABCDEF12345");
1236 AssignHexString(&a,
"1234567890");
1238 AssignHexString(&b,
"ABCDEF12345");
1240 AssignHexString(&c,
"1234567890ABCDEF12345");
1244 AssignHexString(&a,
"1234567890");
1246 AssignHexString(&b,
"ABCDEF12344");
1248 AssignHexString(&c,
"1234567890ABCDEF12345");
1252 AssignHexString(&a,
"1234567890");
1254 AssignHexString(&b,
"ABCDEF12346");
1256 AssignHexString(&c,
"1234567890ABCDEF12345");
1260 AssignHexString(&a,
"1234567891");
1262 AssignHexString(&b,
"ABCDEF12345");
1264 AssignHexString(&c,
"1234567890ABCDEF12345");
1268 AssignHexString(&a,
"1234567889");
1270 AssignHexString(&b,
"ABCDEF12345");
1272 AssignHexString(&c,
"1234567890ABCDEF12345");
1276 AssignHexString(&a,
"1234567890");
1278 AssignHexString(&b,
"ABCDEF12345");
1280 AssignHexString(&c,
"1234567890ABCDEF1234500000000");
1283 AssignHexString(&a,
"1234567890");
1285 AssignHexString(&b,
"ABCDEF12344");
1287 AssignHexString(&c,
"1234567890ABCDEF1234500000000");
1290 AssignHexString(&a,
"1234567890");
1292 AssignHexString(&b,
"ABCDEF12346");
1294 AssignHexString(&c,
"1234567890ABCDEF1234500000000");
1297 AssignHexString(&a,
"1234567891");
1299 AssignHexString(&b,
"ABCDEF12345");
1301 AssignHexString(&c,
"1234567890ABCDEF1234500000000");
1304 AssignHexString(&a,
"1234567889");
1306 AssignHexString(&b,
"ABCDEF12345");
1308 AssignHexString(&c,
"1234567890ABCDEF1234500000000");
1311 AssignHexString(&a,
"1234567890");
1313 AssignHexString(&b,
"ABCDEF12345");
1314 AssignHexString(&c,
"123456789000000000ABCDEF12345");
1317 AssignHexString(&a,
"1234567890");
1319 AssignHexString(&b,
"ABCDEF12346");
1320 AssignHexString(&c,
"123456789000000000ABCDEF12345");
1323 AssignHexString(&a,
"1234567890");
1325 AssignHexString(&b,
"ABCDEF12344");
1326 AssignHexString(&c,
"123456789000000000ABCDEF12345");
1329 AssignHexString(&a,
"1234567890");
1331 AssignHexString(&b,
"ABCDEF12345");
1333 AssignHexString(&c,
"12345678900000ABCDEF123450000");
1336 AssignHexString(&a,
"1234567890");
1338 AssignHexString(&b,
"ABCDEF12344");
1340 AssignHexString(&c,
"12345678900000ABCDEF123450000");
1343 AssignHexString(&a,
"1234567890");
1345 AssignHexString(&b,
"ABCDEF12345");
1347 AssignHexString(&c,
"12345678900000ABCDEF123450001");
1350 AssignHexString(&a,
"1234567890");
1352 AssignHexString(&b,
"ABCDEF12346");
1354 AssignHexString(&c,
"12345678900000ABCDEF123450000");
1361 char buffer[kBufferSize];
1378 AssignHexString(&bignum,
"FFFFFFF");
1381 CHECK_EQ(
"FFFFFFE0000001", buffer);
1383 AssignHexString(&bignum,
"FFFFFFFFFFFFFF");
1386 CHECK_EQ(
"FFFFFFFFFFFFFE00000000000001", buffer);
1392 char buffer[kBufferSize];
1436 CHECK_EQ(
"10000000000000000", buffer);
1440 CHECK_EQ(
"1000000000000000000000000000000", buffer);
1464 CHECK_EQ(
"2386F26FC10000", buffer);
1468 CHECK_EQ(
"C9F2C9CD04674EDEA40000000", buffer);
1472 CHECK_EQ(
"7E37BE2022C0914B2680000000", buffer);
1480 CHECK_EQ(
"10000000000000000000000000", buffer);
1488 CHECK_EQ(
"1942BB9853FAD924A3D4DD92B89B940E0207BEF05DB9C26BC1B757"
1489 "80BE0C5A2C2990E02A681224F34ED68558CE4C6E33760931",
1494 CHECK_EQ(
"FF9D12F09B886C54E77E7439C7D2DED2D34F669654C0C2B6B8C288250"
1495 "5A2211D0E3DC9A61831349EAE674B11D56E3049D7BD79DAAD6C9FA2BA"
1496 "528E3A794299F2EE9146A324DAFE3E88967A0358233B543E233E575B9"
1497 "DD4E3AA7942146426C328FF55BFD5C45E0901B1629260AF9AE2F310C5"
1498 "50959FAF305C30116D537D80CF6EBDBC15C5694062AF1AC3D956D0A41"
1499 "B7E1B79FF11E21D83387A1CE1F5882B31E4B5D8DE415BDBE6854466DF"
1500 "343362267A7E8833119D31D02E18DB5B0E8F6A64B0ED0D0062FFFF",
void AssignBignum(const Bignum &other)
#define CHECK_EQ(expected, value)
void MultiplyByUInt64(uint64_t factor)
static bool PlusLessEqual(const Bignum &a, const Bignum &b, const Bignum &c)
void AssignUInt64(uint64_t value)
void AddBignum(const Bignum &other)
void AddUInt64(uint64_t operand)
static bool PlusLess(const Bignum &a, const Bignum &b, const Bignum &c)
static int Compare(const Bignum &a, const Bignum &b)
void AssignHexString(Vector< const char > value)
static int PlusCompare(const Bignum &a, const Bignum &b, const Bignum &c)
static bool Equal(const Bignum &a, const Bignum &b)
void AssignPowerUInt16(uint16_t base, int exponent)
int Compare(const T &a, const T &b)
void ShiftLeft(int shift_amount)
uint16_t DivideModuloIntBignum(const Bignum &other)
static bool PlusEqual(const Bignum &a, const Bignum &b, const Bignum &c)
void MultiplyByUInt32(uint32_t factor)
static bool Less(const Bignum &a, const Bignum &b)
#define V8_2PART_UINT64_C(a, b)
int StrLength(const char *string)
void AssignUInt16(uint16_t value)
void SubtractBignum(const Bignum &other)
bool ToHexString(char *buffer, int buffer_size) const
static bool LessEqual(const Bignum &a, const Bignum &b)
void AssignDecimalString(Vector< const char > value)
void MultiplyByPowerOfTen(int exponent)