示例#1
0
//		private static readonly string MSG =
//			"00000000000000000000000000000000"
//			+ "00000000000000000000000000000000"
//			+ "00000000000000000000000000000000"
//			+ "00000000000000000000000000000000"
//			;

        public ChaCha() : base(StreamCipher.ChaCha)
        {
            SegmentedVectorTests.Add(new SegmentedVectorTestCase(
                                         "[K128-IV64] Set 1, vector# 0",
                                         "80000000000000000000000000000000",
                                         "0000000000000000",
                                         new TestVectorSegment[] {
                new TestVectorSegment(
                    "stream[0..63]",
                    0,
                    "FBB87FBB8395E05DAA3B1D683C422046"
                    + "F913985C2AD9B23CFC06C1D8D04FF213"
                    + "D44A7A7CDB84929F915420A8A3DC58BF"
                    + "0F7ECB4B1F167BB1A5E6153FDAF4493D"
                    ),
                new TestVectorSegment(
                    "stream[192..]",
                    192,
                    "D9485D55B8B82D792ED1EEA8E93E9BC1"
                    + "E2834AD0D9B11F3477F6E106A2F6A5F2"
                    + "EA8244D5B925B8050EAB038F58D4DF57"
                    + "7FAFD1B89359DAE508B2B10CBD6B488E"
                    ),
                new TestVectorSegment(
                    "stream[256..]",
                    256,
                    "08661A35D6F02D3D9ACA8087F421F7C8"
                    + "A42579047D6955D937925BA21396DDD4"
                    + "74B1FC4ACCDCAA33025B4BCE817A4FBF"
                    + "3E5D07D151D7E6FE04934ED466BA4779"
                    ),
                new TestVectorSegment(
                    "stream[448..]",
                    448,
                    "A7E16DD38BA48CCB130E5BE9740CE359"
                    + "D631E91600F85C8A5D0785A612D1D987"
                    + "90780ACDDC26B69AB106CCF6D866411D"
                    + "10637483DBF08CC5591FD8B3C87A3AE0"
                    )
            }
                                         ));

            SegmentedVectorTests.Add(new SegmentedVectorTestCase(
                                         "[K128-IV64] Set 1, vector 9",
                                         "00400000000000000000000000000000",
                                         "0000000000000000",
                                         new TestVectorSegment[] {
                new TestVectorSegment(
                    "stream[0..63]",
                    0,
                    "A276339F99316A913885A0A4BE870F06"
                    + "91E72B00F1B3F2239F714FE81E88E00C"
                    + "BBE52B4EBBE1EA15894E29658C4CB145"
                    + "E6F89EE4ABB045A78514482CE75AFB7C"
                    ),
                new TestVectorSegment(
                    "stream[192..]",
                    192,
                    "0DFB9BD4F87F68DE54FBC1C6428FDEB0"
                    + "63E997BE8490C9B7A4694025D6EBA2B1"
                    + "5FE429DB82A7CAE6AAB22918E8D00449"
                    + "6FB6291467B5AE81D4E85E81D8795EBB"
                    ),
                new TestVectorSegment(
                    "stream[256..]",
                    256,
                    "546F5BB315E7F71A46E56D4580F90889"
                    + "639A2BA528F757CF3B048738BA141AF3"
                    + "B31607CB21561BAD94721048930364F4"
                    + "B1227CFEB7CDECBA881FB44903550E68"
                    ),
                new TestVectorSegment(
                    "stream[448..]",
                    448,
                    "6F813586E76691305A0CF048C0D8586D"
                    + "C89460207D8B230CD172398AA33D19E9"
                    + "2D24883C3A9B0BB7CD8C6B2668DB142E"
                    + "37A97948A7A01498A21110297984CD20"
                    )
            }
                                         ));

            SegmentedVectorTests.Add(new SegmentedVectorTestCase(
                                         "[K256-IV64] Set 6, vector 0",
                                         "0053A6F94C9FF24598EB3E91E4378ADD3083D6297CCF2275C81B6EC11467BA0D",
                                         "0D74DB42A91077DE",
                                         new TestVectorSegment[] {
                new TestVectorSegment(
                    "stream[0..63]",
                    0,
                    "57459975BC46799394788DE80B928387"
                    + "862985A269B9E8E77801DE9D874B3F51"
                    + "AC4610B9F9BEE8CF8CACD8B5AD0BF17D"
                    + "3DDF23FD7424887EB3F81405BD498CC3"
                    ),
                new TestVectorSegment(
                    "stream[65472..]",
                    65472,
                    "EF9AEC58ACE7DB427DF012B2B91A0C1E"
                    + "8E4759DCE9CDB00A2BD59207357BA06C"
                    + "E02D327C7719E83D6348A6104B081DB0"
                    + "3908E5186986AE41E3AE95298BB7B713"
                    ),
                new TestVectorSegment(
                    "stream[65536..]",
                    65536,
                    "17EF5FF454D85ABBBA280F3A94F1D26E"
                    + "950C7D5B05C4BB3A78326E0DC5731F83"
                    + "84205C32DB867D1B476CE121A0D7074B"
                    + "AA7EE90525D15300F48EC0A6624BD0AF"
                    )
            }
                                         ));

            SegmentedVectorTests.Add(new SegmentedVectorTestCase(
                                         "[K256-IV64] Set 6, vector 1",
                                         "0558ABFE51A4F74A9DF04396E93C8FE23588DB2E81D4277ACD2073C6196CBF12",
                                         "167DE44BB21980E7",
                                         new TestVectorSegment[] {
                new TestVectorSegment(
                    "stream[0..63]",
                    0,
                    "92A2508E2C4084567195F2A1005E552B"
                    + "4874EC0504A9CD5E4DAF739AB553D2E7"
                    + "83D79C5BA11E0653BEBB5C116651302E"
                    + "8D381CB728CA627B0B246E83942A2B99"
                    ),
                new TestVectorSegment(
                    "stream[65472..]",
                    65472,
                    "E1974EC3063F7BD0CBA58B1CE34BC874"
                    + "67AAF5759B05EA46682A5D4306E5A76B"
                    + "D99A448DB8DE73AF97A73F5FBAE2C776"
                    + "35040464524CF14D7F08D4CE1220FD84"
                    ),
                new TestVectorSegment(
                    "stream[65536..]",
                    65536,
                    "BE3436141CFD62D12FF7D852F80C1344"
                    + "81F152AD0235ECF8CA172C55CA8C031B"
                    + "2E785D773A988CA8D4BDA6FAE0E493AA"
                    + "71DCCC4C894D1F106CAC62A9FC0A9607"
                    )
            }
                                         ));
        }
示例#2
0
        public Hc256() : base(StreamCipher.Hc256)
        {
            // Data from ESTREAM verified test vectors
            // http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/hc-256/verified.test-vectors?rev=149&view=markup

            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "Set 2, vector# 0",
                                        "00000000000000000000000000000000",
                                        "00000000000000000000000000000000",
                                        DiscretePlaintext,
                                        "5B078985D8F6F30D42C5C02FA6B67951" +
                                        "53F06534801F89F24E74248B720B4818" +
                                        "CD9227ECEBCF4DBF8DBF6977E4AE14FA" +
                                        "E8504C7BC8A9F3EA6C0106F5327E6981"));

            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "Set 2, vector# 9",
                                        "09090909090909090909090909090909",
                                        "00000000000000000000000000000000",
                                        DiscretePlaintext,
                                        "F5C2926651AEED9AF1A9C2F04C03D081" +
                                        "2145B56AEA46EB283A25A4C9E3D8BEB4" +
                                        "821B418F06F2B9DCDF1A85AB8C02CD14" +
                                        "62E1BBCAEC9AB0E99AA6AFF918BA627C"));

            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "Set 2, vector# 135",
                                        "87878787878787878787878787878787",
                                        "00000000000000000000000000000000",
                                        DiscretePlaintext,
                                        "CEC0C3852E3B98233EBCB975C10B1191" +
                                        "3C69F2275EB97A1402EDF16C6FBE19BE" +
                                        "79D65360445BCB63676E6553B609A065" +
                                        "0155C3B22DD1975AC0F3F65063A2E16E"));

            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "Set 6, vector# 1",
                                        "0558ABFE51A4F74A9DF04396E93C8FE2" +
                                        "3588DB2E81D4277ACD2073C6196CBF12",
                                        "167DE44BB21980E74EB51C83EA51B81F" +
                                        "86ED54BB2289F057BE258CF35AC1288F",
                                        DiscretePlaintext,
                                        "C44B5262F2EAD9C018213127686DB742" +
                                        "A72D3F2D61D18F0F4E7DE5B4F7ADABE0" +
                                        "7E0C82033B139F02BAACB4E2F2D0BE30" +
                                        "110C3A8A2B621523756692877C905DD0"));

            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "Set 6, vector# 2",
                                        "0A5DB00356A9FC4FA2F5489BEE4194E7" +
                                        "3A8DE03386D92C7FD22578CB1E71C417",
                                        "1F86ED54BB2289F057BE258CF35AC128" +
                                        "8FF65DC42B92F960C72E95FC63CA3198",
                                        DiscretePlaintext,
                                        "9D13AA06122F4F03AE60D507701F1ED0" +
                                        "63D7530FF35EE76CAEDCBFB01D8A239E" +
                                        "FA4A44B272DE9B4092E2AD56E87C3A60" +
                                        "89F5A074D1F6E5B8FC6FABEE0C936F06"));

            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "Set 6, vector# 3",
                                        "0F62B5085BAE0154A7FA4DA0F34699EC" +
                                        "3F92E5388BDE3184D72A7DD02376C91C",
                                        "288FF65DC42B92F960C72E95FC63CA31" +
                                        "98FF66CD349B0269D0379E056CD33AA1",
                                        DiscretePlaintext,
                                        "C8632038DA61679C4685288B37D3E232" +
                                        "7BC2D28C266B041FE0CA0D3CFEED8FD5" +
                                        "753259BAB757168F85EA96ADABD823CA" +
                                        "4684E918423E091565713FEDDE2CCFE0"));

            SegmentedVectorTests.Add(new SegmentedVectorTestCase(
                                         "[K128-IV128] Set 6, vector# 0",
                                         "0053A6F94C9FF24598EB3E91E4378ADD",
                                         "0D74DB42A91077DE45AC137AE148AF16",
                                         new TestVectorSegment[] {
                new TestVectorSegment(
                    "stream[0..63]",
                    0,
                    "425A5E6F68EC055F38383ADC5CA9C048" +
                    "D6455C56A5ACED215E22665185E497EB" +
                    "3A2F5C0D45057169965EA37FE19F5D83" +
                    "C95C4BEE11E8FA89545A38DD9D18AD6D"
                    ),
                new TestVectorSegment(
                    "stream[65472..65535]",
                    65472,
                    "EFFA27F50B0B4C4AB3C7855CD5DD9EFD" +
                    "B61783161678C9728B9032C2CB09A0B2" +
                    "D2578C53BF3C3E67D382BC89D824D63B" +
                    "20E62F414E4AC36472A16F4992DF4496"
                    ),
                new TestVectorSegment(
                    "stream[65536..65599]",
                    65536,
                    "0111EEC218892B446FDFDBA9D0C734DF" +
                    "C209D35FA86C1BEAC0D266E5DC4B3243" +
                    "68B4263BA7A3517805D1501B36450FFA" +
                    "1544812EBC0B9DDED93F5D45C4D83FFC"
                    ),
                new TestVectorSegment(
                    "stream[131008..131071]",
                    131008,
                    "D966650E1A27DF3CB71B1E64CD3E7EEC" +
                    "2D3EEEA2953E2FC5571B4380EA3BAEB5" +
                    "3F014B4EE071A426E4A518E1AF335BD3" +
                    "76309236760E0DF6184B3E34BF861458"
                    )
            }
                                         ));

            SegmentedVectorTests.Add(new SegmentedVectorTestCase(
                                         "[K128-IV256] Set 6, vector# 0",
                                         "0053A6F94C9FF24598EB3E91E4378ADD",
                                         "0D74DB42A91077DE45AC137AE148AF16" +
                                         "7DE44BB21980E74EB51C83EA51B81F86",
                                         new TestVectorSegment[] {
                new TestVectorSegment(
                    "stream[0..63]",
                    0,
                    "914AEBA9E4BE90FD07AA58B6E2536B59" +
                    "0DD63BA810A2B96BAD5DAC1818722BEC" +
                    "61725C75B9E6194F57D3D2BBFE795E73" +
                    "90405CA97249262093234239E35ED9E4"
                    ),
                new TestVectorSegment(
                    "stream[65472..65535]",
                    65472,
                    "346C1A7D71DBB8FB69EA78F07D60A9A7" +
                    "20D0ED544149AF102C12678D4AE0C5DF" +
                    "E3521B7344F91977799085008EA00432" +
                    "772C0B4ABEC1DB2C47608F9A29CC76EA"
                    ),
                new TestVectorSegment(
                    "stream[65536..65599]",
                    65536,
                    "6F3B93E808687BE8E37A635E15B13052" +
                    "60ED65488A59125D84726219AEE62087" +
                    "47C6672C585759BA60BFD7F55AB975D4" +
                    "B61596A506F8763F715F27A36082DB51"
                    ),
                new TestVectorSegment(
                    "stream[131008..131071]",
                    131008,
                    "C64CAD1578C28BF19F11B14F3D33C681" +
                    "A85D28A4B2D547652A7179C31127C306" +
                    "DC04BE79BC1DA0279C69F9418311E57C" +
                    "0F13D9E993008796EA10607A63BDC772"
                    )
            }
                                         ));

            SegmentedVectorTests.Add(new SegmentedVectorTestCase(
                                         "[K256-IV256] Set 6, vector# 0",
                                         "0053A6F94C9FF24598EB3E91E4378ADD" +
                                         "3083D6297CCF2275C81B6EC11467BA0D",
                                         "0D74DB42A91077DE45AC137AE148AF16" +
                                         "7DE44BB21980E74EB51C83EA51B81F86",
                                         new TestVectorSegment[] {
                new TestVectorSegment(
                    "stream[0..63]",
                    0,
                    "23D9E70A45EB0127884D66D9F6F23C01" +
                    "D1F88AFD629270127247256C1FFF91E9" +
                    "1A797BD98ADD23AE15BEE6EEA3CEFDBF" +
                    "A3ED6D22D9C4F459DB10C40CDF4F4DFF"
                    ),
                new TestVectorSegment(
                    "stream[65472..65535]",
                    65472,
                    "CFF0058C45807C1F4300D118FDFC3B21" +
                    "370936B39391791C92A821E1C8E8F248" +
                    "BBBF378679468218FF5F6560B79A6015" +
                    "82B81315DC19D8583263958B068BEA48"
                    ),
                new TestVectorSegment(
                    "stream[65536..65599]",
                    65536,
                    "871A09D393D8888EBEA453F518BD300D" +
                    "8233E906A31631D29A4A1834E268C3E4" +
                    "F65F4F65B1B9E55606BDF28A571CA4E7" +
                    "59BDE4718E1E13731663F5CAF1CB0F1E"
                    ),
                new TestVectorSegment(
                    "stream[131008..131071]",
                    131008,
                    "15360407DA7B389DF28C08B2221F5E0D" +
                    "96B34839325795A70A3F65D9CBB3848D" +
                    "8C0793A53E8C4D71D8B53B2923A90B37" +
                    "FE412A4485F0CC741E65743C6F1ECB4A"
                    )
            }
                                         ));
        }
示例#3
0
        public Salsa20() : base(StreamCipher.Salsa20)
        {
            // Data from ESTREAM verified test vectors
            // http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20/verified.test-vectors?rev=140&view=markup

            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "[K128-IV64] Set 0, vector# 0",
                                        "80000000000000000000000000000000",
                                        "0000000000000000",
                                        MSG,
                                        "4DFA5E481DA23EA09A31022050859936" +
                                        "DA52FCEE218005164F267CB65F5CFD7F" +
                                        "2B4F97E0FF16924A52DF269515110A07" +
                                        "F9E460BC65EF95DA58F740B7D1DBB0AA"
                                        ));
            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "[K128-IV64] Set 1, vector# 9",
                                        "00400000000000000000000000000000",
                                        "0000000000000000",
                                        MSG,
                                        "0471076057830FB99202291177FBFE5D" +
                                        "38C888944DF8917CAB82788B91B53D1C" +
                                        "FB06D07A304B18BB763F888A61BB6B75" +
                                        "5CD58BEC9C4CFB7569CB91862E79C459"
                                        ));

            SegmentedVectorTests.Add(new SegmentedVectorTestCase(
                                         "[K128-IV64] Set 6, vector# 0",
                                         "0053A6F94C9FF24598EB3E91E4378ADD",
                                         "0D74DB42A91077DE",
                                         new TestVectorSegment[] {
                new TestVectorSegment(
                    "stream[0..63]",
                    0,
                    "05E1E7BEB697D999656BF37C1B978806" +
                    "735D0B903A6007BD329927EFBE1B0E2A" +
                    "8137C1AE291493AA83A821755BEE0B06" +
                    "CD14855A67E46703EBF8F3114B584CBA"
                    ),
                new TestVectorSegment(
                    "stream[65472..65535]",
                    65472,
                    "1A70A37B1C9CA11CD3BF988D3EE4612D" +
                    "15F1A08D683FCCC6558ECF2089388B8E" +
                    "555E7619BF82EE71348F4F8D0D2AE464" +
                    "339D66BFC3A003BF229C0FC0AB6AE1C6"
                    ),
                new TestVectorSegment(
                    "stream[65536..65599]",
                    65536,
                    "4ED220425F7DDB0C843232FB03A7B1C7" +
                    "616A50076FB056D3580DB13D2C295973" +
                    "D289CC335C8BC75DD87F121E85BB9981" +
                    "66C2EF415F3F7A297E9E1BEE767F84E2"
                    ),
                new TestVectorSegment(
                    "stream[131008..131071]",
                    131008,
                    "E121F8377E5146BFAE5AEC9F422F474F" +
                    "D3E9C685D32744A76D8B307A682FCA1B" +
                    "6BF790B5B51073E114732D3786B985FD" +
                    "4F45162488FEEB04C8F26E27E0F6B5CD"
                    )
            }
                                         ));

            SegmentedVectorTests.Add(new SegmentedVectorTestCase(
                                         "[K256-IV64] Set 6, vector# 0",
                                         "0053A6F94C9FF24598EB3E91E4378ADD" +
                                         "3083D6297CCF2275C81B6EC11467BA0D",
                                         "0D74DB42A91077DE",
                                         new TestVectorSegment[] {
                new TestVectorSegment(
                    "stream[0..63]",
                    0,
                    "F5FAD53F79F9DF58C4AEA0D0ED9A9601" +
                    "F278112CA7180D565B420A48019670EA" +
                    "F24CE493A86263F677B46ACE1924773D" +
                    "2BB25571E1AA8593758FC382B1280B71"
                    ),
                new TestVectorSegment(
                    "stream[65472..65535]",
                    65472,
                    "B70C50139C63332EF6E77AC54338A407" +
                    "9B82BEC9F9A403DFEA821B83F7860791" +
                    "650EF1B2489D0590B1DE772EEDA4E3BC" +
                    "D60FA7CE9CD623D9D2FD5758B8653E70"
                    ),
                new TestVectorSegment(
                    "stream[65536..65599]",
                    65536,
                    "81582C65D7562B80AEC2F1A673A9D01C" +
                    "9F892A23D4919F6AB47B9154E08E699B" +
                    "4117D7C666477B60F8391481682F5D95" +
                    "D96623DBC489D88DAA6956B9F0646B6E"
                    ),
                new TestVectorSegment(
                    "stream[131008..131071]",
                    131008,
                    "A13FFA1208F8BF50900886FAAB40FD10" +
                    "E8CAA306E63DF39536A1564FB760B242" +
                    "A9D6A4628CDC878762834E27A541DA2A" +
                    "5E3B3445989C76F611E0FEC6D91ACACC"
                    )
            }
                                         ));
        }
示例#4
0
        public Hc128() : base(StreamCipher.Hc128)
        {
            // Data from ESTREAM verified test vectors
            // http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/hc-256/hc-128/verified.test-vectors?rev=210&view=markup

            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "[K128-IV128] Set 2, vector# 0",
                                        "00000000000000000000000000000000",
                                        "00000000000000000000000000000000",
                                        MSG,
                                        "82001573A003FD3B7FD72FFB0EAF63AA" +
                                        "C62F12DEB629DCA72785A66268EC758B" +
                                        "1EDB36900560898178E0AD009ABF1F49" +
                                        "1330DC1C246E3D6CB264F6900271D59C"
                                        ));

            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "[K128-IV128] Set 6, vector# 1",
                                        "0558ABFE51A4F74A9DF04396E93C8FE2",
                                        "167DE44BB21980E74EB51C83EA51B81F",
                                        MSG,
                                        "4F864BF3C96D0363B1903F0739189138" +
                                        "F6ED2BC0AF583FEEA0CEA66BA7E06E63" +
                                        "FB28BF8B3CA0031D24ABB511C57DD17B" +
                                        "FC2861C32400072CB680DF2E58A5CECC"
                                        ));

            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "[K128-IV128] Set 6, vector# 2",
                                        "0A5DB00356A9FC4FA2F5489BEE4194E7",
                                        "1F86ED54BB2289F057BE258CF35AC128",
                                        MSG,
                                        "82168AB0023B79AAF1E6B4D823855E14" +
                                        "A7084378036A951B1CFEF35173875ED8" +
                                        "6CB66AB8410491A08582BE40080C3102" +
                                        "193BA567F9E95D096C3CC60927DD7901"
                                        ));

            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "[K128-IV128] Set 6, vector# 3",
                                        "0F62B5085BAE0154A7FA4DA0F34699EC",
                                        "288FF65DC42B92F960C72E95FC63CA31",
                                        MSG,
                                        "1CD8AEDDFE52E217E835D0B7E84E2922" +
                                        "D04B1ADBCA53C4522B1AA604C42856A9" +
                                        "0AF83E2614BCE65C0AECABDD8975B557" +
                                        "00D6A26D52FFF0888DA38F1DE20B77B7"
                                        ));

            SegmentedVectorTests.Add(new SegmentedVectorTestCase(
                                         "[K128-IV128] Set 6, vector# 0",
                                         "0F62B5085BAE0154A7FA4DA0F34699EC",
                                         "288FF65DC42B92F960C72E95FC63CA31",
                                         new TestVectorSegment[] {
                new TestVectorSegment(
                    "stream[0..63]",
                    0,
                    "1CD8AEDDFE52E217E835D0B7E84E2922" +
                    "D04B1ADBCA53C4522B1AA604C42856A9" +
                    "0AF83E2614BCE65C0AECABDD8975B557" +
                    "00D6A26D52FFF0888DA38F1DE20B77B7"
                    ),
                new TestVectorSegment(
                    "stream[65472..65535]",
                    65472,
                    "BB599F93F4F244D717CA9818212B06D5" +
                    "6D99AD4CA1F78725DBA89EA1D1F05B27" +
                    "093A17D745396D8CFD0256CD50674046" +
                    "13108E2200A8F1C49075B376A7460515"
                    ),
                new TestVectorSegment(
                    "stream[65536..65599]",
                    65536,
                    "996C074A7C7C524F539037A8A9F3D193" +
                    "3BC311B548BD567F8AE1B4325C51C5F3" +
                    "4B0DE1B4A4651829108CA92AE23D57C7" +
                    "0EAFA766097DB0539BE77E6500703746"
                    ),
                new TestVectorSegment(
                    "stream[131008..131071]",
                    131008,
                    "43EF1ADFE8265C46FF7FBA43B78F899F" +
                    "22C3B9F069B786982145D601627CDC49" +
                    "2D27BB8D70FF6DA908F2606A0C44690C" +
                    "8502F9CFB3BD6CBFC9205470E3ABA387"
                    )
            }
                                         ));
        }
示例#5
0
        public Sosemanuk() : base(StreamCipher.Sosemanuk)
        {
            // http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/sosemanuk/unverified.test-vectors?rev=108&view=markup

            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "Set 1, vector# 0",
                                        "80000000000000000000000000000000" +
                                        "00000000000000000000000000000000",
                                        "00000000000000000000000000000000",
                                        DiscretePlaintext,
                                        "1782FABFF497A0E89E16E1BCF22F0FE8" +
                                        "AA8C566D293AA35B2425E4F26E31C3E7" +
                                        "701C08A0D614AF3D3861A7DFF7D6A38A" +
                                        "0EFE84A29FADF68D390A3D15B75C972D"
                                        ));

            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "Set 2, vector# 63",
                                        "3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F",
                                        "00000000000000000000000000000000",
                                        DiscretePlaintext,
                                        "7D755F30A2B747A50D7D28147EDF0B3E" +
                                        "3FAB6856A7373C7306C00D1D40769693" +
                                        "54D7AB4343C0115E7839502C5C699ED0" +
                                        "6DB119968AEBFD08D8B968A7161D613F"
                                        ));

            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "Set 2, vector# 90",
                                        "5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A" +
                                        "5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A",
                                        "00000000000000000000000000000000",
                                        DiscretePlaintext,
                                        "F5D7D72686322D1751AFD16A1DD98282" +
                                        "D2B9A1EE0C305DF52F86AE1B831E90C2" +
                                        "2E2DE089CEE656A992736385D9135B82" +
                                        "3B3611098674BF820986A4342B89ABF7"
                                        ));

            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "Set 3, vector# 135",
                                        "8788898A8B8C8D8E8F90919293949596" +
                                        "9798999A9B9C9D9E9FA0A1A2A3A4",
                                        "00000000000000000000000000000000",
                                        DiscretePlaintext,
                                        "9D7EE5A10BBB0756D66B8DAA5AE08F41" +
                                        "B05C9E7C6B13532EAA81F224282B61C6" +
                                        "6DEEE5AF6251DB26C49B865C5AD4250A" +
                                        "E89787FC86C35409CF2986CF820293AA"
                                        ));

            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "Set 3, vector# 207",
                                        "CFD0D1D2D3D4D5D6D7D8D9DADBDCDDDE" +
                                        "DFE0E1E2E3E4E5E6E7E8E9EAEBECEDEE",
                                        "00000000000000000000000000000000",
                                        DiscretePlaintext,
                                        "F028923659C6C0A17065E013368D93EB" +
                                        "CF2F4FD892B6E27E104EF0A2605708EA" +
                                        "26336AE966D5058BC144F7954FE2FC3C" +
                                        "258F00734AA5BEC8281814B746197084"
                                        ));

            DiscreteVectorTests.Add(new DiscreteVectorTestCase(
                                        "Set 6, vector# 3",
                                        "0F62B5085BAE0154A7FA4DA0F34699EC" +
                                        "3F92E5388BDE3184D72A7DD02376C91C",
                                        "288FF65DC42B92F960C72E95FC63CA31",
                                        DiscretePlaintext,
                                        "1FC4F2E266B21C24FDDB3492D40A3FA6" +
                                        "DE32CDF13908511E84420ABDFA1D3B0F" +
                                        "EC600F83409C57CBE0394B90CDB1D759" +
                                        "243EFD8B8E2AB7BC453A8D8A3515183E"
                                        ));

            SegmentedVectorTests.Add(new SegmentedVectorTestCase(
                                         "Set 4, vector# 0",
                                         "0053A6F94C9FF24598EB",
                                         "00000000000000000000",
                                         new TestVectorSegment[] {
                new TestVectorSegment(
                    "stream[0..63]",
                    0,
                    "31DC3AB92FE285475993D3C89751303E" +
                    "D0CFFF1EC11831B14AE5A9BD87D91C09" +
                    "998739800A4FAA987CB15679703E8C89" +
                    "F47EF436F24747DBD2C4800C91E34DA2"
                    ),
                new TestVectorSegment(
                    "stream[65472..65535]",
                    65472,
                    "7099E13547B5BE4CC753D2D1C2BF6DFB" +
                    "C96AACCC5BD513159B1F24AA62679DF0" +
                    "92F1ADDC91D55ECF2A4D0B71FF2B41D8" +
                    "D969E38334566B35D7DE3224854452C7"
                    ),
                new TestVectorSegment(
                    "stream[65536..65599]",
                    65536,
                    "7DC4EB2C9F315486AD89DDA5F0C5059C" +
                    "67D1312EA593D625A164CC12F6B57F4C" +
                    "6A824EC7FF4A830DE5066A6F659D841C" +
                    "D7F7A9180B716CA49C6DB5CBC947E438"
                    ),
                new TestVectorSegment(
                    "stream[131008..131071]",
                    131008,
                    "4030D1E317EBF9F6356B65AEB792E0AF" +
                    "CEA4E47DD37CEA8CF99DEC03C3325EB3" +
                    "AD92FC7E5054FD9AA76E1014ED751418" +
                    "6C9CE7AE27A231A5B6608FAE0535823E"
                    )
            }
                                         ));

            SegmentedVectorTests.Add(new SegmentedVectorTestCase(
                                         "Set 5, vector# 0",
                                         "00000000000000000000000000000000" +
                                         "00000000000000000000000000000000",
                                         "80000000000000000000000000000000",
                                         new TestVectorSegment[] {
                new TestVectorSegment(
                    "stream[0..63]",
                    0,
                    "F847D7FF5426BEF5882BD2D0717494AF" +
                    "A9B7BC922915808057581BA9E35E3B7B" +
                    "DAC3FC878D278FE5D145DBB71B6B16A6" +
                    "134475266239B99D04E512982B4113B8"
                    ),
                new TestVectorSegment(
                    "stream[192..255]",
                    192,
                    "55325FF9CD42636F007F0AC8B024380C" +
                    "1480FA84D633FCEB0569A42B754A74CE" +
                    "22B0D3D9D0B12C365F919884CE41A478" +
                    "D8AF818D6C48E3A6F6D27BF16577F587"
                    ),
                new TestVectorSegment(
                    "stream[256..319]",
                    256,
                    "614100AA1578E378424FCA648612022A" +
                    "4A38D0A60A934F48328B8F0999061533" +
                    "3D80C7BDB76A2C9F52CE46AE5D35CA69" +
                    "A7554632DD034C9184C158376C2612D3"
                    ),
                new TestVectorSegment(
                    "stream[448..511]",
                    448,
                    "1EF32C44CD8D7ABD0CF6CECECCC2EBC5" +
                    "C3D26EAEDE130C00EC3044127922B39F" +
                    "375170D3F4835808F75188276EB3AE1F" +
                    "93690F92FA6290D1D01A72840727CA0B"
                    )
            }
                                         ));
        }