# # # add_file "botan/cbc_mac.cpp" # content [b3c8242798b008bb0b0d81ea3b0d7d10e906b5b8] # # add_file "botan/cbc_mac.h" # content [772dfc29deef8cfd49e34c95a24498cbde7defa1] # # add_file "botan/dsa_gen.cpp" # content [71213b478a52c337f6aad69d3942bdcb51193e3e] # # add_file "botan/loadstor.h" # content [69e5ff18c5bc8404baf1872a77b1b3d7da6ba879] # # patch "Makefile.am" # from [eb7cf82ecaf2da8091ede85fe5fe98dd5401928a] # to [bc8dfa5f0e4ca9c9c523a1604b9e3f7a1e71ec0e] # # patch "botan/README.botan-monotone" # from [4cad7258f90f77e42f88066b052d3dcdb6638843] # to [6508d8f699968480ed3dd151d9a8d331f2cdf84b] # # patch "botan/aes.cpp" # from [c4c27a2a8b6a73bb871cd476ec7e2b0ddb04423a] # to [90c19327b41ac342532515f8949205302ad89114] # # patch "botan/aes.h" # from [ec4bd27f5f3c94a79486b9f5e2ab75da5b67bf87] # to [7d6c1cb25b5ff83e2eaf84904242047ea4b4bf4e] # # patch "botan/aes_tab.cpp" # from [f3ca5315412f5cb0c3f207764b14e2cb247d4cd3] # to [dee5874bee6c2c652492e4a5aeeac85e13e45760] # # patch "botan/alg_id.cpp" # from [9ac1ce2640dae2f5080ed55e2fd86bcba6b787e0] # to [858c0ba04cf6592190cd9884dbb178b33b614431] # # patch "botan/alg_id.h" # from [bd1c3282eca5505178d2893a434382ecae0d0a81] # to [2bc04e6582e651e268d9332e60549ecf0beb97fb] # # patch "botan/allocate.h" # from [40ba6112eb7d7da0587f341500d11ced911bff50] # to [532035d3cdec5a2c8fd3250f87a78fa7f3d77eb4] # # patch "botan/arc4.cpp" # from [6b24fa12af23cdd3ec85de63a2f28ff3f89c317d] # to [0952fe44407bbac2951e58155726cd24e6d4f7b0] # # patch "botan/arc4.h" # from [7c4390562e4ef982824e249298873a59d25c266e] # to [a21035287a093144517501237eec734af70b2c30] # # patch "botan/asn1_alt.cpp" # from [c83953b6277d328ba03ac6ec84225b422c5d5ccd] # to [ac84eab7afc78b1de20140301ee3ba62b976acca] # # patch "botan/asn1_att.cpp" # from [f8cc70185dec4ccc2131de3dd18b84e373c03327] # to [d4fc970d01d3845c9a067b20170c5f49e17d15ed] # # patch "botan/asn1_dn.cpp" # from [dc18166f624956f7847db2abbab7f12efd43756d] # to [9ba0216a56f6a549e27db7abae0ef0bee2686c62] # # patch "botan/asn1_int.cpp" # from [6850c83199dfd8c4206a9414aaa41fb7ceffe132] # to [f2c2e23eaf6d2fa711a14e0b9d06933d90885501] # # patch "botan/asn1_int.h" # from [a0e0d0b6b41db209d896158c5bde5ce6e1047f87] # to [e019f2b543443ca344094d8f0156b5eea11f2533] # # patch "botan/asn1_ku.cpp" # from [4e55b81ad1ff1c50f5912a772946b31ad319963c] # to [7d55d34b2291f34d75c1f14bbbfecae262e30a65] # # patch "botan/asn1_obj.h" # from [eab92560735690dc9209cc4755afe49460738a80] # to [dfbdbae68301d279de67562d713133df1258084c] # # patch "botan/asn1_oid.cpp" # from [bb5b7649ce1854c8d0ed6e69a28ad8c25328cdcb] # to [ee4c37e6bcd95a3ed3c5b784bf9b8f22e996e3b6] # # patch "botan/asn1_oid.h" # from [0ecf950a1c93059fdf9b86e1d5d11ae6702c5ee1] # to [195a1909830f2ad753a9f471d11f36f9442a5cbc] # # patch "botan/asn1_str.cpp" # from [3af21b9efa1dc13316d8b6e3aaafb6f20d2ed8a5] # to [1a3b46df6c07368ff753748688d171d3f7f16551] # # patch "botan/asn1_tm.cpp" # from [00d95aeaebc9c9ec683d6d5ceaabc4b8e0d3719e] # to [dc31d7c2acb603ce302eee1a40ff69a0fa4cc39a] # # patch "botan/base.cpp" # from [5b375926e0e230d5c2dcbaab4b0b90d67fe1e549] # to [42d599ac6a7769d1ea6cae06c345e8ecb9e2bbcf] # # patch "botan/base.h" # from [40430e25cf4f29f136af7d391a217ef727e1c0c9] # to [022214feafcc2f0dcf38edc423be11e907088448] # # patch "botan/base64.cpp" # from [b2a556c12793e219b3a5fb74321d4aa0e03c9404] # to [7b86aeea0a40fd1f84bee5aac537a7afc0810994] # # patch "botan/base64.h" # from [3f09eb989fc4b2b391f9cefa31455c9fbd2794cb] # to [da42818acbed79d1916cd6d7e5950e731677204c] # # patch "botan/basefilt.cpp" # from [762c9f006ae634c2d935fbd34a86e8566f71077c] # to [0bf28cb04325d403ef59e7189e7972b489900a6f] # # patch "botan/basefilt.h" # from [1c2652eaa8d52203589e94003df6b89172530b1b] # to [7e88a84f573ac07ff44bdbdcf6747e3534d75975] # # patch "botan/ber_dec.cpp" # from [1cdc3a17677f2513359b08f1e8bbfcd90daba133] # to [d22b06ac717befb508e9dbe7d34bcf5681280287] # # patch "botan/ber_dec.h" # from [14987092b2a66376f2c8ed76948bf026b8379eaf] # to [9a3931c832c8e5bb00fa2a493532759637bc0201] # # patch "botan/big_base.cpp" # from [5d4e448c572fe119957039a63ae26781d1c6f28e] # to [e0ee9ef996a0754bd45af121f5199bffff45aed4] # # patch "botan/big_code.cpp" # from [2037276e561104c2b79850dd2db314efd8d125c7] # to [5b8575b75382b660b9091d177312cd6ae5cd112b] # # patch "botan/big_io.cpp" # from [69a6680403cf935f3cff67a9a0fd9709d7dc77dc] # to [46db1f3389f22435bac178300359482cf004fba2] # # patch "botan/big_ops2.cpp" # from [bc9ec150895a182216ad0500cc9844cfe33dce21] # to [48afc3ad1501db0257ff9f9b24ab0ef1cb986165] # # patch "botan/big_ops3.cpp" # from [76c984c9f13270efb6c5e478a6bc55c58f94629f] # to [f94e0d3e2b709f641c97fd01d70dedf5763cb645] # # patch "botan/big_rand.cpp" # from [4541fc4ea65f0a9fcc7b5741fa618a6302884fad] # to [fed09e9a738b920aa693f66c991a35083033d953] # # patch "botan/bigint.h" # from [48a250ff969b40bb44bfac67b3b450a0fe58fc97] # to [f81e5621041cfc85cafbe2a72f9ce5fb7145ec58] # # patch "botan/bit_ops.cpp" # from [b35d3f6d5f4ea883ba3551f958ac08ad3f028036] # to [d42b4bc18f574f8b848335613aa7b102868dcc59] # # patch "botan/bit_ops.h" # from [322ee2eec0304c996d7816aba3d735a47db66b47] # to [77538dc92d95bf5bdca68230ea5626bf117c7994] # # patch "botan/blinding.cpp" # from [57d0d0adedcb70339c09939e9e88ef95f37357f9] # to [53fd0d7c91414698f91d3a69220267f839eef5bd] # # patch "botan/blinding.h" # from [296b45b8f600d94a9fc559c53ba894cd295e0eaa] # to [5ae0964e91119dc16655961306333f7000008883] # # patch "botan/botan.h" # from [c0c08cc25e4a651665ff390a832d6d5292748e5b] # to [cfc212d6a3fdb91720ddab3f26ca1a9091dcc990] # # patch "botan/buf_es.cpp" # from [2e725066213e388d4a875613b774203e8fda58d0] # to [0662ad86a41b68df7d8ca64b4f8fd944c558fa8f] # # patch "botan/buf_es.h" # from [b2d0dfcc87c0ef93a415b96460fb91650bab50ce] # to [bb5084e9761ec48aa5cd05338fd1fa4a24be1310] # # patch "botan/buf_filt.cpp" # from [2e4113960addc661421f7166495f965485df97a6] # to [11bc0ada5c75834743d69633f41a4c5ae579a793] # # patch "botan/buf_filt.h" # from [7282bd3d30c910df817e76a6c9946c129ebfce26] # to [488483f238749da1c611c10a108278e16147cb76] # # patch "botan/build.h" # from [b99017e7e9e956e54c179f50d26fd45646a52ff4] # to [2239983ea39c409b32f0e0722d4f99bba86a87e9] # # patch "botan/cbc.cpp" # from [c5fbfe43bba5f023c3b0d34d055d17371266a217] # to [55675107518ff82b5299a3a5d57728591ae6a638] # # patch "botan/cbc.h" # from [8d0a2b5c936d2be6750f3870cab6f4f262358751] # to [8f29180d6fb4af093a83374d9c6850eeff371530] # # patch "botan/certstor.cpp" # from [4decdbbea3ecee7c3db7a80ba2d58a2aed60a61f] # to [ee6d45de7e984615290f9355740a2caca60fa11b] # # patch "botan/certstor.h" # from [f76ddb23c18ad7da273da838831ce1b4f9e99e1f] # to [98d85d143337d3bceef3f19eab26d7a64ce958b0] # # patch "botan/cfb.cpp" # from [09210c773f789ae5217375ff32a8388b61166791] # to [640fd6b7b7b4ac2b3f64d242795b7f89a649349e] # # patch "botan/cfb.h" # from [bb45d558c81fc04ab816789c2c8c83eab422e979] # to [15af4384d5fa420812dbb01b0f18fcdd44a2b19c] # # patch "botan/charset.cpp" # from [2e6502139430d9ebc56d754dee9b181a6aed8ab0] # to [9b04fadf0a683fbf0bcf033846b3848f1cb599d6] # # patch "botan/charset.h" # from [6a88424f9ef7fed691711cd0f7eff129728d86d0] # to [5aef46caf0040c02fc7e648b02ab9e5f21a66640] # # patch "botan/config.cpp" # from [0c3d3bed551ae74cdb33be1843727648e87a80a2] # to [cb5e6f5108247da86e71cfbb2e553cfc755d4c9a] # # patch "botan/config.h" # from [67ea849588c76de31039a5b31d47983ae8ad7159] # to [38e23953e7b72c4faf77c743cd894fa7c3aea1cf] # # patch "botan/crc32.cpp" # from [37a171205e892360539205e21f099fcf788cd33f] # to [2ee196e8c63de2044782412cb88b5961603a4eea] # # patch "botan/crc32.h" # from [f0b4e516463a6bb833eaa5cbfe6717b831860e14] # to [f6b49ba25578e41cbe4a7472d79c1ce21cc1a62f] # # patch "botan/credits.txt" # from [85ddc6df5c8a471857bdcd11614a8d7ac9946f97] # to [9d06d23a922b731a18611d1935f3d5379d267346] # # patch "botan/crl_ent.cpp" # from [87b6c78cdeacc1638e024bd7a21350b437a052fc] # to [5bea084ef556530cb38d3de655db2983ff08f5ca] # # patch "botan/crl_ent.h" # from [2fef63f7241684e554dee9cf36819814d86619fa] # to [9127f49c66a94bb11d6b70b3f0784e9df6f4d19a] # # patch "botan/ctr.cpp" # from [e38e980590fc2dc1b69529f16843f425292627ab] # to [09b318f266cc6fda6a86f668e69d9021040a501a] # # patch "botan/ctr.h" # from [de9842ca4641c8e4c759178799af038053da3516] # to [d15c21f4e99621bec26e24dd7357e25bcccd3694] # # patch "botan/cts.cpp" # from [77c48b7d93e12da5a2caa08742008f512666b48b] # to [d13a1e07356db170c111b337cf4d0cd4ea6a439f] # # patch "botan/cts.h" # from [b3629ba48d49a2501e447a48eda76850f34130f9] # to [800a52b621bae83bd0bf563d01e17c6994e8e052] # # patch "botan/data_snk.cpp" # from [72e9615bb9e131d1ffa6f97e19f280a26d407617] # to [fae39562bf0033d40f6bf9d9959228adab62a8b2] # # patch "botan/data_snk.h" # from [2f0b3b675f98fb0e5133a998790fc0dd55b4c30d] # to [6e50479354754787a7ea8f1c87b4e5d19104d9ce] # # patch "botan/data_src.cpp" # from [e245dee359e2eee95aa98f26e0e44a80e2687207] # to [0b0c1e5793da7b053571a78da4ee951013211190] # # patch "botan/data_src.h" # from [3c1805ef300f5650a79f4ad6c1d0151f478cdf3b] # to [f12df31357e4bb3075136128d77881e23b9ee025] # # patch "botan/datastor.cpp" # from [c274eb601aebe3a216ca7dcd47d3571284d492c8] # to [301a7be0303d65b1589216c1f2bcb072ac17e34b] # # patch "botan/datastor.h" # from [88ffe567d95a2401a283e9c3650bc07345edff8f] # to [3f6602fad0bcd817cc7934c9497648d14074070b] # # patch "botan/def_alg.cpp" # from [20b41dbd1ebe04bc807d3bfce084934ee98149d4] # to [ab23a129c01fbdac53f0aedae41f05c34968517b] # # patch "botan/def_char.cpp" # from [537e2b15fc5921c1ed16e3d6e9b5d6230d36eeb6] # to [9d0a75ae7178a2423bb4e1a0f11473f8231b8cc4] # # patch "botan/def_char.h" # from [692a74603fa47364c728b2aefb8b842daafa747c] # to [02092515909d213909ed0d9705676e69f31d3ca8] # # patch "botan/def_mode.cpp" # from [8cbf475c54f99c4526351c1e98285a324e19c1d5] # to [691cb0c3bff70d8d74df99cdde4c9e155687bc3e] # # patch "botan/def_ops.cpp" # from [96ab0693a4990b326ac2eebe84dea11a9b970aa0] # to [5c9ed9b4ab2a62b38445ba340f5920b6dd8ba5e1] # # patch "botan/def_powm.cpp" # from [c0632ec6e1c5499467760bb99c31765c0d6ee90b] # to [ca58e34d3b5679bc60ced7813df3a350ca3f577f] # # patch "botan/def_powm.h" # from [c651a1990e9c5f92109014f725290c5698a0098b] # to [db2161b9b4c38ff0d80cbf979ba89526632d76d7] # # patch "botan/defalloc.cpp" # from [c3b3858bb8e929a219c7067a21d09e97d9efaa3d] # to [940db8ef03ae170341d257f9f7e4320ee3938935] # # patch "botan/defalloc.h" # from [f5ff6c8823b0cf28909a39f2532d4dad7efb06b3] # to [ef3958943a473c5a5068dbf77eae02e7cafa55fa] # # patch "botan/der_enc.cpp" # from [cd64c52d61cbb911adec3c8b615e93df0739372f] # to [431f71f58e378c7de52d0f540e5271fe705f5e65] # # patch "botan/der_enc.h" # from [343cbe1d916c91b2b78504674240aeb4fa5ca04e] # to [2c3f47a1c7d1f360948af20ca6927548dae30090] # # patch "botan/des.cpp" # from [789f5036773e7a823b36016967f0b351686f0e5a] # to [b4b952183124098874fc21851366dfec58fdd8de] # # patch "botan/des.h" # from [fa8ae2ada50a692c3eb15d3e6b21e4186ffaed3c] # to [6b9b0d2c5317640b063920f56dffaca554a9aeaa] # # patch "botan/des_tab.cpp" # from [a45c36b824fabc92baa7a6d2e4b2d1a99f5218b7] # to [0f68541315b311ff8553ad5e2e523e83a5cf1533] # # patch "botan/dh.cpp" # from [b1eda80f340c7e402ff8a3755871375c386bc05c] # to [d751f576b0d623a8842e974b7222a69609a31de2] # # patch "botan/dh.h" # from [9c89a68c5a94d701481c9833e399ea37bf36efdc] # to [f3dc596fa2092a4d991746a40e631b45dcde830e] # # patch "botan/divide.cpp" # from [908f830f2ae320c5da46f26e7293a17d44acae15] # to [e422958f75e485021705cced9c02be03d49f4312] # # patch "botan/dl_algo.cpp" # from [fe03bbae560ce2e38f0fc0f4c768b79a56ac5036] # to [625deb904170bae96d19fadc0d6ac5f4cc677d9d] # # patch "botan/dl_algo.h" # from [d0a0db3bac29456c28426a65103b4cc9712d6aeb] # to [c635a1d4ce27c0bf2d65dfcc29d27925bb18ebe7] # # patch "botan/dl_group.cpp" # from [5814b0a9a7ff2ab4ddde3d362a1f3eba24ddff19] # to [6a5022b0c81f660c85b912ad3e0a6ebd78c4ae85] # # patch "botan/dl_group.h" # from [bf3839e75b8ec5d4d8b805f74c2098ee7b4f9140] # to [5c9bb309357d9ef7c1a2140496bbcdb535216919] # # patch "botan/dlies.cpp" # from [17ac2bfa1bf4c527c5b5ed886da76c9c8ea1df4c] # to [1a6fe83f39fdd7be11e3e4b8987b0fbe9241f6b5] # # patch "botan/dlies.h" # from [0a3b5f38ec3c4216823fd8fbab906ff8697a8558] # to [b77520fa0b8dd5c3f57b803212ca965fbefdd961] # # patch "botan/eax.cpp" # from [8a31a913491b67718e6ddf39df4e3d9eef489953] # to [f1e9e17e046aa6de0450fc4773faeb73d8f2b7e1] # # patch "botan/eax.h" # from [193bbdd18e398ac054a8e05ae553afbdec291c24] # to [8aa3f7f2c01a0ce9f5782cf66461e0c1a72145c3] # # patch "botan/ecb.cpp" # from [281a354f3c97e99d8e808137d78c7dce5abff8ee] # to [202f9bb2055a498f0e5ee7a861ceaa011b025caf] # # patch "botan/ecb.h" # from [37d5e3f25deeb99b34c17b492649c422e1aaae24] # to [29ab7f13429e9642e9e3dc22569ab6bfb80d38f2] # # patch "botan/eme.h" # from [b22fa5c9c91835dcc5f0915ef6f7ddad2ffb1c4d] # to [b5432503dea9e40ffaf97de602b34ad522c72ecf] # # patch "botan/eme1.cpp" # from [e90e2aba0e7cc71829a641ee4f9077a5bede20b6] # to [118aad6ac2eb56ece214d5e209e761a436ef4e3a] # # patch "botan/eme_pkcs.cpp" # from [b6d2dcbe4674c075e759ada4d4f8a3ff8759977e] # to [15f831f147cee50a11addf7883e53a12a6defb1e] # # patch "botan/emsa.h" # from [b2b17af13aba1286f993907e80aae49e4c3fb071] # to [89505a710ac004a0451362593dd7fe4706cee834] # # patch "botan/emsa1.cpp" # from [e12d485d4f2484e6b53cd52288486cb56419b26c] # to [92d9d12b72d3fee612f979a9efe36f9da3af4996] # # patch "botan/emsa2.cpp" # from [39f86a2ed053f0ddb8a0e0fb032ea9007149d27b] # to [3031d2c440ea6f65983216ab222d4ff8da32099d] # # patch "botan/emsa3.cpp" # from [0712cedbf4b4da5381aa6ec751798e527bac5239] # to [31c1d39fbda1461462f686095b027fbc5662e1e8] # # patch "botan/emsa4.cpp" # from [37c2f6432f8c13d345aedd7e5155aa3f4fb75e39] # to [91e564eed0e820f8bc5e5dfd05c947f76eec4771] # # patch "botan/emsa_raw.cpp" # from [3b8914e43991c3700e12a01185d057491c08db11] # to [374a4209d99f4f0735a6d076c631a15824da06b4] # # patch "botan/eng_base.cpp" # from [fe03cdf861b4ea4abfb312f8197100e6aa43c9c0] # to [0593563d982aaac2c01024c1dd6e29b1494843d7] # # patch "botan/eng_def.h" # from [22f1fd366a3b8480b4101127aaca73ead0efda57] # to [c8353e6127f95e3aed4fd3bd1b40e583b0354801] # # patch "botan/engine.cpp" # from [c3736b30d68bf5728e77645032802f8f2943965c] # to [bf3c1acdcb480eb07013cebc9f03417730b1e01f] # # patch "botan/engine.h" # from [b097b39a35e56fa7065db88304f00a54c79e88b3] # to [20654be095cb727e6e4c850306e286e47fe7699f] # # patch "botan/enums.h" # from [baf21a6f233200a4cfd0e09f584285a4fd3caef4] # to [06237002097d2faaca50f83ab28eb7ec1e8b5f9d] # # patch "botan/es_capi.cpp" # from [595e41ac825e2bc3c8dac4b90019a1ace1a4feb1] # to [5d11daadd552362da19cf914c425ddfc3a202926] # # patch "botan/es_capi.h" # from [72dab1a57f7e67a2eb34eeb6a43a35441a2a9b47] # to [598fba0ac3ebcbb92a0f9ba8e615ffe5438a49b0] # # patch "botan/es_egd.cpp" # from [49eb23590990e5a8ac0148030ceb3f5d7881ffd3] # to [39d2684aac4c7a382253daf8e50b1c00d797d437] # # patch "botan/es_egd.h" # from [b81212d62810f7b8758c76192e746ff403d4a9a1] # to [7044370670060e2891b276f2b4dce744bb305487] # # patch "botan/es_file.cpp" # from [271ccf707ae4b8a6606156e90fd21408cf76314f] # to [320002d9d19950b48e1fe88739b9a828c79419a4] # # patch "botan/es_file.h" # from [9e27f972a14360684633f1c8c7dc967e385535a1] # to [0edcf498e809a142bd5b61778f5593ae35af80ec] # # patch "botan/es_win32.cpp" # from [701187eda7ca149bb8c42e72f3bb523954b2d54e] # to [e8926bb59147dcd331a5c940cac2123326d665e0] # # patch "botan/es_win32.h" # from [0251e175291cd4029ae60cbcf588a04dfe62c76c] # to [67e26dddc6ddb44f68df174253d770d7f12eb0a4] # # patch "botan/exceptn.cpp" # from [d83be5a04572fbed2adad3785431999aad9b7017] # to [4929c5816f645688d7bfde7e1185989cf8ac89b2] # # patch "botan/exceptn.h" # from [2f717eeccaa793dd63844070e3c5a072fa55bae6] # to [120505f40281475a5872fa41329b1e82f5adf194] # # patch "botan/filter.cpp" # from [eb64d7cb6d31e58b2bde650ed5f244626e1d69e3] # to [bc1fe725d4b6869d279e64f7649988a8b6d8f51f] # # patch "botan/filter.h" # from [7c221b8584b5aabd2be0bfba18d66847f77384da] # to [2050b7b09aa807090598434d8ac5ebb83fbf2503] # # patch "botan/filters.cpp" # from [a2fcaa59190c4eb9dc91b0ccbd7c8c9b2f8388f0] # to [698d1b8987f6963d2ba5c03bc95bf79047a94fa2] # # patch "botan/filters.h" # from [500b32199811557e4fe7732277ecc25a6c6e7e0d] # to [bb51ce701097541948779da3f3bbe96651dcf24c] # # patch "botan/fips140.cpp" # from [3f269a7d5956932377b3573809471b0ba79312b0] # to [df549a1ac6d511cb6f5a9d9a801bfed4529569cb] # # patch "botan/fips140.h" # from [6feb2b5fa21466f8e84348e92df8985a7fffe3b5] # to [d931ddb8b60ca1d9f40c2bcc9f6f136aedaf3ead] # # patch "botan/get_algo.cpp" # from [49f99fde31bfc94c20b03b4800a86a75089dabdd] # to [656661d877017c4dbf1a80eb5e23a558fe463ff5] # # patch "botan/get_enc.cpp" # from [8840ce2708a4b2989efef886d8a2c9f63c21993b] # to [18eeecb14af5921471c02ec78ac491badc74108b] # # patch "botan/get_pbe.cpp" # from [4d13f684cca1485575401f3bf3c0563dac19a318] # to [6bb990b1f38d8ef62c0a6055dcfb8f8eb2142386] # # patch "botan/gzip.cpp" # from [6e190f22df99d08404da49a1a52ef2d1f71a15da] # to [c563ec78bac13eead84737e3047cb4f7027a77f0] # # patch "botan/hash_id.cpp" # from [ff0dd27712838713d976bd0f5e13875c9f73ea1c] # to [ff3e7496e25d811a0f001aa900aef51e1b96e9a1] # # patch "botan/hash_id.h" # from [e807331d09c89bd23cdbeceda4ede53f1f2f18f1] # to [e77aea6c5e7bc736e2791bb73bc44b39fbf6c2a1] # # patch "botan/hex.cpp" # from [5eaedbdfe4c122cc65556776ecc44d9af3008f43] # to [e49d63031296f49e80205e2e18bf56cc9097ac41] # # patch "botan/hex.h" # from [cd20faea5de483ad9e90bb8921e492bcbb7b743e] # to [faf49f51673a4603cc342492b6e0d74dc1d748b2] # # patch "botan/hmac.cpp" # from [544b1c880365d3ca6c2e435a928af8647356d5ff] # to [c98153b4f8b5c4a3b2fafc05bb69a0c2aa43067f] # # patch "botan/hmac.h" # from [953953c1a07de51d1333f2370b515799642a26b4] # to [eb82b13624a2365487c9651fd45f9619abdc5f5c] # # patch "botan/if_algo.cpp" # from [b6e11a42e06aa4e3c52533da88ea6fd61ebc7000] # to [d887e1ee1beae026a0cb02c893c882f3d464d4e9] # # patch "botan/if_algo.h" # from [2e2a6049b0efb9ef4a96e30e1dffda817a3c4b58] # to [f801b3d836a41b2db02f82a6f7f3c1ca711d5128] # # patch "botan/inifile.cpp" # from [2ed7ef36997e20217f2ddef2cda128a337f4b81d] # to [23157f0a070fb41bf6b47df5e9289bbc933ccf79] # # patch "botan/init.h" # from [289bb501a9cb777aeedf0241b07a43d887fc894c] # to [4e6621c7bdf9dd3e309d28456d06cafaebf16029] # # patch "botan/init_def.cpp" # from [afd1c1e0132c65e36d289940fe251b2875ec3a25] # to [032c0a1f7bd132c86506da3f4756a1f39a49e6aa] # # patch "botan/init_opt.cpp" # from [5f13d0b463dcb5124c6e1d41bb050653b6418294] # to [b66c0ecf18aa8f66a11ffbef319395e5323c69ea] # # patch "botan/jacobi.cpp" # from [9700093d78ff1954708931ca8440c4642de16fb9] # to [699fd1d1712c1e22fbb3cc94cb919b709b49b7de] # # patch "botan/kdf.cpp" # from [961788f9806afb6dfd141703c9c9eb7f99ecf64c] # to [5a8a42038d9d402727e6ca1b11d0244954137a32] # # patch "botan/kdf.h" # from [1124198e5c3117544d112eede2a0d4bfa772341c] # to [e9a850e59f10c3b94a8a17520f2b3479451eae05] # # patch "botan/keypair.cpp" # from [2c64955c5e28515d0029e50937107dd9a91e3b48] # to [3b736d5aae521292b8e479ebe3b9b703d4265a99] # # patch "botan/keypair.h" # from [a0310efb60669a0abd04b9065c8b7e50e4e10e7c] # to [5e9ee863a0ee9dbe63cbcb39d5440a09c4f5c828] # # patch "botan/libstate.cpp" # from [7e672a48a31df8a8036588f5e4308b6dbc56d989] # to [233c9231a05eae79ae231f8136850b43c34914d3] # # patch "botan/libstate.h" # from [4070e82c699e67065b4337afd0475b0e9c9e6120] # to [4dddb269a906154b79debb9588397ac08334ccf6] # # patch "botan/license.txt" # from [0cac4d68711b77376ac6b70d8ca304da89cc613c] # to [902feeccfae30f0eb980e0f50b222cdd2c2df694] # # patch "botan/look_add.h" # from [af2beed9ced313aefd1e307de2bde6d6100fd916] # to [2a3f23c905f2b6e3f0b18f50ca7b22a5684bf352] # # patch "botan/look_pk.cpp" # from [13453c6cbd7be65bf71e38b40f14a8e8c3851c85] # to [80288c7dbe76f809b37a6e2189b32d45a2eab344] # # patch "botan/look_pk.h" # from [a579cb37238f0eddb5e33277379c676e724f235a] # to [1f2ab76b42fca7ccef876265b1f0a8df5610f944] # # patch "botan/lookup.h" # from [7265880bb34e5c13431307e2e57a57813540a5fa] # to [dd3c4a91f50bebfd4c710a828b007b8303b5536b] # # patch "botan/make_prm.cpp" # from [4ef12c2a523d27ad2c7602374ed7aac7d0de36ef] # to [d665482d002305b15dd878616f4c78fdb76cf76a] # # patch "botan/mdx_hash.cpp" # from [92f3d7d87656522ae3f02a8cd86b1c2a957547f4] # to [7e90baec5a8465c7405841bc2d1075fde1165797] # # patch "botan/mdx_hash.h" # from [5bdd8beb52cdaf9e8ac1106a542604bb7c309c64] # to [80dc1cabd3c93588afe182cf940ccc7ede9204b0] # # patch "botan/mem_ops.h" # from [34941d88cfa5ddaf14b9ff3826b0b621a0ab53e8] # to [02ca7af8ad83315a2956f25dba090cad70a6ab0a] # # patch "botan/mem_pool.cpp" # from [8050abebfa25644c457fd81b4eddf791b86f5c25] # to [399aa8cd9dac6bce28a803b11a262d5e6d1b3fcb] # # patch "botan/mem_pool.h" # from [e770dc2fe471f3a44c1096480ddb5e9875d50c2f] # to [5c7868d373529114f14223b4cb7533ffa0b7133e] # # patch "botan/mgf1.cpp" # from [4bfd485e042f369b4fe63795d322a58a040d5610] # to [833bdd2150cc0db702b39bc4d799426504dda7d5] # # patch "botan/mgf1.h" # from [289afacc20735881b14bd084a4d170fac8703c9f] # to [ae7d0ec9bd1bf70990fe92a514843619231c8e30] # # patch "botan/mlock.cpp" # from [4755235e70fac894c364c327397ee9fef15658e3] # to [61e353fb8fac94a0a655a08e19fd55f04b6d2a42] # # patch "botan/mode_pad.cpp" # from [f43891fdce0ba6fc32bfdee10553bb44f7d34937] # to [3a2ad1689618276a2d9d2f064d418e25221d825b] # # patch "botan/mode_pad.h" # from [23a6a4875c91d1bd11fbaaa4b2f74469c8cd4ee7] # to [87c55a3918487d134cab27968dd2cfcfe61eb09a] # # patch "botan/modebase.cpp" # from [cfe177154a0a7dd9006f87f55f17956c3d5bd087] # to [1c98d29fa318a766f53c87ded0f18c6b80fbcbb1] # # patch "botan/modebase.h" # from [11a987c1e68cb7b68203f307febd5c8ab7a54fdd] # to [b2233bf5cfbe0d16ec986291f086c5e07838b861] # # patch "botan/modules.cpp" # from [78779edaa4470f509cd48d85c91dc07067b6f293] # to [310f410a77f14f2b559a24a0a00821880205b6c8] # # patch "botan/modules.h" # from [f19773d268d095c5b67ba346f1b37adb677a028c] # to [d5c0714b1d1a263bee2ecb352834c9d243a893ef] # # patch "botan/mp_asm.cpp" # from [0ab0ca22514636b06029d452ae1fb5b43b9861cd] # to [84dd140ff3a56889afd6b026b0ee40e40120cd83] # # patch "botan/mp_asm.h" # from [963985006998064e9ebd6ae3e1ca1290b76b39c3] # to [43d835beafc05c9d0e39596ba54e73a53795e5b4] # # patch "botan/mp_asmi.h" # from [e22b2a80d57276591576424485f84332d14c9ee8] # to [fb52f8210fae3cab3f224a25d9728222b2ce27f4] # # patch "botan/mp_comba.cpp" # from [10faaacf71f061fcd639997bbab799c1211d72d6] # to [b6e3cf9668bfeebad0695e1062409cc358ce39d6] # # patch "botan/mp_core.h" # from [a8e7f19af41c713977d042659aea91b0391582b5] # to [a31479cdef207a0cf98352de2a6813ddcdb909b2] # # patch "botan/mp_misc.cpp" # from [c05569bf722238f1a24f9aa56a7f72fe75516568] # to [1602f6ca6969f4c503be6f203b5442b2ae0c1c0a] # # patch "botan/mp_mul.cpp" # from [52039539105a440dff115eb3e6fad4ecea642764] # to [dafb1262e69f06c17fe781aea9c7ed04ef789829] # # patch "botan/mp_mulop.cpp" # from [55f6e57466d94aa77efedeedcfcea77f7108fd10] # to [cfaafb643d3d5960509ca07f8370a044c291730d] # # patch "botan/mp_numth.cpp" # from [bd2130c283610c5fed36b561dbcb486013cc35a0] # to [1f30af2cd34fe5b7692e984bc9f32e8fecb8fc40] # # patch "botan/mp_shift.cpp" # from [3c6d022cd0d034e7d9ea571bded9912dee93ee30] # to [91e212e741dcd78df0619afad5539f779f4684c3] # # patch "botan/mp_sqr.cpp" # from [28c6459fe1b2b85816ca0179a62651f67dc540c8] # to [de1f9715b8b1420092525f08c1f37428734fce19] # # patch "botan/mp_types.h" # from [e9a7d9daa17a17667fc62e90f97ce660092de0ad] # to [064801a43de15a3fb4af0a26b9c4bd14fcd9b8f5] # # patch "botan/mutex.cpp" # from [82fa70864c2db1867541d8b8d3c5c6c99cbdbfdb] # to [3e01e31f664f2e669206c92788212288a29ed1e9] # # patch "botan/mutex.h" # from [aa4a392f6066b453a0dfca4ae7747ae44656753d] # to [566d2d816963e3e255e0cd7ef9e58f4619cad8f8] # # patch "botan/numthry.cpp" # from [126f52c53fff81483812e62e387a63db90aad512] # to [121bca14d1edfa1a93e236929dcb94e740fea001] # # patch "botan/numthry.h" # from [28f9880e0625b4df81960c9596a80ebed49ff0ae] # to [4d094d0b3a98dbd84783beb080f861d076d1a0f5] # # patch "botan/ofb.cpp" # from [a32bc675be00576ff4d42bdbdbb3ac747335c049] # to [2d9408795607ec8643f7515ed40bdbb69cafc9e2] # # patch "botan/ofb.h" # from [88c86eb33b448ac17ad5d533224ecfc902941d3a] # to [735fe0d3455bb134d31db83f7e9dfa3e2ac0cfda] # # patch "botan/oids.cpp" # from [e559f1aaf8bb3be8bb25b5994dbfc2bc68b822f9] # to [469aad470e7ec8f275bee3ad392a675828b40aeb] # # patch "botan/oids.h" # from [11b042ec74268dc1a20292ddf899c5aae2cc57d0] # to [ca7fe98e914a8def168afa1d9e29ef594245f031] # # patch "botan/out_buf.cpp" # from [84c593b7de4a4e21920b9a68146f9b061ae8384a] # to [c5071a9eb97054a9bb82f5f9ebe48ac01c380a3c] # # patch "botan/out_buf.h" # from [41a263e3362e4387260349e069f3f60b80798ff1] # to [cfe4dc7beb6cb4816788ad929eef3be9f22ff420] # # patch "botan/parsing.cpp" # from [035b0146556a03f222348ce5917aa54937038e87] # to [4c423baf1e0e9ba8d65a5feda7eb79e6be6fe445] # # patch "botan/parsing.h" # from [f75201b87b93e3c759253685c584e989ce529711] # to [d706a1c3fe72a2466149994e8e3a256b243514f5] # # patch "botan/pbe.h" # from [f70f01ec9efa2119a6a28519697bc0d5da8167f0] # to [6f41f1c709485124f6dda4dc2ac05d9218577d47] # # patch "botan/pbe_pkcs.h" # from [13c9b42c84107045259fe22f8723b2a7ec81da85] # to [dedf1488ad73ea2bd8bcfeb286f01e01f0dfb4c7] # # patch "botan/pbes1.cpp" # from [020b763720c532c6cd655f7d09fb99ac9a8abd37] # to [3285313a3d998f049c48d73817a98b548d2c4990] # # patch "botan/pbes2.cpp" # from [a1016156b21557e1069e3cbfc261c95f082006e7] # to [b30dfcb03d8bd7642027a2ae878c95087ac8a572] # # patch "botan/pem.cpp" # from [5d29ce30c07f59bf5df8adba88c29ac117028862] # to [502e34643de00820f3dbd8da75c65dd6b62ad056] # # patch "botan/pem.h" # from [fb888d3bc2fed16ec4745cd5179bef5cc1f13b23] # to [8f1ebb1cad4f86b291912481e8fdb5277f9ef1e0] # # patch "botan/pipe.cpp" # from [0d1ef60657b17d5473db8b0c3a1221576c54eca4] # to [945e1ff54a457469193ea353a6a51ae7888a167e] # # patch "botan/pipe.h" # from [95a49edcf42da90fb31d68eed9d1f6d85daacae6] # to [d7528617243b81a9c2a0eb4b91f63c7b07db15aa] # # patch "botan/pipe_io.cpp" # from [b834ab95d290b21877ea8a562403b8ca76c10a6f] # to [0ac139738c9b5f02e1efc95f746b170922297e7a] # # patch "botan/pipe_rw.cpp" # from [98ddc7cd79353b886929f6706a8404bee55aa953] # to [8d27e71d853da473f4baec3e8a68679bd6020857] # # patch "botan/pk_algs.cpp" # from [4eaf5dca76443211e7486ca651ae5521d7cb7181] # to [2fd3c52de28bdc3236564e139de0b24be65e54af] # # patch "botan/pk_algs.h" # from [e09d6c2526b142e7aefbcde01217afb84d581c7d] # to [0cdb3f27d4178871d62f3ffd6eb4cf749b449c8b] # # patch "botan/pk_core.cpp" # from [6aa769ae640128a26f99f53bedebdf10e0d1947d] # to [e451087382e2c3ab0d8f3624f07891afe1fb22aa] # # patch "botan/pk_core.h" # from [bcdfc58a47396cdd6023fe343683ed34d6cbc42a] # to [b6bc6c56bc5f235e84e7f797ae1b38677cc5cda5] # # patch "botan/pk_filts.cpp" # from [f0b3034376d079b3c0e142fdf137b747eb59c493] # to [4007d826375c8f84ddf27f83b857c16f619a288c] # # patch "botan/pk_filts.h" # from [af8f30ddc7323c166cd55b0440ed913fd7ecb014] # to [717d97bf42adf752cac13930ae6cbe484da5a60a] # # patch "botan/pk_keys.cpp" # from [29ab96323d2af6ebe37adb62f87a22b4c2d31490] # to [5b7fa873a16d72e3a111cb658a8d33a47bebb05b] # # patch "botan/pk_keys.h" # from [5c7f20a734f6a954bbef01d8496325d0020dbefa] # to [c5aee8b20fb5f7fbea75385e030e575c596802d6] # # patch "botan/pk_ops.h" # from [70200faf214f2f97b8b9c119ac37938532dd2905] # to [4c7b121d9c89e60bf7a836875b49715c9633da1d] # # patch "botan/pk_util.cpp" # from [8237a1130cf67101cdc62f6f63c5378a27ff240b] # to [bc6b585bbd39c1d6b76c2039d9007191797fcc15] # # patch "botan/pk_util.h" # from [e770acbba30020bcf8b39caaa1c0d42f49710023] # to [a453a40c2fedec2c2aefe609f91236ee5641714c] # # patch "botan/pkcs10.cpp" # from [4ad5ae41ff8f07e2d1d2fabf1f66fabf128df070] # to [9c89f3e653afd0c819a468514a81de9fd2c23079] # # patch "botan/pkcs10.h" # from [9b47bdb95cf185af680c8d32b26c95b4d83991bf] # to [2963efb4b97a36cdcd1bb51941ab613f9058ceaa] # # patch "botan/pkcs5.cpp" # from [a86a2c094f40ac695129fccd11be68e872206e8b] # to [74572fee997b93c59ca6e747e0d7f14b1ca47a46] # # patch "botan/pkcs5.h" # from [8f8553ead419624b1aeb3041c2d84e2ec9cc4a96] # to [d383915babdee2ef270bba89440302a6abc522ec] # # patch "botan/pkcs8.cpp" # from [e3676b23a2b6d3446047bab03ffa1a1508c60ebf] # to [733a303d5cbf22ad09fcb583943de7120358add9] # # patch "botan/pkcs8.h" # from [86edce68c6b423000dc6e47001ef379fefc18cdd] # to [71d4caac3daf75e32dc5c1c44007c2a49ea12dcf] # # patch "botan/policy.cpp" # from [e166ff18acbb721c2e2631204f7214510606a596] # to [979a989d26dd9cbc7a01e489136831c7c8ea5bc2] # # patch "botan/pow_mod.cpp" # from [9d95b94f7939eda78fceec8380fec8e394296656] # to [eb6a2654eecdc0e847a132641d5e007ceb96824d] # # patch "botan/pow_mod.h" # from [d01bdba0bdab4579b8c0ac0df3d05b4054bb409c] # to [7ebb967845c2f1b069ca3d0b5c21c5349f2d55e7] # # patch "botan/powm_fw.cpp" # from [77a451b956445c35d79e08537d3a81db90960917] # to [381e10f37c1800677e2845cbe31c466b38f88e10] # # patch "botan/powm_mnt.cpp" # from [b290cfbb2af5e05305ac9a9664628198297fb2c5] # to [7887c90cb82ffe8f47213fc80d5c7594f00bb92f] # # patch "botan/prf_x942.cpp" # from [f2edd1b59960de19ad85166158c461473562aebf] # to [94d6c065c580325db247150d2bce204a1b3e51ee] # # patch "botan/primes.cpp" # from [b6bc7dbb320ff24cdf16689cb57361551d6bc693] # to [ff3177db02d5f2d38318adc9c5c1d2865ba5bda3] # # patch "botan/pubkey.cpp" # from [938d1a0579b969ea347c6309b4e957a7f64952fc] # to [413323d6652270bf268b614a10443c86987fddb9] # # patch "botan/pubkey.h" # from [e78803dd6f07ef25fdf132520472cdd70dd5dd48] # to [b281c65bae28486d8ef43e7815e55f1d21553b6f] # # patch "botan/randpool.cpp" # from [b7237c75b0d6168d7672ce0bc16679a7d5fcab71] # to [dcfe978754894d39838888a39221519c5ca9b260] # # patch "botan/randpool.h" # from [e490e55f58dfe8deba8dd48f9badb6bad201aac4] # to [282ae46ef6ee4355e39982da535d2de946516f9a] # # patch "botan/reducer.cpp" # from [661444aaf3a9f34794dfc85b7fa1b77e166c61ca] # to [cbb17f184cc998fba5ca47c08ae25423826c7bf3] # # patch "botan/reducer.h" # from [cf802c2483d8e46c6ac2b42268012f0d4dd33afa] # to [531a57bee43fa9c80f2d6f83bb0552b79ca2b548] # # patch "botan/rng.cpp" # from [8139450d8cf07f579a396a137018a6a0d34d488e] # to [60471c38882ca41d868d3893765d6ea6553db036] # # patch "botan/rng.h" # from [b7323e6afbef620294a9ade850838a996bfc588f] # to [ba9ce2605044c82d04e629ca741eda683dc4d819] # # patch "botan/rsa.cpp" # from [2d6f73fd5688858ddf680b1d3737705e5fe2830f] # to [3712299fa9bc70a4b7c1631abf5667efc631eda3] # # patch "botan/rsa.h" # from [056dbb42daa09a95064d1f5ab04f4a6052675e3b] # to [bc6b4bf21a81862bc679e9c6c8c81f8523c50ca9] # # patch "botan/s2k.cpp" # from [edc80c7f6a50d8cc113d9e0ab44b2f49a05e54f2] # to [da0c7b7587edb08299a59e923790c1851f51a001] # # patch "botan/s2k.h" # from [1d434dad3a28aa524515ccc2aba8a3c9481791f0] # to [109b40a203006c1b76f6a6c3d4caff17cdd0fac1] # # patch "botan/secmem.h" # from [6a055673dad2b1aa6531078b1f791318bdf7a331] # to [6c5143161c26e2aa0c8585a7b0740cefc483cd59] # # patch "botan/secqueue.cpp" # from [5ccf8b1122fb6af815f4a56b424940d7cfaabc6e] # to [57e872c273efcf1e5a0b9dc7990eb7d72af2e2d7] # # patch "botan/secqueue.h" # from [76d4ccc109fe988f6fa871fcccc8a044fa35f819] # to [a2c102173a749d25cf550df38ee83e88043e32f0] # # patch "botan/sha160.cpp" # from [dcdbe870c5b69eadb5a6696d80094c8e3e0ce10d] # to [7f151f0f0f0f3c5358f422625c85d9fbfbc2520f] # # patch "botan/sha160.h" # from [75e734527e43bdb05151590c5cd97876b2158780] # to [4b02347f5d3093d6f9dffa6301eba8b9c1482b03] # # patch "botan/sha256.cpp" # from [5311156645190069e0d83433994737454ed7e748] # to [c301182d8aaf2804b5c52543987d0bd713acd7e2] # # patch "botan/sha256.h" # from [f3fb2c1515d6e4275bfca19cf10c24bd217f9539] # to [cd9c6dd936f6352367057c5795848d46bbf248f1] # # patch "botan/stl_util.h" # from [4c24302d12e723a8f6b2783b251ed4e7aa46a02b] # to [ffa9b20515dc96035b462d19f03aa7322cb703f2] # # patch "botan/symkey.cpp" # from [9b1f5232e3ee804994d5d335879384b0a10e9d0a] # to [c1151d35d6ca0800cadd554543ed1f194f51da0e] # # patch "botan/symkey.h" # from [bb111b6485d7142552cdaf683eb32c045d3bc837] # to [f098df098267afea9e6a9d1b22529396d8f01572] # # patch "botan/timers.cpp" # from [1ec7d69295f998e49a6e3dd835366e6fab077a17] # to [f8623fcc7c760b664bebbeb14bd602dd4f2945db] # # patch "botan/timers.h" # from [54ddc626b8eb21354b91f17da4ce23f04553abae] # to [12c913f6363815ada0aa26530f4a98b906e8aa41] # # patch "botan/types.h" # from [20b7609253789b40cc8338168fc36b6286d77e88] # to [a521c18fab8c790a187e0076a750897cc5c964f7] # # patch "botan/ui.cpp" # from [110c99f760077c645bd4066dee446930ad8736da] # to [cdb601e374b711ef9f5a5b4821c923781b97ca2b] # # patch "botan/ui.h" # from [798f616232c5e7d573b8804757aece798e38be28] # to [1062847660f76ad872e21bf1c59c70abe6339ce3] # # patch "botan/util.cpp" # from [e993a6c91b6f3455787fc05d10230307b408c193] # to [5e45f761ef28e1c32a22cd61fbdf7df28e0c31ca] # # patch "botan/util.h" # from [02cce31e55c9e0cf5a237bef31323b20a28d616e] # to [bff70e5c51cb75f6fcfb1335e1c5ad38c55ca924] # # patch "botan/version.h" # from [53fa3f9bc084e373ef685a521a5d185125b0ec27] # to [a07e925460e226f88ce01d28bcd71a00ce152a91] # # patch "botan/x509_ca.cpp" # from [8b0cae8065a8a62271cde6535b526cb6a3f706da] # to [c490baee785765f71c2de35c8e0596b8b284a07e] # # patch "botan/x509_ca.h" # from [acceef131e954076e3440f9b9067b995fdbc4e34] # to [1e8a2dd2335b23e952715f5dbf4b1b792138dbd7] # # patch "botan/x509_crl.cpp" # from [85cade7cc5603a9247693b7a34e9536f4e5f7b78] # to [8d56ad20f352039dcccff53846813e8cd2600538] # # patch "botan/x509_crl.h" # from [c6d5766322683f47203c0735c9bb2ca955df784f] # to [d583fee89c7e7db9f822e212248fd451ad51f69d] # # patch "botan/x509_ext.cpp" # from [ea9c0179d437bd8041db6761a911dad82139cc36] # to [11ffbaf80379a237ed47a9ba13091db6e84ce95b] # # patch "botan/x509_ext.h" # from [27cfb8662e0abb8f1a62383a21d91cef22a48777] # to [6bde07d391500117c5bf7f17f72aecab7386e1f4] # # patch "botan/x509_key.cpp" # from [e84b71242e87113bfaa1921ea2710b7a7b3c5bce] # to [7fb550c81b8c4ecf9767626751ded96208305f98] # # patch "botan/x509_key.h" # from [4f2af4aada2e273088dcec3bb988dcca3d900d16] # to [114ed2e6923140353e6678260cec13c71cb4a2fd] # # patch "botan/x509_obj.cpp" # from [a55097e99c3be5538ad199ed8baac155be7e2a7f] # to [f23e2574a233912956eeee348f088438350df3ca] # # patch "botan/x509_obj.h" # from [a2e42a74a17b310ddcd350f705849b4bb4b2479d] # to [e49bcc7c9c7d559e0f746b0c2533fe635309ac54] # # patch "botan/x509cert.cpp" # from [b938b902b807ca055a678baf24b2f946edf081f3] # to [d5de5f096e8a47ab498b0b0d90042775c3a1c0fa] # # patch "botan/x509cert.h" # from [3e0aff7d3950cca7179fabe9758606bddc688d40] # to [361b75d7368d02b0de174bc2ec5a9884b27954af] # # patch "botan/x509find.cpp" # from [21d9e720370c439cc1dd845ddf4b7d8dea5d1f38] # to [de53edbd8ed1d6f43016264642025ec448d08096] # # patch "botan/x509find.h" # from [b22bc9552ac96ac654e1848498879fdbfbf4411b] # to [df15095cab4de9ffb349869deb618fe4e6471533] # # patch "botan/x509opt.cpp" # from [a8032c087cd6389064684f9b783d31cb2aa4a048] # to [c8c77834ffe1078d008abc727e34e8b8397e2435] # # patch "botan/x509self.cpp" # from [2d52d4f6a030eee94570a3c615a6d1dd62b0599e] # to [5f92488b35e43625413b0215aac9d1f46a1d7a99] # # patch "botan/x509self.h" # from [a92566618f91df1a52e754c25a29643b50c5c1da] # to [9aac88cb666ace50f762e4371408402e4618b33f] # # patch "botan/x509stat.cpp" # from [3a556e846bf3e4022d3baa962a649dcba578913a] # to [ad0ea0d4cc9ef4a1aa9ae278b80ffce29d47f237] # # patch "botan/x509stat.h" # from [be346323dc7106fd7c6753525422050df38b3a28] # to [1d90a638aa2acaeccfa96676c1019623ebec20ae] # # patch "botan/x509stor.cpp" # from [4f299706a62a445d1d9d2671e9da3ec5db9f5e0f] # to [6e4f9030fde21f4d670d1f669ac31868b789365b] # # patch "botan/x509stor.h" # from [0458718b33f732e7681e9ec839300efbb53c0dcf] # to [0c872441411cdd08c7665196990b748eb6eb2710] # # patch "botan/x931_rng.cpp" # from [f8054903a29e41dfe9ba76291d8ffc5e26bc8166] # to [e75b008bdb53486d98d7aea0dacaa607e55ea0f0] # # patch "botan/x931_rng.h" # from [aed7d488fbbe36d35fe8245abe44bb7d6b98ab98] # to [2dedc53610c7b07e26bfa9b314c7e56b1db402f9] # ============================================================ --- botan/cbc_mac.cpp b3c8242798b008bb0b0d81ea3b0d7d10e906b5b8 +++ botan/cbc_mac.cpp b3c8242798b008bb0b0d81ea3b0d7d10e906b5b8 @@ -0,0 +1,109 @@ +/************************************************* +* CBC-MAC Source File * +* (C) 1999-2007 The Botan Project * +*************************************************/ + +#include +#include +#include +#include + +namespace Botan { + +/************************************************* +* Update an CBC-MAC Calculation * +*************************************************/ +void CBC_MAC::add_data(const byte input[], u32bit length) + { + u32bit xored = std::min(OUTPUT_LENGTH - position, length); + xor_buf(state + position, input, xored); + position += xored; + + if(position < OUTPUT_LENGTH) + return; + + e->encrypt(state); + input += xored; + length -= xored; + while(length >= OUTPUT_LENGTH) + { + xor_buf(state, input, OUTPUT_LENGTH); + e->encrypt(state); + input += OUTPUT_LENGTH; + length -= OUTPUT_LENGTH; + } + + xor_buf(state, input, length); + position = length; + } + +/************************************************* +* Finalize an CBC-MAC Calculation * +*************************************************/ +void CBC_MAC::final_result(byte mac[]) + { + if(position) + e->encrypt(state); + + copy_mem(mac, state.begin(), state.size()); + state.clear(); + position = 0; + } + +/************************************************* +* CBC-MAC Key Schedule * +*************************************************/ +void CBC_MAC::key(const byte key[], u32bit length) + { + e->set_key(key, length); + } + +/************************************************* +* Clear memory of sensitive data * +*************************************************/ +void CBC_MAC::clear() throw() + { + e->clear(); + state.clear(); + position = 0; + } + +/************************************************* +* Return the name of this type * +*************************************************/ +std::string CBC_MAC::name() const + { + return "CBC-MAC(" + e->name() + ")"; + } + +/************************************************* +* Return a clone of this object * +*************************************************/ +MessageAuthenticationCode* CBC_MAC::clone() const + { + return new CBC_MAC(e->name()); + } + +/************************************************* +* CBC-MAC Constructor * +*************************************************/ +CBC_MAC::CBC_MAC(const std::string& cipher) : + MessageAuthenticationCode(block_size_of(cipher), + min_keylength_of(cipher), + max_keylength_of(cipher), + keylength_multiple_of(cipher)), + state(block_size_of(cipher)) + { + e = get_block_cipher(cipher); + position = 0; + } + +/************************************************* +* CBC-MAC Destructor * +*************************************************/ +CBC_MAC::~CBC_MAC() + { + delete e; + } + +} ============================================================ --- botan/cbc_mac.h 772dfc29deef8cfd49e34c95a24498cbde7defa1 +++ botan/cbc_mac.h 772dfc29deef8cfd49e34c95a24498cbde7defa1 @@ -0,0 +1,36 @@ +/************************************************* +* CBC-MAC Header File * +* (C) 1999-2007 The Botan Project * +*************************************************/ + +#ifndef BOTAN_CBC_MAC__ +#define BOTAN_CBC_MAC__ + +#include + +namespace Botan { + +/************************************************* +* CBC-MAC * +*************************************************/ +class CBC_MAC : public MessageAuthenticationCode + { + public: + void clear() throw(); + std::string name() const; + MessageAuthenticationCode* clone() const; + CBC_MAC(const std::string&); + ~CBC_MAC(); + private: + void add_data(const byte[], u32bit); + void final_result(byte[]); + void key(const byte[], u32bit); + + BlockCipher* e; + SecureVector state; + u32bit position; + }; + +} + +#endif ============================================================ --- botan/dsa_gen.cpp 71213b478a52c337f6aad69d3942bdcb51193e3e +++ botan/dsa_gen.cpp 71213b478a52c337f6aad69d3942bdcb51193e3e @@ -0,0 +1,140 @@ +/************************************************* +* DSA Parameter Generation Source File * +* (C) 1999-2007 The Botan Project * +*************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Botan { + +namespace { + +/************************************************* +* Check if this size is allowed by FIPS 186-3 * +*************************************************/ +bool fips186_3_valid_size(u32bit pbits, u32bit qbits) + { + if(pbits == 1024 && qbits == 160) + return true; + if(pbits == 2048 && (qbits == 224 || qbits == 256)) + return true; + if(pbits == 3072 && qbits == 256) + return true; + return false; + } + +} + +/************************************************* +* Attempt DSA prime generation with given seed * +*************************************************/ +bool DL_Group::generate_dsa_primes(BigInt& p, BigInt& q, + u32bit pbits, u32bit qbits, + const MemoryRegion& seed_c) + { + if(!fips186_3_valid_size(pbits, qbits)) + throw Invalid_Argument( + "FIPS 186-3 does not allow DSA domain parameters of " + + to_string(pbits) + "/" + to_string(qbits) + " bits long"); + + if(qbits == 224) + throw Invalid_Argument( + "DSA parameter generation with a q of 224 bits not supported"); + + if(seed_c.size() * 8 < qbits) + throw Invalid_Argument( + "Generating a DSA parameter set with a " + to_string(qbits) + + "long q requires a seed at least as many bits long"); + + std::auto_ptr hash(get_hash("SHA-" + to_string(qbits))); + + const u32bit HASH_SIZE = hash->OUTPUT_LENGTH; + + class Seed + { + public: + Seed(const MemoryRegion& s) : seed(s) {} + + operator MemoryRegion& () { return seed; } + + Seed& operator++() + { + for(u32bit j = seed.size(); j > 0; --j) + if(++seed[j-1]) + break; + return (*this); + } + private: + SecureVector seed; + }; + + Seed seed(seed_c); + + q.binary_decode(hash->process(seed)); + q.set_bit(qbits-1); + q.set_bit(0); + + if(!is_prime(q)) + return false; + + global_state().pulse(PRIME_FOUND); + + const u32bit n = (pbits-1) / (HASH_SIZE * 8), + b = (pbits-1) % (HASH_SIZE * 8); + + BigInt X; + SecureVector V(HASH_SIZE * (n+1)); + + for(u32bit j = 0; j != 4096; ++j) + { + global_state().pulse(PRIME_SEARCHING); + + for(u32bit k = 0; k <= n; ++k) + { + ++seed; + hash->update(seed); + hash->final(V + HASH_SIZE * (n-k)); + } + + X.binary_decode(V + (HASH_SIZE - 1 - b/8), + V.size() - (HASH_SIZE - 1 - b/8)); + X.set_bit(pbits-1); + + p = X - (X % (2*q) - 1); + + if(p.bits() == pbits && is_prime(p)) + { + global_state().pulse(PRIME_FOUND); + return true; + } + } + return false; + } + +/************************************************* +* Generate DSA Primes * +*************************************************/ +SecureVector DL_Group::generate_dsa_primes(BigInt& p, BigInt& q, + u32bit pbits, u32bit qbits) + { + SecureVector seed(qbits/8); + + while(true) + { + Global_RNG::randomize(seed, seed.size()); + global_state().pulse(PRIME_SEARCHING); + + if(generate_dsa_primes(p, q, pbits, qbits, seed)) + return seed; + } + } + +} ============================================================ --- botan/loadstor.h 69e5ff18c5bc8404baf1872a77b1b3d7da6ba879 +++ botan/loadstor.h 69e5ff18c5bc8404baf1872a77b1b3d7da6ba879 @@ -0,0 +1,192 @@ +/************************************************* +* Load/Store Operators Header File * +* (C) 1999-2007 The Botan Project * +*************************************************/ + +#ifndef BOTAN_LOAD_STORE_H__ +#define BOTAN_LOAD_STORE_H__ + +#include + +namespace Botan { + +/************************************************* +* Byte Extraction Function * +*************************************************/ +template inline byte get_byte(u32bit byte_num, T input) + { + return (input >> ((sizeof(T)-1-(byte_num&(sizeof(T)-1))) << 3)); + } + +/************************************************* +* Byte to Word Conversions * +*************************************************/ +inline u16bit make_u16bit(byte i0, byte i1) + { + return ((static_cast(i0) << 8) | i1); + } + +inline u32bit make_u32bit(byte i0, byte i1, byte i2, byte i3) + { + return ((static_cast(i0) << 24) | + (static_cast(i1) << 16) | + (static_cast(i2) << 8) | + (static_cast(i3))); + } + +inline u64bit make_u64bit(byte i0, byte i1, byte i2, byte i3, + byte i4, byte i5, byte i6, byte i7) + { + return ((static_cast(i0) << 56) | + (static_cast(i1) << 48) | + (static_cast(i2) << 40) | + (static_cast(i3) << 32) | + (static_cast(i4) << 24) | + (static_cast(i5) << 16) | + (static_cast(i6) << 8) | + (static_cast(i7))); + } + +/************************************************* +* Endian-Specific Word Loading Operations * +*************************************************/ +template +inline T load_be(const byte in[], u32bit off) + { + in += off * sizeof(T); + T out = 0; + for(u32bit j = 0; j != sizeof(T); j++) + out = (out << 8) | in[j]; + return out; + } + +template +inline T load_le(const byte in[], u32bit off) + { + in += off * sizeof(T); + T out = 0; + for(u32bit j = 0; j != sizeof(T); j++) + out = (out << 8) | in[sizeof(T)-1-j]; + return out; + } + +template<> +inline u32bit load_be(const byte in[], u32bit off) + { + in += off * sizeof(u32bit); + return make_u32bit(in[0], in[1], in[2], in[3]); + } + +template<> +inline u32bit load_le(const byte in[], u32bit off) + { + in += off * sizeof(u32bit); + return make_u32bit(in[3], in[2], in[1], in[0]); + } + +template<> +inline u64bit load_be(const byte in[], u32bit off) + { + in += off * sizeof(u64bit); + return make_u64bit(in[0], in[1], in[2], in[3], + in[4], in[5], in[6], in[7]); + } + +template<> +inline u64bit load_le(const byte in[], u32bit off) + { + in += off * sizeof(u64bit); + return make_u64bit(in[7], in[6], in[5], in[4], + in[3], in[2], in[1], in[0]); + } + +/************************************************* +* Endian-Specific Word Storing Operations * +*************************************************/ +inline void store_be(u16bit in, byte out[2]) + { + out[0] = get_byte(0, in); + out[1] = get_byte(1, in); + } + +inline void store_le(u16bit in, byte out[2]) + { + out[0] = get_byte(1, in); + out[1] = get_byte(0, in); + } + +inline void store_be(u32bit in, byte out[4]) + { + out[0] = get_byte(0, in); + out[1] = get_byte(1, in); + out[2] = get_byte(2, in); + out[3] = get_byte(3, in); + } + +inline void store_le(u32bit in, byte out[4]) + { + out[0] = get_byte(3, in); + out[1] = get_byte(2, in); + out[2] = get_byte(1, in); + out[3] = get_byte(0, in); + } + +inline void store_be(u64bit in, byte out[8]) + { + out[0] = get_byte(0, in); + out[1] = get_byte(1, in); + out[2] = get_byte(2, in); + out[3] = get_byte(3, in); + out[4] = get_byte(4, in); + out[5] = get_byte(5, in); + out[6] = get_byte(6, in); + out[7] = get_byte(7, in); + } + +inline void store_le(u64bit in, byte out[8]) + { + out[0] = get_byte(7, in); + out[1] = get_byte(6, in); + out[2] = get_byte(5, in); + out[3] = get_byte(4, in); + out[4] = get_byte(3, in); + out[5] = get_byte(2, in); + out[6] = get_byte(1, in); + out[7] = get_byte(0, in); + } + +template +inline void store_le(byte out[], T a, T b) + { + store_le(a, out + (0 * sizeof(T))); + store_le(b, out + (1 * sizeof(T))); + } + +template +inline void store_be(byte out[], T a, T b) + { + store_be(a, out + (0 * sizeof(T))); + store_be(b, out + (1 * sizeof(T))); + } + +template +inline void store_le(byte out[], T a, T b, T c, T d) + { + store_le(a, out + (0 * sizeof(T))); + store_le(b, out + (1 * sizeof(T))); + store_le(c, out + (2 * sizeof(T))); + store_le(d, out + (3 * sizeof(T))); + } + +template +inline void store_be(byte out[], T a, T b, T c, T d) + { + store_be(a, out + (0 * sizeof(T))); + store_be(b, out + (1 * sizeof(T))); + store_be(c, out + (2 * sizeof(T))); + store_be(d, out + (3 * sizeof(T))); + } + +} + +#endif ============================================================ --- Makefile.am eb7cf82ecaf2da8091ede85fe5fe98dd5401928a +++ Makefile.am bc8dfa5f0e4ca9c9c523a1604b9e3f7a1e71ec0e @@ -112,13 +112,13 @@ BOTAN_SOURCES = \ botan/ber_dec.cpp botan/big_base.cpp \ botan/big_code.cpp botan/big_io.cpp botan/big_ops2.cpp \ botan/big_ops3.cpp botan/blinding.cpp botan/buf_es.cpp \ - botan/buf_filt.cpp botan/cbc.cpp botan/certstor.cpp \ + botan/buf_filt.cpp botan/cbc.cpp botan/cbc_mac.cpp botan/certstor.cpp \ botan/cfb.cpp botan/charset.cpp botan/crc32.cpp \ botan/crl_ent.cpp botan/ctr.cpp botan/cts.cpp \ botan/data_snk.cpp botan/data_src.cpp \ botan/def_ops.cpp botan/defalloc.cpp \ botan/der_enc.cpp botan/divide.cpp botan/dl_algo.cpp \ - botan/dl_group.cpp \ + botan/dl_group.cpp botan/dsa_gen.cpp \ botan/dlies.cpp botan/eax.cpp botan/ecb.cpp botan/eme1.cpp \ botan/eme_pkcs.cpp botan/emsa1.cpp botan/emsa2.cpp \ botan/emsa3.cpp botan/emsa4.cpp botan/emsa_raw.cpp \ ============================================================ --- botan/README.botan-monotone 4cad7258f90f77e42f88066b052d3dcdb6638843 +++ botan/README.botan-monotone 6508d8f699968480ed3dd151d9a8d331f2cdf84b @@ -12,7 +12,7 @@ 3) "mtn up" in an a.a.u.m.b.monotone-2 w 3) "mtn up" in an a.a.u.m.b.monotone-2 workspace. In a n.v.m.botan botan/ dir, do "rm *". - Then copy the entire / contents (no subdirs though) from the staging + Then copy the entire contents (no subdirs though) from the staging branch's root dir to the botan/ dir. 4) "mtn ls unknown botan/" and "mtn ls missing botan/" in n.v.m.botan. If ============================================================ --- botan/aes.cpp c4c27a2a8b6a73bb871cd476ec7e2b0ddb04423a +++ botan/aes.cpp 90c19327b41ac342532515f8949205302ad89114 @@ -1,6 +1,6 @@ /************************************************* * AES Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -134,7 +134,8 @@ void AES::key(const byte key[], u32bit l const u32bit X = length / 4; for(u32bit j = 0; j != X; ++j) - XEK[j] = make_u32bit(key[4*j], key[4*j+1], key[4*j+2], key[4*j+3]); + XEK[j] = load_be(key, j); + for(u32bit j = X; j < 4*(ROUNDS+1); j += X) { XEK[j] = XEK[j-X] ^ S(rotate_left(XEK[j-1], 8)) ^ RC[(j-X)/X]; ============================================================ --- botan/aes.h ec4bd27f5f3c94a79486b9f5e2ab75da5b67bf87 +++ botan/aes.h 7d6c1cb25b5ff83e2eaf84904242047ea4b4bf4e @@ -1,6 +1,6 @@ /************************************************* * AES Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_AES_H__ ============================================================ --- botan/aes_tab.cpp f3ca5315412f5cb0c3f207764b14e2cb247d4cd3 +++ botan/aes_tab.cpp dee5874bee6c2c652492e4a5aeeac85e13e45760 @@ -1,6 +1,6 @@ /************************************************* * S-Box and Diffusion Tables for AES * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/alg_id.cpp 9ac1ce2640dae2f5080ed55e2fd86bcba6b787e0 +++ botan/alg_id.cpp 858c0ba04cf6592190cd9884dbb178b33b614431 @@ -1,6 +1,6 @@ /************************************************* * Algorithm Identifier Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/alg_id.h bd1c3282eca5505178d2893a434382ecae0d0a81 +++ botan/alg_id.h 2bc04e6582e651e268d9332e60549ecf0beb97fb @@ -1,6 +1,6 @@ /************************************************* * Algorithm Identifier Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_ALGORITHM_IDENTIFIER_H__ ============================================================ --- botan/allocate.h 40ba6112eb7d7da0587f341500d11ced911bff50 +++ botan/allocate.h 532035d3cdec5a2c8fd3250f87a78fa7f3d77eb4 @@ -1,6 +1,6 @@ /************************************************* * Allocator Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_ALLOCATOR_H__ ============================================================ --- botan/arc4.cpp 6b24fa12af23cdd3ec85de63a2f28ff3f89c317d +++ botan/arc4.cpp 0952fe44407bbac2951e58155726cd24e6d4f7b0 @@ -1,6 +1,6 @@ /************************************************* * ARC4 Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/arc4.h 7c4390562e4ef982824e249298873a59d25c266e +++ botan/arc4.h a21035287a093144517501237eec734af70b2c30 @@ -1,6 +1,6 @@ /************************************************* * ARC4 Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_ARC4_H__ ============================================================ --- botan/asn1_alt.cpp c83953b6277d328ba03ac6ec84225b422c5d5ccd +++ botan/asn1_alt.cpp ac84eab7afc78b1de20140301ee3ba62b976acca @@ -1,6 +1,6 @@ /************************************************* * AlternativeName Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/asn1_att.cpp f8cc70185dec4ccc2131de3dd18b84e373c03327 +++ botan/asn1_att.cpp d4fc970d01d3845c9a067b20170c5f49e17d15ed @@ -1,6 +1,6 @@ /************************************************* * Attribute Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/asn1_dn.cpp dc18166f624956f7847db2abbab7f12efd43756d +++ botan/asn1_dn.cpp 9ba0216a56f6a549e27db7abae0ef0bee2686c62 @@ -1,6 +1,6 @@ /************************************************* * X509_DN Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -142,7 +142,7 @@ void X509_DN::do_decode(const MemoryRegi /************************************************* * Return the BER encoded data, if any * *************************************************/ -SecureVector X509_DN::get_bits() const +MemoryVector X509_DN::get_bits() const { return dn_bits; } ============================================================ --- botan/asn1_int.cpp 6850c83199dfd8c4206a9414aaa41fb7ceffe132 +++ botan/asn1_int.cpp f2c2e23eaf6d2fa711a14e0b9d06933d90885501 @@ -1,6 +1,6 @@ /************************************************* * ASN.1 Internals Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -43,8 +43,8 @@ std::string to_string(const BER_Object& *************************************************/ std::string to_string(const BER_Object& obj) { - std::string str((const char*)obj.value.begin(), obj.value.size()); - return str; + return std::string(reinterpret_cast(obj.value.begin()), + obj.value.size()); } /************************************************* ============================================================ --- botan/asn1_int.h a0e0d0b6b41db209d896158c5bde5ce6e1047f87 +++ botan/asn1_int.h e019f2b543443ca344094d8f0156b5eea11f2533 @@ -1,6 +1,6 @@ /************************************************* * ASN.1 Internals Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_ASN1_H__ ============================================================ --- botan/asn1_ku.cpp 4e55b81ad1ff1c50f5912a772946b31ad319963c +++ botan/asn1_ku.cpp 7d55d34b2291f34d75c1f14bbbfecae262e30a65 @@ -1,6 +1,6 @@ /************************************************* * KeyUsage Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/asn1_obj.h eab92560735690dc9209cc4755afe49460738a80 +++ botan/asn1_obj.h dfbdbae68301d279de67562d713133df1258084c @@ -1,6 +1,6 @@ /************************************************* * Common ASN.1 Objects Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_ASN1_OBJ_H__ @@ -24,7 +24,7 @@ class Attribute : public ASN1_Object void decode_from(class BER_Decoder&); OID oid; - SecureVector parameters; + MemoryVector parameters; Attribute() {} Attribute(const OID&, const MemoryRegion&); @@ -99,14 +99,14 @@ class X509_DN : public ASN1_Object static std::string deref_info_field(const std::string&); void do_decode(const MemoryRegion&); - SecureVector get_bits() const; + MemoryVector get_bits() const; X509_DN(); X509_DN(const std::multimap&); X509_DN(const std::multimap&); private: std::multimap dn_info; - SecureVector dn_bits; + MemoryVector dn_bits; }; /************************************************* ============================================================ --- botan/asn1_oid.cpp bb5b7649ce1854c8d0ed6e69a28ad8c25328cdcb +++ botan/asn1_oid.cpp ee4c37e6bcd95a3ed3c5b784bf9b8f22e996e3b6 @@ -1,6 +1,6 @@ /************************************************* * ASN.1 OID Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/asn1_oid.h 0ecf950a1c93059fdf9b86e1d5d11ae6702c5ee1 +++ botan/asn1_oid.h 195a1909830f2ad753a9f471d11f36f9442a5cbc @@ -1,6 +1,6 @@ /************************************************* * ASN.1 OID Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_ASN1_OID_H__ ============================================================ --- botan/asn1_str.cpp 3af21b9efa1dc13316d8b6e3aaafb6f20d2ed8a5 +++ botan/asn1_str.cpp 1a3b46df6c07368ff753748688d171d3f7f16551 @@ -1,6 +1,6 @@ /************************************************* * Simple ASN.1 String Types Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -44,7 +44,7 @@ ASN1_Tag choose_encoding(const std::stri 0x00, 0x00, 0x00, 0x00 }; for(u32bit j = 0; j != str.size(); ++j) - if(!IS_PRINTABLE[(byte)str[j]]) + if(!IS_PRINTABLE[static_cast(str[j])]) { const std::string type = global_config().option("x509/ca/str_type"); ============================================================ --- botan/asn1_tm.cpp 00d95aeaebc9c9ec683d6d5ceaabc4b8e0d3719e +++ botan/asn1_tm.cpp dc31d7c2acb603ce302eee1a40ff69a0fa4cc39a @@ -1,6 +1,6 @@ /************************************************* * X.509 Time Types Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -20,12 +20,8 @@ std::tm get_tm(u64bit timer) *************************************************/ std::tm get_tm(u64bit timer) { - std::time_t time_val = (std::time_t)timer; + std::time_t time_val = static_cast(timer); - if((u64bit)time_val != timer) - throw Encoding_Error("X509_Time: time_t overflow with time value " + - to_string(timer)); - std::tm* tm_p = std::gmtime(&time_val); if(tm_p == 0) throw Encoding_Error("X509_Time: gmtime could not encode " + ============================================================ --- botan/base.cpp 5b375926e0e230d5c2dcbaab4b0b90d67fe1e549 +++ botan/base.cpp 42d599ac6a7769d1ea6cae06c345e8ecb9e2bbcf @@ -1,11 +1,10 @@ /************************************************* * Base Classes Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include #include -#include #include #include @@ -151,7 +150,7 @@ void BufferedComputation::update(const s *************************************************/ void BufferedComputation::update(const std::string& str) { - update((const byte*)str.c_str(), str.size()); + update(reinterpret_cast(str.data()), str.size()); } /************************************************* @@ -243,21 +242,4 @@ u32bit RandomNumberGenerator::add_entrop return entropy_estimate(buffer, bytes_gathered); } -/************************************************* -* Return the version as a string * -*************************************************/ -std::string version_string() - { - return "Botan " + to_string(version_major()) + "." + - to_string(version_minor()) + "." + - to_string(version_patch()); - } - -/************************************************* -* Return parts of the version as integers * -*************************************************/ -u32bit version_major() { return BOTAN_VERSION_MAJOR; } -u32bit version_minor() { return BOTAN_VERSION_MINOR; } -u32bit version_patch() { return BOTAN_VERSION_PATCH; } - } ============================================================ --- botan/base.h 40430e25cf4f29f136af7d391a217ef727e1c0c9 +++ botan/base.h 022214feafcc2f0dcf38edc423be11e907088448 @@ -1,6 +1,6 @@ /************************************************* * Base Classes Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_BASE_H__ ============================================================ --- botan/base64.cpp b2a556c12793e219b3a5fb74321d4aa0e03c9404 +++ botan/base64.cpp 7b86aeea0a40fd1f84bee5aac537a7afc0810994 @@ -1,6 +1,6 @@ /************************************************* * Base64 Encoder/Decoder Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -12,8 +12,8 @@ namespace Botan { /************************************************* * Base64_Encoder Constructor * *************************************************/ -Base64_Encoder::Base64_Encoder(bool breaks, u32bit length) : - line_length(breaks ? length : 0) +Base64_Encoder::Base64_Encoder(bool breaks, u32bit length, bool t_n) : + line_length(breaks ? length : 0), trailing_newline(t_n) { in.create(48); out.create(4); @@ -120,7 +120,7 @@ void Base64_Encoder::end_msg() // Monotone requires a trailing in newline in // all cases, for crypto++ compatibility. - // if(counter && line_length) + // if(trailing_newline || (counter && line_length)) // send('\n'); send('\n'); @@ -150,9 +150,9 @@ void Base64_Decoder::decode(const byte i *************************************************/ void Base64_Decoder::decode(const byte in[4], byte out[3]) { - out[0] = (byte)((BASE64_TO_BIN[in[0]] << 2) | (BASE64_TO_BIN[in[1]] >> 4)); - out[1] = (byte)((BASE64_TO_BIN[in[1]] << 4) | (BASE64_TO_BIN[in[2]] >> 2)); - out[2] = (byte)((BASE64_TO_BIN[in[2]] << 6) | (BASE64_TO_BIN[in[3]])); + out[0] = ((BASE64_TO_BIN[in[0]] << 2) | (BASE64_TO_BIN[in[1]] >> 4)); + out[1] = ((BASE64_TO_BIN[in[1]] << 4) | (BASE64_TO_BIN[in[2]] >> 2)); + out[2] = ((BASE64_TO_BIN[in[2]] << 6) | (BASE64_TO_BIN[in[3]])); } /************************************************* @@ -179,7 +179,8 @@ void Base64_Decoder::handle_bad_char(byt return; throw Decoding_Error( - std::string("Base64_Decoder: Invalid base64 character '") + char(c) + "'" + std::string("Base64_Decoder: Invalid base64 character '") + + static_cast(c) + "'" ); } ============================================================ --- botan/base64.h 3f09eb989fc4b2b391f9cefa31455c9fbd2794cb +++ botan/base64.h da42818acbed79d1916cd6d7e5950e731677204c @@ -1,6 +1,6 @@ /************************************************* * Base64 Encoder/Decoder Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_BASE64_H__ @@ -22,13 +22,14 @@ class Base64_Encoder : public Filter void write(const byte[], u32bit); void end_msg(); // monotone wants breaks by default - Base64_Encoder(bool breaks = true, u32bit = 72); + Base64_Encoder(bool breaks = true, u32bit = 72, bool t_n = false); private: void encode_and_send(const byte[], u32bit); void do_output(const byte[], u32bit); static const byte BIN_TO_BASE64[64]; const u32bit line_length; + const bool trailing_newline; SecureVector in, out; u32bit position, counter; }; ============================================================ --- botan/basefilt.cpp 762c9f006ae634c2d935fbd34a86e8566f71077c +++ botan/basefilt.cpp 0bf28cb04325d403ef59e7189e7972b489900a6f @@ -1,6 +1,6 @@ /************************************************* * Basic Filters Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/basefilt.h 1c2652eaa8d52203589e94003df6b89172530b1b +++ botan/basefilt.h 7e88a84f573ac07ff44bdbdcf6747e3534d75975 @@ -1,6 +1,6 @@ /************************************************* * Basic Filters Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_BASEFILT_H__ ============================================================ --- botan/ber_dec.cpp 1cdc3a17677f2513359b08f1e8bbfcd90daba133 +++ botan/ber_dec.cpp d22b06ac717befb508e9dbe7d34bcf5681280287 @@ -1,6 +1,6 @@ /************************************************* * BER Decoder Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -453,7 +453,7 @@ BER_Decoder& BER_Decoder::decode_optiona { BER_Object obj = get_next_object(); - ASN1_Tag type_tag = (ASN1_Tag)type_no; + ASN1_Tag type_tag = static_cast(type_no); out.clear(); push_back(obj); ============================================================ --- botan/ber_dec.h 14987092b2a66376f2c8ed76948bf026b8379eaf +++ botan/ber_dec.h 9a3931c832c8e5bb00fa2a493532759637bc0201 @@ -1,6 +1,6 @@ /************************************************* * BER Decoder Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_BER_DECODER_H__ ============================================================ --- botan/big_base.cpp 5d4e448c572fe119957039a63ae26781d1c6f28e +++ botan/big_base.cpp e0ee9ef996a0754bd45af121f5199bffff45aed4 @@ -1,6 +1,6 @@ /************************************************* * BigInt Base Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -25,7 +25,7 @@ BigInt::BigInt(u64bit n) reg.create(4*limbs_needed); for(u32bit j = 0; j != limbs_needed; ++j) - reg[j] = (word)((n >> (j*MP_WORD_BITS)) & MP_WORD_MASK); + reg[j] = ((n >> (j*MP_WORD_BITS)) & MP_WORD_MASK); } /************************************************* @@ -73,7 +73,7 @@ BigInt::BigInt(const std::string& str) else if(str.length() > markers + 1 && str[markers] == '0') { markers += 1; base = Octal; } - *this = decode((const byte*)str.data() + markers, + *this = decode(reinterpret_cast(str.data()) + markers, str.length() - markers, base); if(negative) set_sign(Negative); @@ -191,7 +191,7 @@ void BigInt::set_bit(u32bit n) void BigInt::set_bit(u32bit n) { const u32bit which = n / MP_WORD_BITS; - const word mask = (word)1 << (n % MP_WORD_BITS); + const word mask = static_cast(1) << (n % MP_WORD_BITS); if(which >= size()) grow_to(which + 1); reg[which] |= mask; } @@ -202,7 +202,7 @@ void BigInt::clear_bit(u32bit n) void BigInt::clear_bit(u32bit n) { const u32bit which = n / MP_WORD_BITS; - const word mask = (word)1 << (n % MP_WORD_BITS); + const word mask = static_cast(1) << (n % MP_WORD_BITS); if(which < size()) reg[which] &= ~mask; } @@ -216,7 +216,7 @@ void BigInt::mask_bits(u32bit n) if(n >= bits()) return; const u32bit top_word = n / MP_WORD_BITS; - const word mask = ((word)1 << (n % MP_WORD_BITS)) - 1; + const word mask = (static_cast(1) << (n % MP_WORD_BITS)) - 1; if(top_word < size()) for(u32bit j = top_word + 1; j != size(); ++j) @@ -283,7 +283,7 @@ u32bit BigInt::encoded_size(Base base) c else if(base == Octal) return ((bits() + 2) / 3); else if(base == Decimal) - return (u32bit)((bits() * LOG_2_BASE_10) + 1); + return static_cast((bits() * LOG_2_BASE_10) + 1); else throw Invalid_Argument("Unknown base for BigInt encoding"); } @@ -338,6 +338,23 @@ BigInt BigInt::operator-() const } /************************************************* +* Return a reference to the indexed word * +*************************************************/ +word& BigInt::operator[](u32bit index) + { + reg.grow_to(index+1); + return reg[index]; + } + +/************************************************* +* Return the value of the indexed word * +*************************************************/ +word BigInt::operator[](u32bit index) const + { + return (index < size()) ? reg[index] : 0; + } + +/************************************************* * Return the absolute value of this number * *************************************************/ BigInt BigInt::abs() const @@ -375,4 +392,12 @@ void BigInt::binary_decode(const byte bu reg[length / WORD_BYTES] = (reg[length / WORD_BYTES] << 8) | buf[j]; } +/************************************************* +* Set this number to the value in buf * +*************************************************/ +void BigInt::binary_decode(const MemoryRegion& buf) + { + binary_decode(buf, buf.size()); + } + } ============================================================ --- botan/big_code.cpp 2037276e561104c2b79850dd2db314efd8d125c7 +++ botan/big_code.cpp 5b8575b75382b660b9091d177312cd6ae5cd112b @@ -1,6 +1,6 @@ /************************************************* * BigInt Encoding/Decoding Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/big_io.cpp 69a6680403cf935f3cff67a9a0fd9709d7dc77dc +++ botan/big_io.cpp 46db1f3389f22435bac178300359482cf004fba2 @@ -1,6 +1,6 @@ /************************************************* * BigInt Input/Output Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -29,7 +29,8 @@ std::ostream& operator<<(std::ostream& s u32bit skip = 0; while(buffer[skip] == '0' && skip < buffer.size()) ++skip; - stream.write((const char*)buffer.begin() + skip, buffer.size() - skip); + stream.write(reinterpret_cast(buffer.begin()) + skip, + buffer.size() - skip); } if(!stream.good()) throw Stream_IO_Error("BigInt output operator has failed"); ============================================================ --- botan/big_ops2.cpp bc9ec150895a182216ad0500cc9844cfe33dce21 +++ botan/big_ops2.cpp 48afc3ad1501db0257ff9f9b24ab0ef1cb986165 @@ -1,6 +1,6 @@ /************************************************* * BigInt Assignment Operators Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/big_ops3.cpp 76c984c9f13270efb6c5e478a6bc55c58f94629f +++ botan/big_ops3.cpp f94e0d3e2b709f641c97fd01d70dedf5763cb645 @@ -1,6 +1,6 @@ /************************************************* * BigInt Binary Operators Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/big_rand.cpp 4541fc4ea65f0a9fcc7b5741fa618a6302884fad +++ botan/big_rand.cpp fed09e9a738b920aa693f66c991a35083033d953 @@ -1,6 +1,6 @@ /************************************************* * BigInt Random Generation Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/bigint.h 48a250ff969b40bb44bfac67b3b450a0fe58fc97 +++ botan/bigint.h f81e5621041cfc85cafbe2a72f9ce5fb7145ec58 @@ -1,6 +1,6 @@ /************************************************* * BigInt Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_BIGINT_H__ @@ -78,14 +78,15 @@ class BigInt SecureVector& get_reg() { return reg; } void grow_reg(u32bit) const; - word& operator[](u32bit index) { return reg[index]; } - word operator[](u32bit index) const { return reg[index]; } + word& operator[](u32bit); + word operator[](u32bit) const; void clear() { reg.clear(); } void randomize(u32bit = 0); void binary_encode(byte[]) const; void binary_decode(const byte[], u32bit); + void binary_decode(const MemoryRegion&); u32bit encoded_size(Base = Binary) const; static SecureVector encode(const BigInt&, Base = Binary); ============================================================ --- botan/bit_ops.cpp b35d3f6d5f4ea883ba3551f958ac08ad3f028036 +++ botan/bit_ops.cpp d42b4bc18f574f8b848335613aa7b102868dcc59 @@ -1,6 +1,6 @@ /************************************************* * Bit/Word Operations Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/bit_ops.h 322ee2eec0304c996d7816aba3d735a47db66b47 +++ botan/bit_ops.h 77538dc92d95bf5bdca68230ea5626bf117c7994 @@ -1,47 +1,27 @@ /************************************************* * Bit/Word Operations Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_BIT_OPS_H__ #define BOTAN_BIT_OPS_H__ #include +#include namespace Botan { /************************************************* -* Rotation Functions * +* Word Rotation Functions * *************************************************/ template inline T rotate_left(T input, u32bit rot) - { return (T)((input << rot) | (input >> (8*sizeof(T)-rot))); } + { + return static_cast((input << rot) | (input >> (8*sizeof(T)-rot)));; + } template inline T rotate_right(T input, u32bit rot) - { return (T)((input >> rot) | (input << (8*sizeof(T)-rot))); } - -/************************************************* -* Byte Extraction Function * -*************************************************/ -template inline byte get_byte(u32bit byte_num, T input) - { return (byte)(input >> ((sizeof(T)-1-(byte_num&(sizeof(T)-1))) << 3)); } - -/************************************************* -* Byte to Word Conversions * -*************************************************/ -inline u16bit make_u16bit(byte input0, byte input1) - { return (u16bit)(((u16bit)input0 << 8) | input1); } - -inline u32bit make_u32bit(byte input0, byte input1, byte input2, byte input3) - { return (u32bit)(((u32bit)input0 << 24) | ((u32bit)input1 << 16) | - ((u32bit)input2 << 8) | input3); } - -inline u64bit make_u64bit(byte input0, byte input1, byte input2, byte input3, - byte input4, byte input5, byte input6, byte input7) { - return (u64bit)(((u64bit)input0 << 56) | ((u64bit)input1 << 48) | - ((u64bit)input2 << 40) | ((u64bit)input3 << 32) | - ((u64bit)input4 << 24) | ((u64bit)input5 << 16) | - ((u64bit)input6 << 8) | input7); + return static_cast((input >> rot) | (input << (8*sizeof(T)-rot))); } /************************************************* ============================================================ --- botan/blinding.cpp 57d0d0adedcb70339c09939e9e88ef95f37357f9 +++ botan/blinding.cpp 53fd0d7c91414698f91d3a69220267f839eef5bd @@ -1,6 +1,6 @@ /************************************************* * Blinder Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/blinding.h 296b45b8f600d94a9fc559c53ba894cd295e0eaa +++ botan/blinding.h 5ae0964e91119dc16655961306333f7000008883 @@ -1,6 +1,6 @@ /************************************************* * Blinder Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_BLINDER_H__ ============================================================ --- botan/botan.h c0c08cc25e4a651665ff390a832d6d5292748e5b +++ botan/botan.h cfc212d6a3fdb91720ddab3f26ca1a9091dcc990 @@ -1,6 +1,6 @@ /************************************************* * Botan Core Interface Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -9,5 +9,4 @@ #include #include #include -#include #include ============================================================ --- botan/buf_es.cpp 2e725066213e388d4a875613b774203e8fda58d0 +++ botan/buf_es.cpp 0662ad86a41b68df7d8ca64b4f8fd944c558fa8f @@ -1,6 +1,6 @@ /************************************************* * Buffered EntropySource Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -52,7 +52,7 @@ void Buffered_EntropySource::add_bytes(c *************************************************/ void Buffered_EntropySource::add_bytes(const void* entropy_ptr, u32bit length) { - const byte* bytes = (const byte*)entropy_ptr; + const byte* bytes = static_cast(entropy_ptr); while(length) { u32bit copied = std::min(length, buffer.size() - write_pos); @@ -68,7 +68,7 @@ void Buffered_EntropySource::add_bytes(u *************************************************/ void Buffered_EntropySource::add_bytes(u64bit entropy) { - add_bytes((const void*)&entropy, 8); + add_bytes(&entropy, 8); } /************************************************* ============================================================ --- botan/buf_es.h b2d0dfcc87c0ef93a415b96460fb91650bab50ce +++ botan/buf_es.h bb5084e9761ec48aa5cd05338fd1fa4a24be1310 @@ -1,6 +1,6 @@ /************************************************* * Buffered EntropySource Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_BUFFERED_ES_H__ ============================================================ --- botan/buf_filt.cpp 2e4113960addc661421f7166495f965485df97a6 +++ botan/buf_filt.cpp 11bc0ada5c75834743d69633f41a4c5ae579a793 @@ -1,6 +1,6 @@ /************************************************* * Buffering Filter Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/buf_filt.h 7282bd3d30c910df817e76a6c9946c129ebfce26 +++ botan/buf_filt.h 488483f238749da1c611c10a108278e16147cb76 @@ -1,6 +1,6 @@ /************************************************* * Buffering Filter Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_BUFFERING_FILTER_H__ ============================================================ --- botan/build.h b99017e7e9e956e54c179f50d26fd45646a52ff4 +++ botan/build.h 2239983ea39c409b32f0e0722d4f99bba86a87e9 @@ -1,14 +1,14 @@ /************************************************* -* Build Config Header File * -* (C) 1999-2006 The Botan Project * +* Build Configuration Header File * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_BUILD_CONFIG_H__ #define BOTAN_BUILD_CONFIG_H__ #define BOTAN_VERSION_MAJOR 1 -#define BOTAN_VERSION_MINOR 5 -#define BOTAN_VERSION_PATCH 10 +#define BOTAN_VERSION_MINOR 7 +#define BOTAN_VERSION_PATCH 2 #define BOTAN_MP_WORD_BITS 32 #define BOTAN_DEFAULT_BUFFER_SIZE 4096 @@ -16,15 +16,4 @@ #define BOTAN_KARAT_MUL_THRESHOLD 12 #define BOTAN_KARAT_SQR_THRESHOLD 12 -#define BOTAN_GZIP_OS_CODE 255 - -#if defined(_MSC_VER) - #pragma warning(disable: 4250 4290) -#define BOTAN_EXT_ENTROPY_SRC_WIN32 -#define BOTAN_EXT_ENTROPY_SRC_CAPI #endif - -#define BOTAN_EXT_COMPRESSOR_GZIP -#define BOTAN_EXT_COMPRESSOR_ZLIB - -#endif ============================================================ --- botan/cbc.cpp c5fbfe43bba5f023c3b0d34d055d17371266a217 +++ botan/cbc.cpp 55675107518ff82b5299a3a5d57728591ae6a638 @@ -1,6 +1,6 @@ /************************************************* * CBC Mode Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/cbc.h 8d0a2b5c936d2be6750f3870cab6f4f262358751 +++ botan/cbc.h 8f29180d6fb4af093a83374d9c6850eeff371530 @@ -1,6 +1,6 @@ /************************************************* * CBC Mode Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_CBC_H__ ============================================================ --- botan/certstor.cpp 4decdbbea3ecee7c3db7a80ba2d58a2aed60a61f +++ botan/certstor.cpp ee6d45de7e984615290f9355740a2caca60fa11b @@ -1,6 +1,6 @@ /************************************************* * Certificate Store Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/certstor.h f76ddb23c18ad7da273da838831ce1b4f9e99e1f +++ botan/certstor.h 98d85d143337d3bceef3f19eab26d7a64ce958b0 @@ -1,6 +1,6 @@ /************************************************* * Certificate Store Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_CERT_STORE_H__ ============================================================ --- botan/cfb.cpp 09210c773f789ae5217375ff32a8388b61166791 +++ botan/cfb.cpp 640fd6b7b7b4ac2b3f64d242795b7f89a649349e @@ -1,6 +1,6 @@ /************************************************* * CFB Mode Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/cfb.h bb45d558c81fc04ab816789c2c8c83eab422e979 +++ botan/cfb.h 15af4384d5fa420812dbb01b0f18fcdd44a2b19c @@ -1,6 +1,6 @@ /************************************************* * CFB Mode Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_CFB_H__ ============================================================ --- botan/charset.cpp 2e6502139430d9ebc56d754dee9b181a6aed8ab0 +++ botan/charset.cpp 9b04fadf0a683fbf0bcf033846b3848f1cb599d6 @@ -1,6 +1,6 @@ /************************************************* * Character Set Handling Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -92,7 +92,8 @@ bool caseless_cmp(char a, char b) *************************************************/ bool caseless_cmp(char a, char b) { - return (std::tolower((unsigned char)a) == std::tolower((unsigned char)b)); + return (std::tolower(static_cast(a)) == + std::tolower(static_cast(b))); } } ============================================================ --- botan/charset.h 6a88424f9ef7fed691711cd0f7eff129728d86d0 +++ botan/charset.h 5aef46caf0040c02fc7e648b02ab9e5f21a66640 @@ -1,6 +1,6 @@ /************************************************* * Character Set Handling Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_CHARSET_H__ ============================================================ --- botan/config.cpp 0c3d3bed551ae74cdb33be1843727648e87a80a2 +++ botan/config.cpp cb5e6f5108247da86e71cfbb2e553cfc755d4c9a @@ -1,6 +1,6 @@ /************************************************* * Configuration Handling Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/config.h 67ea849588c76de31039a5b31d47983ae8ad7159 +++ botan/config.h 38e23953e7b72c4faf77c743cd894fa7c3aea1cf @@ -1,6 +1,6 @@ /************************************************* * Configuration Handling Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_POLICY_CONF_H__ ============================================================ --- botan/crc32.cpp 37a171205e892360539205e21f099fcf788cd33f +++ botan/crc32.cpp 2ee196e8c63de2044782412cb88b5961603a4eea @@ -1,6 +1,6 @@ /************************************************* * CRC32 Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -93,8 +93,7 @@ void CRC32::final_result(byte output[]) void CRC32::final_result(byte output[]) { crc ^= 0xFFFFFFFF; - for(u32bit j = 0; j != 4; ++j) - output[j] = get_byte(j, crc); + store_be(crc, output); clear(); } ============================================================ --- botan/crc32.h f0b4e516463a6bb833eaa5cbfe6717b831860e14 +++ botan/crc32.h f6b49ba25578e41cbe4a7472d79c1ce21cc1a62f @@ -1,6 +1,6 @@ /************************************************* * CRC32 Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_CRC32_H__ ============================================================ --- botan/credits.txt 85ddc6df5c8a471857bdcd11614a8d7ac9946f97 +++ botan/credits.txt 9d06d23a922b731a18611d1935f3d5379d267346 @@ -17,6 +17,11 @@ N: Hany Greiss D: Windows porting +N: Yves Jerschow +E: address@hidden +D: Optimizations for memory load/store and HMAC +S: Germany + N: Matt Johnston D: Allocator fixes and optimizations, decompressor fixes @@ -33,9 +38,9 @@ W: http://www.randombit.net/ P: 3F69 2E64 6D92 3BBE E7AE 9258 5C0F 96E8 4EC1 6D6B D: Original author -S: Washington DC, USA +S: New York NY, USA N: Luca Piccarreta E: address@hidden -D: MS Windows mutex module, x86/amd64 assembler +D: x86/amd64 assembler, BigInt optimizations, Win32 mutex S: Italy ============================================================ --- botan/crl_ent.cpp 87b6c78cdeacc1638e024bd7a21350b437a052fc +++ botan/crl_ent.cpp 5bea084ef556530cb38d3de655db2983ff08f5ca @@ -1,6 +1,6 @@ /************************************************* * CRL Entry Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/crl_ent.h 2fef63f7241684e554dee9cf36819814d86619fa +++ botan/crl_ent.h 9127f49c66a94bb11d6b70b3f0784e9df6f4d19a @@ -1,6 +1,6 @@ /************************************************* * CRL Entry Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_CRL_ENTRY_H__ ============================================================ --- botan/ctr.cpp e38e980590fc2dc1b69529f16843f425292627ab +++ botan/ctr.cpp 09b318f266cc6fda6a86f668e69d9021040a501a @@ -1,6 +1,6 @@ /************************************************* * CTR Mode Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/ctr.h de9842ca4641c8e4c759178799af038053da3516 +++ botan/ctr.h d15c21f4e99621bec26e24dd7357e25bcccd3694 @@ -1,6 +1,6 @@ /************************************************* * CTR Mode Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_CTR_H__ ============================================================ --- botan/cts.cpp 77c48b7d93e12da5a2caa08742008f512666b48b +++ botan/cts.cpp d13a1e07356db170c111b337cf4d0cd4ea6a439f @@ -1,6 +1,6 @@ /************************************************* * CTS Mode Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/cts.h b3629ba48d49a2501e447a48eda76850f34130f9 +++ botan/cts.h 800a52b621bae83bd0bf563d01e17c6994e8e052 @@ -1,6 +1,6 @@ /************************************************* * CTS Mode Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_CTS_H__ ============================================================ --- botan/data_snk.cpp 72e9615bb9e131d1ffa6f97e19f280a26d407617 +++ botan/data_snk.cpp fae39562bf0033d40f6bf9d9959228adab62a8b2 @@ -1,6 +1,6 @@ /************************************************* * DataSink Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -13,7 +13,7 @@ void DataSink_Stream::write(const byte o *************************************************/ void DataSink_Stream::write(const byte out[], u32bit length) { - sink->write((const char*)out, length); + sink->write(reinterpret_cast(out), length); if(!sink->good()) throw Stream_IO_Error("DataSink_Stream: Failure writing to " + fsname); } ============================================================ --- botan/data_snk.h 2f0b3b675f98fb0e5133a998790fc0dd55b4c30d +++ botan/data_snk.h 6e50479354754787a7ea8f1c87b4e5d19104d9ce @@ -1,6 +1,6 @@ /************************************************* * DataSink Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_DATA_SINK_H__ ============================================================ --- botan/data_src.cpp e245dee359e2eee95aa98f26e0e44a80e2687207 +++ botan/data_src.cpp 0b0c1e5793da7b053571a78da4ee951013211190 @@ -1,6 +1,6 @@ /************************************************* * DataSource Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -93,7 +93,7 @@ DataSource_Memory::DataSource_Memory(con *************************************************/ DataSource_Memory::DataSource_Memory(const std::string& in) { - source.set((const byte*)in.c_str(), in.length()); + source.set(reinterpret_cast(in.data()), in.length()); offset = 0; } @@ -102,13 +102,13 @@ u32bit DataSource_Stream::read(byte out[ *************************************************/ u32bit DataSource_Stream::read(byte out[], u32bit length) { - source->read((char*)out, length); + source->read(reinterpret_cast(out), length); if(source->bad()) throw Stream_IO_Error("DataSource_Stream::read: Source failure"); u32bit got = source->gcount(); total_read += got; - return (u32bit)got; + return got; } /************************************************* @@ -124,7 +124,7 @@ u32bit DataSource_Stream::peek(byte out[ if(offset) { SecureVector buf(offset); - source->read((char*)buf.begin(), buf.size()); + source->read(reinterpret_cast(buf.begin()), buf.size()); if(source->bad()) throw Stream_IO_Error("DataSource_Stream::peek: Source failure"); got = source->gcount(); @@ -132,7 +132,7 @@ u32bit DataSource_Stream::peek(byte out[ if(got == offset) { - source->read((char*)out, length); + source->read(reinterpret_cast(out), length); if(source->bad()) throw Stream_IO_Error("DataSource_Stream::peek: Source failure"); got = source->gcount(); ============================================================ --- botan/data_src.h 3c1805ef300f5650a79f4ad6c1d0151f478cdf3b +++ botan/data_src.h f12df31357e4bb3075136128d77881e23b9ee025 @@ -1,6 +1,6 @@ /************************************************* * DataSource Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_DATA_SRC_H__ ============================================================ --- botan/datastor.cpp c274eb601aebe3a216ca7dcd47d3571284d492c8 +++ botan/datastor.cpp 301a7be0303d65b1589216c1f2bcb072ac17e34b @@ -1,6 +1,6 @@ /************************************************* * Data Store Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/datastor.h 88ffe567d95a2401a283e9c3650bc07345edff8f +++ botan/datastor.h 3f6602fad0bcd817cc7934c9497648d14074070b @@ -1,6 +1,6 @@ /************************************************* * Data Store Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_DATA_STORE_H__ ============================================================ --- botan/def_alg.cpp 20b41dbd1ebe04bc807d3bfce084934ee98149d4 +++ botan/def_alg.cpp ab23a129c01fbdac53f0aedae41f05c34968517b @@ -1,6 +1,6 @@ /************************************************* * Default Engine Algorithms Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -131,6 +132,7 @@ Default_Engine::find_mac(const std::stri return 0; const std::string algo_name = deref_alias(name[0]); + HANDLE_TYPE_ONE_STRING("CBC-MAC", CBC_MAC); HANDLE_TYPE_ONE_STRING("HMAC", HMAC); return 0; ============================================================ --- botan/def_char.cpp 537e2b15fc5921c1ed16e3d6e9b5d6230d36eeb6 +++ botan/def_char.cpp 9d0a75ae7178a2423bb4e1a0f11473f8231b8cc4 @@ -1,6 +1,6 @@ /************************************************* * Default Character Set Handling Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -29,7 +29,7 @@ std::string ucs2_to_latin1(const std::st if(c1 != 0) throw Decoding_Error("UCS-2 has non-Latin1 characters"); - latin1 += (char)c2; + latin1 += static_cast(c2); } return latin1; @@ -45,22 +45,22 @@ std::string utf8_to_latin1(const std::st u32bit position = 0; while(position != utf8.size()) { - const byte c1 = (byte)utf8[position++]; + const byte c1 = static_cast(utf8[position++]); if(c1 <= 0x7F) - iso8859 += (char)c1; + iso8859 += static_cast(c1); else if(c1 >= 0xC0 && c1 <= 0xC7) { if(position == utf8.size()) throw Decoding_Error("UTF-8: sequence truncated"); - const byte c2 = (byte)utf8[position++]; + const byte c2 = static_cast(utf8[position++]); const byte iso_char = ((c1 & 0x07) << 6) | (c2 & 0x3F); if(iso_char <= 0x7F) throw Decoding_Error("UTF-8: sequence longer than needed"); - iso8859 += (char)iso_char; + iso8859 += static_cast(iso_char); } else throw Decoding_Error("UTF-8: Unicode chars not in Latin1 used"); @@ -77,14 +77,14 @@ std::string latin1_to_utf8(const std::st std::string utf8; for(u32bit j = 0; j != iso8859.size(); ++j) { - const byte c = (byte)iso8859[j]; + const byte c = static_cast(iso8859[j]); if(c <= 0x7F) - utf8 += (char)c; + utf8 += static_cast(c); else { - utf8 += (char)(0xC0 | (c >> 6)); - utf8 += (char)(0x80 | (c & 0x3F)); + utf8 += static_cast((0xC0 | (c >> 6))); + utf8 += static_cast((0x80 | (c & 0x3F))); } } return utf8; ============================================================ --- botan/def_char.h 692a74603fa47364c728b2aefb8b842daafa747c +++ botan/def_char.h 02092515909d213909ed0d9705676e69f31d3ca8 @@ -1,6 +1,6 @@ /************************************************* * Default Character Set Handling Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_DEFAULT_CHARSET_H__ ============================================================ --- botan/def_mode.cpp 8cbf475c54f99c4526351c1e98285a324e19c1d5 +++ botan/def_mode.cpp 691cb0c3bff70d8d74df99cdde4c9e155687bc3e @@ -1,6 +1,6 @@ /************************************************* * Default Engine Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/def_ops.cpp 96ab0693a4990b326ac2eebe84dea11a9b970aa0 +++ botan/def_ops.cpp 5c9ed9b4ab2a62b38445ba340f5920b6dd8ba5e1 @@ -1,6 +1,6 @@ /************************************************* * Default Engine PK Operations Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/def_powm.cpp c0632ec6e1c5499467760bb99c31765c0d6ee90b +++ botan/def_powm.cpp ca58e34d3b5679bc60ced7813df3a350ca3f577f @@ -1,6 +1,6 @@ /************************************************* * Modular Exponentiation Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/def_powm.h c651a1990e9c5f92109014f725290c5698a0098b +++ botan/def_powm.h db2161b9b4c38ff0d80cbf979ba89526632d76d7 @@ -1,6 +1,6 @@ /************************************************* * Modular Exponentiation Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_DEFAULT_MODEXP_H__ ============================================================ --- botan/defalloc.cpp c3b3858bb8e929a219c7067a21d09e97d9efaa3d +++ botan/defalloc.cpp 940db8ef03ae170341d257f9f7e4320ee3938935 @@ -1,6 +1,6 @@ /************************************************* * Basic Allocators Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/defalloc.h f5ff6c8823b0cf28909a39f2532d4dad7efb06b3 +++ botan/defalloc.h ef3958943a473c5a5068dbf77eae02e7cafa55fa @@ -1,6 +1,6 @@ /************************************************* * Basic Allocators Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_BASIC_ALLOC_H__ ============================================================ --- botan/der_enc.cpp cd64c52d61cbb911adec3c8b615e93df0739372f +++ botan/der_enc.cpp 431f71f58e378c7de52d0f540e5271fe705f5e65 @@ -1,6 +1,6 @@ /************************************************* * DER Encoder Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -25,7 +25,7 @@ SecureVector encode_tag(ASN1_Tag t SecureVector encoded_tag; if(type_tag <= 30) - encoded_tag.append((byte)(type_tag | class_tag)); + encoded_tag.append(static_cast(type_tag | class_tag)); else { u32bit blocks = high_bit(type_tag) + 6; @@ -47,11 +47,11 @@ SecureVector encode_length(u32bit { SecureVector encoded_length; if(length <= 127) - encoded_length.append((byte)length); + encoded_length.append(static_cast(length)); else { const u32bit top_byte = significant_bytes(length); - encoded_length.append((byte)(0x80 | top_byte)); + encoded_length.append(static_cast(0x80 | top_byte)); for(u32bit j = 4-top_byte; j != 4; ++j) encoded_length.append(get_byte(j, length)); } @@ -157,7 +157,7 @@ DER_Encoder& DER_Encoder::start_explicit *************************************************/ DER_Encoder& DER_Encoder::start_explicit(u16bit type_no) { - ASN1_Tag type_tag = (ASN1_Tag)type_no; + ASN1_Tag type_tag = static_cast(type_no); if(type_tag == SET) throw Internal_Error("DER_Encoder.start_explicit(SET); cannot perform"); @@ -373,7 +373,7 @@ DER_Encoder& DER_Encoder::add_object(ASN DER_Encoder& DER_Encoder::add_object(ASN1_Tag type_tag, ASN1_Tag class_tag, const std::string& rep_str) { - const byte* rep = (const byte*)rep_str.c_str(); + const byte* rep = reinterpret_cast(rep_str.data()); const u32bit rep_len = rep_str.size(); return add_object(type_tag, class_tag, rep, rep_len); } ============================================================ --- botan/der_enc.h 343cbe1d916c91b2b78504674240aeb4fa5ca04e +++ botan/der_enc.h 2c3f47a1c7d1f360948af20ca6927548dae30090 @@ -1,6 +1,6 @@ /************************************************* * DER Encoder Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_DER_ENCODER_H__ ============================================================ --- botan/des.cpp 789f5036773e7a823b36016967f0b351686f0e5a +++ botan/des.cpp b4b952183124098874fc21851366dfec58fdd8de @@ -1,6 +1,6 @@ /************************************************* * DES Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -13,17 +13,13 @@ void DES::enc(const byte in[], byte out[ *************************************************/ void DES::enc(const byte in[], byte out[]) const { - u32bit L = make_u32bit(in[0], in[1], in[2], in[3]), - R = make_u32bit(in[4], in[5], in[6], in[7]); + u32bit L = load_be(in, 0), R = load_be(in, 1); IP(L, R); raw_encrypt(L, R); FP(L, R); - out[0] = get_byte(0, R); out[1] = get_byte(1, R); - out[2] = get_byte(2, R); out[3] = get_byte(3, R); - out[4] = get_byte(0, L); out[5] = get_byte(1, L); - out[6] = get_byte(2, L); out[7] = get_byte(3, L); + store_be(out, R, L); } /************************************************* @@ -31,17 +27,13 @@ void DES::dec(const byte in[], byte out[ *************************************************/ void DES::dec(const byte in[], byte out[]) const { - u32bit L = make_u32bit(in[0], in[1], in[2], in[3]), - R = make_u32bit(in[4], in[5], in[6], in[7]); + u32bit L = load_be(in, 0), R = load_be(in, 1); IP(L, R); raw_decrypt(L, R); FP(L, R); - out[0] = get_byte(0, R); out[1] = get_byte(1, R); - out[2] = get_byte(2, R); out[3] = get_byte(3, R); - out[4] = get_byte(0, L); out[5] = get_byte(1, L); - out[6] = get_byte(2, L); out[7] = get_byte(3, L); + store_be(out, R, L); } /************************************************* @@ -53,8 +45,8 @@ void DES::IP(u32bit& L, u32bit& R) (IPTAB1[get_byte(2, L)] << 2) | (IPTAB1[get_byte(3, L)] << 3) | (IPTAB1[get_byte(0, R)] << 4) | (IPTAB1[get_byte(1, R)] << 5) | (IPTAB1[get_byte(2, R)] << 6) | (IPTAB2[get_byte(3, R)] ); - L = (u32bit)((T >> 32) & 0xFFFFFFFF); - R = (u32bit)((T ) & 0xFFFFFFFF); + L = static_cast(T >> 32); + R = static_cast(T); } /************************************************* @@ -66,8 +58,8 @@ void DES::FP(u32bit& L, u32bit& R) (FPTAB1[get_byte(2, L)] << 1) | (FPTAB2[get_byte(3, L)] << 1) | (FPTAB1[get_byte(0, R)] << 4) | (FPTAB1[get_byte(1, R)] << 2) | (FPTAB1[get_byte(2, R)] ) | (FPTAB2[get_byte(3, R)] ); - L = (u32bit)((T >> 32) & 0xFFFFFFFF); - R = (u32bit)((T ) & 0xFFFFFFFF); + L = static_cast(T >> 32); + R = static_cast(T); } /************************************************* @@ -193,8 +185,7 @@ void TripleDES::enc(const byte in[], byt *************************************************/ void TripleDES::enc(const byte in[], byte out[]) const { - u32bit L = make_u32bit(in[0], in[1], in[2], in[3]), - R = make_u32bit(in[4], in[5], in[6], in[7]); + u32bit L = load_be(in, 0), R = load_be(in, 1); DES::IP(L, R); des1.raw_encrypt(L, R); @@ -202,10 +193,7 @@ void TripleDES::enc(const byte in[], byt des3.raw_encrypt(L, R); DES::FP(L, R); - out[0] = get_byte(0, R); out[1] = get_byte(1, R); - out[2] = get_byte(2, R); out[3] = get_byte(3, R); - out[4] = get_byte(0, L); out[5] = get_byte(1, L); - out[6] = get_byte(2, L); out[7] = get_byte(3, L); + store_be(out, R, L); } /************************************************* @@ -213,8 +201,7 @@ void TripleDES::dec(const byte in[], byt *************************************************/ void TripleDES::dec(const byte in[], byte out[]) const { - u32bit L = make_u32bit(in[0], in[1], in[2], in[3]), - R = make_u32bit(in[4], in[5], in[6], in[7]); + u32bit L = load_be(in, 0), R = load_be(in, 1); DES::IP(L, R); des3.raw_decrypt(L, R); @@ -222,10 +209,7 @@ void TripleDES::dec(const byte in[], byt des1.raw_decrypt(L, R); DES::FP(L, R); - out[0] = get_byte(0, R); out[1] = get_byte(1, R); - out[2] = get_byte(2, R); out[3] = get_byte(3, R); - out[4] = get_byte(0, L); out[5] = get_byte(1, L); - out[6] = get_byte(2, L); out[7] = get_byte(3, L); + store_be(out, R, L); } /************************************************* ============================================================ --- botan/des.h fa8ae2ada50a692c3eb15d3e6b21e4186ffaed3c +++ botan/des.h 6b9b0d2c5317640b063920f56dffaca554a9aeaa @@ -1,6 +1,6 @@ /************************************************* * DES Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_DES_H__ ============================================================ --- botan/des_tab.cpp a45c36b824fabc92baa7a6d2e4b2d1a99f5218b7 +++ botan/des_tab.cpp 0f68541315b311ff8553ad5e2e523e83a5cf1533 @@ -1,6 +1,6 @@ /************************************************* * Substitution/Permutation Tables for DES * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/dh.cpp b1eda80f340c7e402ff8a3755871375c386bc05c +++ botan/dh.cpp d751f576b0d623a8842e974b7222a69609a31de2 @@ -1,6 +1,6 @@ /************************************************* * Diffie-Hellman Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/dh.h 9c89a68c5a94d701481c9833e399ea37bf36efdc +++ botan/dh.h f3dc596fa2092a4d991746a40e631b45dcde830e @@ -1,6 +1,6 @@ /************************************************* * Diffie-Hellman Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_DIFFIE_HELLMAN_H__ ============================================================ --- botan/divide.cpp 908f830f2ae320c5da46f26e7293a17d44acae15 +++ botan/divide.cpp e422958f75e485021705cced9c02be03d49f4312 @@ -1,6 +1,6 @@ /************************************************* * Division Algorithm Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -63,7 +63,7 @@ void divide(const BigInt& x, const BigIn q.get_reg().create(n - t + 1); if(n <= t) { - while(r > y) { r -= y; q++; } + while(r > y) { r -= y; ++q; } r >>= shifts; sign_fixup(x, y_arg, q, r); return; ============================================================ --- botan/dl_algo.cpp fe03bbae560ce2e38f0fc0f4c768b79a56ac5036 +++ botan/dl_algo.cpp 625deb904170bae96d19fadc0d6ac5f4cc677d9d @@ -1,6 +1,6 @@ /************************************************* * DL Scheme Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/dl_algo.h d0a0db3bac29456c28426a65103b4cc9712d6aeb +++ botan/dl_algo.h c635a1d4ce27c0bf2d65dfcc29d27925bb18ebe7 @@ -1,6 +1,6 @@ /************************************************* * DL Scheme Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_DL_ALGO_H__ ============================================================ --- botan/dl_group.cpp 5814b0a9a7ff2ab4ddde3d362a1f3eba24ddff19 +++ botan/dl_group.cpp 6a5022b0c81f660c85b912ad3e0a6ebd78c4ae85 @@ -1,6 +1,6 @@ /************************************************* * Discrete Logarithm Parameters Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -28,14 +28,19 @@ DL_Group::DL_Group(const std::string& ty *************************************************/ DL_Group::DL_Group(const std::string& type) { - DataSource_Memory pem(global_config().get("dl", type)); + std::string grp_contents = global_config().get("dl", type); + + if(grp_contents == "") + throw Invalid_Argument("DL_Group: Unknown group " + type); + + DataSource_Memory pem(grp_contents); PEM_decode(pem); } /************************************************* * DL_Group Constructor * *************************************************/ -DL_Group::DL_Group(u32bit pbits, PrimeType type) +DL_Group::DL_Group(PrimeType type, u32bit pbits, u32bit qbits) { if(pbits < 512) throw Invalid_Argument("DL_Group: prime size " + to_string(pbits) + @@ -51,7 +56,9 @@ DL_Group::DL_Group(u32bit pbits, PrimeTy { if(type == Prime_Subgroup) { - const u32bit qbits = 2 * dl_work_factor(pbits); + if(!qbits) + qbits = 2 * dl_work_factor(pbits); + q = random_prime(qbits); BigInt X; while(p.bits() != pbits || !is_prime(p)) @@ -61,7 +68,10 @@ DL_Group::DL_Group(u32bit pbits, PrimeTy } } else - generate_dsa_primes(p, q, pbits); + { + qbits = qbits ? qbits : ((pbits == 1024) ? 160 : 256); + generate_dsa_primes(p, q, pbits, qbits); + } g = make_dsa_generator(p, q); } @@ -72,9 +82,9 @@ DL_Group::DL_Group(u32bit pbits, PrimeTy /************************************************* * DL_Group Constructor * *************************************************/ -DL_Group::DL_Group(const MemoryRegion& seed, u32bit pbits, u32bit start) +DL_Group::DL_Group(const MemoryRegion& seed, u32bit pbits, u32bit qbits) { - if(!generate_dsa_primes(p, q, seed.begin(), seed.size(), pbits, start)) + if(!generate_dsa_primes(p, q, pbits, qbits, seed)) throw Invalid_Argument("DL_Group: The seed/counter given does not " "generate a DSA group"); ============================================================ --- botan/dl_group.h bf3839e75b8ec5d4d8b805f74c2098ee7b4f9140 +++ botan/dl_group.h 5c9bb309357d9ef7c1a2140496bbcdb535216919 @@ -1,6 +1,6 @@ /************************************************* * Discrete Logarithm Group Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_DL_PARAM_H__ @@ -31,15 +31,19 @@ class DL_Group void BER_decode(DataSource&, Format); void PEM_decode(DataSource&); - static BigInt make_dsa_generator(const BigInt&, const BigInt&); - DL_Group(); DL_Group(const std::string&); - DL_Group(u32bit, PrimeType = Strong); + DL_Group(PrimeType, u32bit, u32bit = 0); DL_Group(const MemoryRegion&, u32bit = 1024, u32bit = 0); DL_Group(const BigInt&, const BigInt&); DL_Group(const BigInt&, const BigInt&, const BigInt&); private: + static BigInt make_dsa_generator(const BigInt&, const BigInt&); + static SecureVector generate_dsa_primes(BigInt&, BigInt&, + u32bit, u32bit); + static bool generate_dsa_primes(BigInt&, BigInt&, u32bit, u32bit, + const MemoryRegion&); + void init_check() const; void initialize(const BigInt&, const BigInt&, const BigInt&); bool initialized; ============================================================ --- botan/dlies.cpp 17ac2bfa1bf4c527c5b5ed886da76c9c8ea1df4c +++ botan/dlies.cpp 1a6fe83f39fdd7be11e3e4b8987b0fbe9241f6b5 @@ -1,6 +1,6 @@ /************************************************* * DLIES Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/dlies.h 0a3b5f38ec3c4216823fd8fbab906ff8697a8558 +++ botan/dlies.h b77520fa0b8dd5c3f57b803212ca965fbefdd961 @@ -1,6 +1,6 @@ /************************************************* * DLIES Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_DLIES_H__ ============================================================ --- botan/eax.cpp 8a31a913491b67718e6ddf39df4e3d9eef489953 +++ botan/eax.cpp f1e9e17e046aa6de0450fc4773faeb73d8f2b7e1 @@ -1,6 +1,6 @@ /************************************************* * EAX Mode Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/eax.h 193bbdd18e398ac054a8e05ae553afbdec291c24 +++ botan/eax.h 8aa3f7f2c01a0ce9f5782cf66461e0c1a72145c3 @@ -1,6 +1,6 @@ /************************************************* * EAX Mode Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_EAX_H__ ============================================================ --- botan/ecb.cpp 281a354f3c97e99d8e808137d78c7dce5abff8ee +++ botan/ecb.cpp 202f9bb2055a498f0e5ee7a861ceaa011b025caf @@ -1,6 +1,6 @@ /************************************************* * ECB Mode Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/ecb.h 37d5e3f25deeb99b34c17b492649c422e1aaae24 +++ botan/ecb.h 29ab7f13429e9642e9e3dc22569ab6bfb80d38f2 @@ -1,6 +1,6 @@ /************************************************* * ECB Mode Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_ECB_H__ ============================================================ --- botan/eme.h b22fa5c9c91835dcc5f0915ef6f7ddad2ffb1c4d +++ botan/eme.h b5432503dea9e40ffaf97de602b34ad522c72ecf @@ -1,6 +1,6 @@ /************************************************* * EME Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_EME_H__ ============================================================ --- botan/eme1.cpp e90e2aba0e7cc71829a641ee4f9077a5bede20b6 +++ botan/eme1.cpp 118aad6ac2eb56ece214d5e209e761a436ef4e3a @@ -1,6 +1,6 @@ /************************************************* * EME1 Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/eme_pkcs.cpp b6d2dcbe4674c075e759ada4d4f8a3ff8759977e +++ botan/eme_pkcs.cpp 15f831f147cee50a11addf7883e53a12a6defb1e @@ -1,6 +1,6 @@ /************************************************* * PKCS1 EME Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/emsa.h b2b17af13aba1286f993907e80aae49e4c3fb071 +++ botan/emsa.h 89505a710ac004a0451362593dd7fe4706cee834 @@ -1,6 +1,6 @@ /************************************************* * EMSA Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_EMSA_H__ ============================================================ --- botan/emsa1.cpp e12d485d4f2484e6b53cd52288486cb56419b26c +++ botan/emsa1.cpp 92d9d12b72d3fee612f979a9efe36f9da3af4996 @@ -1,6 +1,6 @@ /************************************************* * EMSA1 Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/emsa2.cpp 39f86a2ed053f0ddb8a0e0fb032ea9007149d27b +++ botan/emsa2.cpp 3031d2c440ea6f65983216ab222d4ff8da32099d @@ -1,6 +1,6 @@ /************************************************* * EMSA2 Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/emsa3.cpp 0712cedbf4b4da5381aa6ec751798e527bac5239 +++ botan/emsa3.cpp 31c1d39fbda1461462f686095b027fbc5662e1e8 @@ -1,6 +1,6 @@ /************************************************* * EMSA3 Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/emsa4.cpp 37c2f6432f8c13d345aedd7e5155aa3f4fb75e39 +++ botan/emsa4.cpp 91e564eed0e820f8bc5e5dfd05c947f76eec4771 @@ -1,6 +1,6 @@ /************************************************* * EMSA4 Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/emsa_raw.cpp 3b8914e43991c3700e12a01185d057491c08db11 +++ botan/emsa_raw.cpp 374a4209d99f4f0735a6d076c631a15824da06b4 @@ -1,6 +1,6 @@ /************************************************* * EMSA-Raw Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/eng_base.cpp fe03cdf861b4ea4abfb312f8197100e6aa43c9c0 +++ botan/eng_base.cpp 0593563d982aaac2c01024c1dd6e29b1494843d7 @@ -1,6 +1,6 @@ /************************************************* * Basic No-Op Engine Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -25,17 +25,19 @@ class Algorithm_Cache_Impl : public Engi return search_map(mappings, name); } - void add(T* algo) const + void add(T* algo, const std::string& index_name = "") const { if(!algo) return; Mutex_Holder lock(mutex); - const std::string algo_name = algo->name(); - if(mappings.find(algo_name) != mappings.end()) - delete mappings[algo_name]; - mappings[algo_name] = algo; + const std::string name = + (index_name != "" ? index_name : algo->name()); + + if(mappings.find(name) != mappings.end()) + delete mappings[name]; + mappings[name] = algo; } Algorithm_Cache_Impl() @@ -45,8 +47,8 @@ class Algorithm_Cache_Impl : public Engi ~Algorithm_Cache_Impl() { - typename std::map::iterator i - = mappings.begin(); + typename std::map::iterator i = mappings.begin(); + while(i != mappings.end()) { delete i->second; @@ -59,7 +61,6 @@ class Algorithm_Cache_Impl : public Engi mutable std::map mappings; }; - } /************************************************* ============================================================ --- botan/eng_def.h 22f1fd366a3b8480b4101127aaca73ead0efda57 +++ botan/eng_def.h c8353e6127f95e3aed4fd3bd1b40e583b0354801 @@ -1,6 +1,6 @@ /************************************************* * Default Engine Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_DEFAULT_ENGINE_H__ ============================================================ --- botan/engine.cpp c3736b30d68bf5728e77645032802f8f2943965c +++ botan/engine.cpp bf3c1acdcb480eb07013cebc9f03417730b1e01f @@ -1,6 +1,6 @@ /************************************************* * Engine Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/engine.h b097b39a35e56fa7065db88304f00a54c79e88b3 +++ botan/engine.h 20654be095cb727e6e4c850306e286e47fe7699f @@ -1,6 +1,6 @@ /************************************************* * Engine Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_ENGINE_H__ @@ -28,7 +28,7 @@ class Engine { public: virtual T* get(const std::string&) const = 0; - virtual void add(T* algo) const = 0; + virtual void add(T* algo, const std::string& = "") const = 0; virtual ~Algorithm_Cache() {} }; @@ -75,14 +75,18 @@ class Engine find_bc_pad(const std::string&) const; template - T* lookup_algo(const Algorithm_Cache* cache, - const std::string& name, - const Engine* engine, - T* (Engine::*find)(const std::string& name) const) const + const T* lookup_algo(const Algorithm_Cache* cache, + const std::string& name, + const Engine* engine, + T* (Engine::*find)(const std::string&) const) const { T* algo = cache->get(name); if(!algo) - cache->add(algo = (engine->*find)(name)); + { + algo = (engine->*find)(name); + if(algo) + cache->add(algo, name); + } return algo; } ============================================================ --- botan/enums.h baf21a6f233200a4cfd0e09f584285a4fd3caef4 +++ botan/enums.h 06237002097d2faaca50f83ab28eb7ec1e8b5f9d @@ -1,6 +1,6 @@ /************************************************* * Enumerations Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_ENUMS_H__ ============================================================ --- botan/es_capi.cpp 595e41ac825e2bc3c8dac4b90019a1ace1a4feb1 +++ botan/es_capi.cpp 5d11daadd552362da19cf914c425ddfc3a202926 @@ -1,6 +1,6 @@ /************************************************* * Win32 CryptoAPI EntropySource Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/es_capi.h 72dab1a57f7e67a2eb34eeb6a43a35441a2a9b47 +++ botan/es_capi.h 598fba0ac3ebcbb92a0f9ba8e615ffe5438a49b0 @@ -1,6 +1,6 @@ /************************************************* * Win32 CAPI EntropySource Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_EXT_ENTROPY_SRC_WIN32_CAPI_H__ ============================================================ --- botan/es_egd.cpp 49eb23590990e5a8ac0148030ceb3f5d7881ffd3 +++ botan/es_egd.cpp 39d2684aac4c7a382253daf8e50b1c00d797d437 @@ -1,6 +1,6 @@ /************************************************* * EGD EntropySource Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -61,7 +61,7 @@ u32bit EGD_EntropySource::do_poll(byte o byte buffer[2]; buffer[0] = 1; - buffer[1] = (byte)length; + buffer[1] = static_cast(length); if(write(fd, buffer, 2) != 2) { close(fd); return 0; } if(read(fd, buffer, 1) != 1) { close(fd); return 0; } ============================================================ --- botan/es_egd.h b81212d62810f7b8758c76192e746ff403d4a9a1 +++ botan/es_egd.h 7044370670060e2891b276f2b4dce744bb305487 @@ -1,6 +1,6 @@ /************************************************* * EGD EntropySource Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_EXT_ENTROPY_SRC_EGD_H__ ============================================================ --- botan/es_file.cpp 271ccf707ae4b8a6606156e90fd21408cf76314f +++ botan/es_file.cpp 320002d9d19950b48e1fe88739b9a828c79419a4 @@ -1,6 +1,6 @@ /************************************************* * File EntropySource Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -22,7 +22,7 @@ u32bit File_EntropySource::slow_poll(byt { std::ifstream random_source(sources[j].c_str(), std::ios::binary); if(!random_source) continue; - random_source.read((char*)output + read, length); + random_source.read(reinterpret_cast(output) + read, length); read += random_source.gcount(); length -= random_source.gcount(); if(length == 0) ============================================================ --- botan/es_file.h 9e27f972a14360684633f1c8c7dc967e385535a1 +++ botan/es_file.h 0edcf498e809a142bd5b61778f5593ae35af80ec @@ -1,6 +1,6 @@ /************************************************* * File EntropySource Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_ENTROPY_SRC_FILE_H__ ============================================================ --- botan/es_win32.cpp 701187eda7ca149bb8c42e72f3bb523954b2d54e +++ botan/es_win32.cpp e8926bb59147dcd331a5c940cac2123326d665e0 @@ -1,6 +1,6 @@ /************************************************* * Win32 EntropySource Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -100,6 +100,10 @@ void Win32_EntropySource::do_fast_poll() add_bytes(&point, sizeof(point)); GetCaretPos(&point); add_bytes(&point, sizeof(point)); + + LARGE_INTEGER perf_counter; + QueryPerformanceCounter(&perf_counter); + add_bytes(&perf_counter, sizeof(perf_counter)); } } ============================================================ --- botan/es_win32.h 0251e175291cd4029ae60cbcf588a04dfe62c76c +++ botan/es_win32.h 67e26dddc6ddb44f68df174253d770d7f12eb0a4 @@ -1,6 +1,6 @@ /************************************************* * Win32 EntropySource Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_EXT_ENTROPY_SRC_WIN32_H__ ============================================================ --- botan/exceptn.cpp d83be5a04572fbed2adad3785431999aad9b7017 +++ botan/exceptn.cpp 4929c5816f645688d7bfde7e1185989cf8ac89b2 @@ -1,6 +1,6 @@ /************************************************* * Exceptions Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/exceptn.h 2f717eeccaa793dd63844070e3c5a072fa55bae6 +++ botan/exceptn.h 120505f40281475a5872fa41329b1e82f5adf194 @@ -1,6 +1,6 @@ /************************************************* * Exceptions Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_EXCEPTION_H__ ============================================================ --- botan/filter.cpp eb64d7cb6d31e58b2bde650ed5f244626e1d69e3 +++ botan/filter.cpp bc1fe725d4b6869d279e64f7649988a8b6d8f51f @@ -1,6 +1,6 @@ /************************************************* * Filter Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/filter.h 7c221b8584b5aabd2be0bfba18d66847f77384da +++ botan/filter.h 2050b7b09aa807090598434d8ac5ebb83fbf2503 @@ -1,6 +1,6 @@ /************************************************* * Filter Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_FILTER_H__ ============================================================ --- botan/filters.cpp a2fcaa59190c4eb9dc91b0ccbd7c8c9b2f8388f0 +++ botan/filters.cpp 698d1b8987f6963d2ba5c03bc95bf79047a94fa2 @@ -1,6 +1,6 @@ /************************************************* * Filters Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/filters.h 500b32199811557e4fe7732277ecc25a6c6e7e0d +++ botan/filters.h bb51ce701097541948779da3f3bbe96651dcf24c @@ -1,6 +1,6 @@ /************************************************* * Filters Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_FILTERS_H__ ============================================================ --- botan/fips140.cpp 3f269a7d5956932377b3573809471b0ba79312b0 +++ botan/fips140.cpp df549a1ac6d511cb6f5a9d9a801bfed4529569cb @@ -1,6 +1,6 @@ /************************************************* * FIPS-140 Self Tests Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -129,10 +129,28 @@ bool passes_self_tests() "68696A6B696A6B6C6A6B6C6D6B6C6D6E6C6D6E6F6D6E6F706E6F7071", "84983E441C3BD26EBAAE4AA1F95129E5E54670F1"); + hash_kat("SHA-256", "", + "E3B0C44298FC1C149AFBF4C8996FB924" + "27AE41E4649B934CA495991B7852B855"); + hash_kat("SHA-256", "616263", + "BA7816BF8F01CFEA414140DE5DAE2223" + "B00361A396177A9CB410FF61F20015AD"); + hash_kat("SHA-256", + "6162636462636465636465666465666765666768666768696768696A" + "68696A6B696A6B6C6A6B6C6D6B6C6D6E6C6D6E6F6D6E6F706E6F7071", + "248D6A61D20638B8E5C026930C3E6039" + "A33CE45964FF2167F6ECEDD419DB06C1"); + mac_kat("HMAC(SHA-1)", "4869205468657265", "B617318655057264E28BC0B6FB378C8EF146BE00", "0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B"); + mac_kat("HMAC(SHA-256)", "4869205468657265", + "198A607EB44BFBC69903A0F1CF2BBDC5" + "BA0AA3F3D9AE3C1C7A3B1696A0B68CF7", + "0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B" + "0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B"); + mac_kat("X9.19-MAC", "31311C3931383237333634351C1C35383134333237361C1C3B3132333435" "36373839303132333435363D3939313231303030303F1C30303031323530" ============================================================ --- botan/fips140.h 6feb2b5fa21466f8e84348e92df8985a7fffe3b5 +++ botan/fips140.h d931ddb8b60ca1d9f40c2bcc9f6f136aedaf3ead @@ -1,6 +1,6 @@ /************************************************* * FIPS 140 Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_FIPS140_H__ ============================================================ --- botan/get_algo.cpp 49f99fde31bfc94c20b03b4800a86a75089dabdd +++ botan/get_algo.cpp 656661d877017c4dbf1a80eb5e23a558fe463ff5 @@ -1,6 +1,6 @@ /************************************************* * Algorithm Retrieval Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/get_enc.cpp 8840ce2708a4b2989efef886d8a2c9f63c21993b +++ botan/get_enc.cpp 18eeecb14af5921471c02ec78ac491badc74108b @@ -1,6 +1,6 @@ /************************************************* * EMSA/EME/KDF/MGF Retrieval Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/get_pbe.cpp 4d13f684cca1485575401f3bf3c0563dac19a318 +++ botan/get_pbe.cpp 6bb990b1f38d8ef62c0a6055dcfb8f8eb2142386 @@ -1,6 +1,6 @@ /************************************************* * PBE Retrieval Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/gzip.cpp 6e190f22df99d08404da49a1a52ef2d1f71a15da +++ botan/gzip.cpp c563ec78bac13eead84737e3047cb4f7027a77f0 @@ -102,7 +102,7 @@ Gzip_Compression::Gzip_Compression(u32bi if(deflateInit2(&(zlib->stream), level, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY) != Z_OK) { delete zlib; zlib = 0; - throw Memory_Exhaustion(); + throw Exception("Gzip_Compression: Memory allocation error"); } } @@ -144,7 +144,7 @@ void Gzip_Compression::write(const byte zlib->stream.avail_out = buffer.size(); int rc = deflate(&(zlib->stream), Z_NO_FLUSH); if (rc != Z_OK && rc != Z_STREAM_END) - throw Internal_Error("Gzip_Compression: deflate failed."); + throw Exception("Internal error in Gzip_Compression deflate."); send(buffer.begin(), buffer.size() - zlib->stream.avail_out); } } @@ -164,7 +164,7 @@ void Gzip_Compression::end_msg() zlib->stream.avail_out = buffer.size(); rc = deflate(&(zlib->stream), Z_FINISH); if (rc != Z_OK && rc != Z_STREAM_END) - throw Internal_Error("Gzip_Compression: finishing deflate failed."); + throw Exception("Internal error in Gzip_Compression finishing deflate."); send(buffer.begin(), buffer.size() - zlib->stream.avail_out); } @@ -220,7 +220,7 @@ Gzip_Decompression::Gzip_Decompression() no_writes(true), pipe(new Hash_Filter("CRC32")), footer(0) { if (DEFAULT_BUFFERSIZE < sizeof(GZIP::GZIP_HEADER)) - throw Invalid_Argument("DEFAULT_BUFFERSIZE is too small"); + throw Exception("DEFAULT_BUFFERSIZE is too small"); zlib = new Zlib_Stream; @@ -229,7 +229,7 @@ Gzip_Decompression::Gzip_Decompression() if(inflateInit2(&(zlib->stream), -15) != Z_OK) { delete zlib; zlib = 0; - throw Memory_Exhaustion(); + throw Exception("Gzip_Decompression: Memory allocation error"); } } @@ -248,7 +248,7 @@ void Gzip_Decompression::start_msg() void Gzip_Decompression::start_msg() { if (!no_writes) - throw Invalid_State("Gzip_Decompression: start_msg after already writing"); + throw Exception("Gzip_Decompression: start_msg after already writing"); pipe.start_msg(); datacount = 0; @@ -309,8 +309,8 @@ void Gzip_Decompression::write(const byt if(rc == Z_NEED_DICT) throw Decoding_Error("Gzip_Decompression: Need preset dictionary"); if(rc == Z_MEM_ERROR) - throw Memory_Exhaustion(); - throw Internal_Error("Gzip_Decompression: Unknown decompress error"); + throw Exception("Gzip_Decompression: Memory allocation error"); + throw Exception("Gzip_Decompression: Unknown decompress error"); } send(buffer.begin(), buffer.size() - zlib->stream.avail_out); pipe.write(buffer.begin(), buffer.size() - zlib->stream.avail_out); @@ -356,7 +356,7 @@ void Gzip_Decompression::check_footer() void Gzip_Decompression::check_footer() { if (footer.size() != GZIP::FOOTER_LENGTH) - throw Decoding_Error("Gzip_Decompression: footer wrong length"); + throw Exception("Gzip_Decompression: Error finalizing decompression"); pipe.end_msg(); @@ -371,13 +371,13 @@ void Gzip_Decompression::check_footer() tmpbuf.set(footer.begin(), 4); if (buf != tmpbuf) - throw Decoding_Error("Gzip_Decompression: Data integrity error - CRC32 error"); + throw Exception("Gzip_Decompression: Data integrity error - CRC32 error"); // Check the length matches - it is encoded LSB-first for (int i = 0; i < 4; i++) { if (footer.begin()[GZIP::FOOTER_LENGTH-1-i] != get_byte(i, datacount)) - throw Decoding_Error("Gzip_Decompression: Data integrity error - incorrect length"); + throw Exception("Gzip_Decompression: Data integrity error - incorrect length"); } } @@ -392,7 +392,7 @@ void Gzip_Decompression::end_msg() // read, clear() will reset no_writes if(no_writes) return; - throw Decoding_Error("Gzip_Decompression: didn't find footer"); + throw Exception("Gzip_Decompression: didn't find footer"); } ============================================================ --- botan/hash_id.cpp ff0dd27712838713d976bd0f5e13875c9f73ea1c +++ botan/hash_id.cpp ff3e7496e25d811a0f001aa900aef51e1b96e9a1 @@ -1,6 +1,6 @@ /************************************************* * Hash Function Identification Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/hash_id.h e807331d09c89bd23cdbeceda4ede53f1f2f18f1 +++ botan/hash_id.h e77aea6c5e7bc736e2791bb73bc44b39fbf6c2a1 @@ -1,6 +1,6 @@ /************************************************* * Hash Function Identification Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_HASHID_H__ ============================================================ --- botan/hex.cpp 5eaedbdfe4c122cc65556776ecc44d9af3008f43 +++ botan/hex.cpp e49d63031296f49e80205e2e18bf56cc9097ac41 @@ -1,6 +1,6 @@ /************************************************* * Hex Encoder/Decoder Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -145,7 +145,7 @@ byte Hex_Decoder::decode(const byte hex[ *************************************************/ byte Hex_Decoder::decode(const byte hex[2]) { - return (byte)((HEX_TO_BIN[hex[0]] << 4) | HEX_TO_BIN[hex[1]]); + return ((HEX_TO_BIN[hex[0]] << 4) | HEX_TO_BIN[hex[1]]); } /************************************************* ============================================================ --- botan/hex.h cd20faea5de483ad9e90bb8921e492bcbb7b743e +++ botan/hex.h faf49f51673a4603cc342492b6e0d74dc1d748b2 @@ -1,6 +1,6 @@ /************************************************* * Hex Encoder/Decoder Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_HEX_H__ ============================================================ --- botan/hmac.cpp 544b1c880365d3ca6c2e435a928af8647356d5ff +++ botan/hmac.cpp c98153b4f8b5c4a3b2fafc05bb69a0c2aa43067f @@ -1,6 +1,6 @@ /************************************************* * HMAC Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -38,12 +38,18 @@ void HMAC::key(const byte key[], u32bit std::fill(i_key.begin(), i_key.end(), 0x36); std::fill(o_key.begin(), o_key.end(), 0x5C); - SecureVector hmac_key(key, length); - if(hmac_key.size() > hash->HASH_BLOCK_SIZE) - hmac_key = hash->process(hmac_key); + if(length > hash->HASH_BLOCK_SIZE) + { + SecureVector hmac_key = hash->process(key, length); + xor_buf(i_key, hmac_key, hmac_key.size()); + xor_buf(o_key, hmac_key, hmac_key.size()); + } + else + { + xor_buf(i_key, key, length); + xor_buf(o_key, key, length); + } - xor_buf(i_key, hmac_key, hmac_key.size()); - xor_buf(o_key, hmac_key, hmac_key.size()); hash->update(i_key); } ============================================================ --- botan/hmac.h 953953c1a07de51d1333f2370b515799642a26b4 +++ botan/hmac.h eb82b13624a2365487c9651fd45f9619abdc5f5c @@ -1,6 +1,6 @@ /************************************************* * HMAC Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_HMAC_H__ ============================================================ --- botan/if_algo.cpp b6e11a42e06aa4e3c52533da88ea6fd61ebc7000 +++ botan/if_algo.cpp d887e1ee1beae026a0cb02c893c882f3d464d4e9 @@ -1,6 +1,6 @@ /************************************************* * IF Scheme Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -90,7 +90,7 @@ PKCS8_Encoder* IF_Scheme_PrivateKey::pkc { return DER_Encoder() .start_cons(SEQUENCE) - .encode((u32bit)0) + .encode(static_cast(0)) .encode(key->n) .encode(key->e) .encode(key->d) ============================================================ --- botan/if_algo.h 2e2a6049b0efb9ef4a96e30e1dffda817a3c4b58 +++ botan/if_algo.h f801b3d836a41b2db02f82a6f7f3c1ca711d5128 @@ -1,6 +1,6 @@ /************************************************* * IF Scheme Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_IF_ALGO_H__ ============================================================ --- botan/inifile.cpp 2ed7ef36997e20217f2ddef2cda128a337f4b81d +++ botan/inifile.cpp 23157f0a070fb41bf6b47df5e9289bbc933ccf79 @@ -1,6 +1,6 @@ /************************************************* * Configuration Reader Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/init.h 289bb501a9cb777aeedf0241b07a43d887fc894c +++ botan/init.h 4e6621c7bdf9dd3e309d28456d06cafaebf16029 @@ -1,6 +1,6 @@ /************************************************* * Library Initialization Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_INIT_H__ ============================================================ --- botan/init_def.cpp afd1c1e0132c65e36d289940fe251b2875ec3a25 +++ botan/init_def.cpp 032c0a1f7bd132c86506da3f4756a1f39a49e6aa @@ -1,73 +1,27 @@ /************************************************* * Default Initialization Function Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include #include #include -#include -#include #include -#include -#include namespace Botan { /************************************************* * Library Initialization * *************************************************/ -void LibraryInitializer::initialize(const std::string& arg_string) - { - InitializerOptions args(arg_string); - initialize(args); - } - -/************************************************* -* Library Initialization * -*************************************************/ -void LibraryInitializer::initialize(const InitializerOptions& args) - { - Builtin_Modules modules(args); - initialize(args, modules); - } - -/************************************************* -* Library Initialization * -*************************************************/ void LibraryInitializer::initialize(const InitializerOptions& args, Modules& modules) { try { - set_global_state( - new Library_State( - args.thread_safe() ? - modules.mutex_factory() : - new Default_Mutex_Factory - ) - ); + set_global_state(new Library_State); - global_state().config().load_defaults(); - if(args.config_file() != "") - global_config().load_inifile(args.config_file()); + global_state().initialize(args, modules); - global_state().load(modules); - global_state().set_prng(new ANSI_X931_RNG); - - if(args.seed_rng()) - { - for(u32bit j = 0; j != 4; ++j) - { - global_state().seed_prng(true, 384); - if(global_state().rng_is_seeded()) - break; - } - - if(!global_state().rng_is_seeded()) - throw PRNG_Unseeded("Unable to collect sufficient entropy"); - } - if(args.fips_mode() || args.self_test()) { if(!FIPS140::passes_self_tests()) @@ -89,4 +43,25 @@ void LibraryInitializer::deinitialize() set_global_state(0); } +/************************************************* +* Library Initialization * +*************************************************/ +void LibraryInitializer::initialize(const std::string& arg_string) + { + InitializerOptions args(arg_string); + Builtin_Modules modules(args); + + initialize(args, modules); + } + +/************************************************* +* Library Initialization * +*************************************************/ +void LibraryInitializer::initialize(const InitializerOptions& args) + { + Builtin_Modules modules(args); + + initialize(args, modules); + } + } ============================================================ --- botan/init_opt.cpp 5f13d0b463dcb5124c6e1d41bb050653b6418294 +++ botan/init_opt.cpp b66c0ecf18aa8f66a11ffbef319395e5323c69ea @@ -1,6 +1,6 @@ /************************************************* * Initialization Options Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/jacobi.cpp 9700093d78ff1954708931ca8440c4642de16fb9 +++ botan/jacobi.cpp 699fd1d1712c1e22fbb3cc94cb919b709b49b7de @@ -1,6 +1,6 @@ /************************************************* * Jacobi Function Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/kdf.cpp 961788f9806afb6dfd141703c9c9eb7f99ecf64c +++ botan/kdf.cpp 5a8a42038d9d402727e6ca1b11d0244954137a32 @@ -1,6 +1,6 @@ /************************************************* * KDF1/KDF2 Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -19,7 +19,8 @@ SecureVector KDF::derive_key(u32bi const std::string& salt) const { return derive_key(key_len, secret, secret.size(), - (const byte*)salt.c_str(), salt.length()); + reinterpret_cast(salt.data()), + salt.length()); } /************************************************* @@ -52,7 +53,8 @@ SecureVector KDF::derive_key(u32bi const std::string& salt) const { return derive_key(key_len, secret, secret_len, - (const byte*)salt.c_str(), salt.length()); + reinterpret_cast(salt.data()), + salt.length()); } /************************************************* @@ -99,7 +101,7 @@ SecureVector KDF2::derive(u32bit o u32bit counter = 1; std::auto_ptr hash(get_hash(hash_name)); - while(out_len) + while(out_len && counter) { hash->update(secret, secret_len); for(u32bit j = 0; j != 4; ++j) ============================================================ --- botan/kdf.h 1124198e5c3117544d112eede2a0d4bfa772341c +++ botan/kdf.h e9a850e59f10c3b94a8a17520f2b3479451eae05 @@ -1,6 +1,6 @@ /************************************************* * KDF Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_KDF_H__ ============================================================ --- botan/keypair.cpp 2c64955c5e28515d0029e50937107dd9a91e3b48 +++ botan/keypair.cpp 3b736d5aae521292b8e479ebe3b9b703d4265a99 @@ -1,6 +1,6 @@ /************************************************* * Keypair Checks Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/keypair.h a0310efb60669a0abd04b9065c8b7e50e4e10e7c +++ botan/keypair.h 5e9ee863a0ee9dbe63cbcb39d5440a09c4f5c828 @@ -1,6 +1,6 @@ /************************************************* * Keypair Checks Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_KEYPAIR_H__ ============================================================ --- botan/libstate.cpp 7e672a48a31df8a8036588f5e4308b6dbc56d989 +++ botan/libstate.cpp 233c9231a05eae79ae231f8136850b43c34914d3 @@ -1,6 +1,6 @@ /************************************************* * Library Internal/Global State Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -12,8 +12,8 @@ #include #include #include +#include #include -#include namespace Botan { @@ -32,10 +32,7 @@ Library_State& global_state() Library_State& global_state() { if(!global_lib_state) - { - abort(); - throw Invalid_State("Library was not initialized correctly"); - } + LibraryInitializer::initialize(); return (*global_lib_state); } @@ -140,11 +137,8 @@ void Library_State::set_timer(Timer* new *************************************************/ void Library_State::set_timer(Timer* new_timer) { - if(new_timer) - { - delete timer; - timer = new_timer; - } + delete timer; + timer = new_timer; } /************************************************* @@ -316,21 +310,45 @@ Config& Library_State::config() const Config& Library_State::config() const { if(!config_obj) - throw Invalid_State("Library_State::config(): No config set"); + { + config_obj = new Config(); + config_obj->load_defaults(); + } return (*config_obj); } /************************************************* -* Load modules * +* Load a set of modules * *************************************************/ -void Library_State::load(Modules& modules) +void Library_State::initialize(const InitializerOptions& args, + Modules& modules) { - set_timer(modules.timer()); - set_transcoder(modules.transcoder()); + if(mutex_factory) + throw Invalid_State("Library_State has already been initialized"); + if(args.thread_safe()) + mutex_factory = modules.mutex_factory(); + else + mutex_factory = new Default_Mutex_Factory; + + cached_default_allocator = 0; + x509_state_obj = 0; + ui = 0; + + timer = modules.timer(); + transcoder = modules.transcoder(); + + if(args.config_file() != "") + config().load_inifile(args.config_file()); + + locks["settings"] = get_mutex(); + locks["allocator"] = get_mutex(); + locks["rng"] = get_mutex(); + locks["engine"] = get_mutex(); + std::vector mod_allocs = modules.allocators(); - for(u32bit j = 0; j != mod_allocs.size(); j++) + for(u32bit j = 0; j != mod_allocs.size(); ++j) add_allocator(mod_allocs[j]); set_default_allocator(modules.default_allocator()); @@ -345,28 +363,38 @@ void Library_State::load(Modules& module std::vector sources = modules.entropy_sources(); for(u32bit j = 0; j != sources.size(); ++j) add_entropy_source(sources[j]); + + set_prng(new ANSI_X931_RNG); + + if(args.seed_rng()) + { + for(u32bit j = 0; j != 4; ++j) + { + seed_prng(true, 384); + if(rng_is_seeded()) + break; + } + + if(!rng_is_seeded()) + throw PRNG_Unseeded("Unable to collect sufficient entropy"); + } } /************************************************* * Library_State Constructor * *************************************************/ -Library_State::Library_State(Mutex_Factory* mutex_factory) +Library_State::Library_State() { - if(!mutex_factory) - throw Exception("Library_State: no mutex found"); + mutex_factory = 0; - this->mutex_factory = mutex_factory; - this->timer = new Timer(); - this->transcoder = 0; - this->config_obj = new Config(); + timer = 0; + config_obj = 0; + x509_state_obj = 0; - locks["settings"] = get_mutex(); - locks["allocator"] = get_mutex(); - locks["rng"] = get_mutex(); - locks["engine"] = get_mutex(); + ui = 0; + transcoder = 0; rng = 0; cached_default_allocator = 0; - x509_state_obj = 0; ui = 0; } @@ -388,7 +416,7 @@ Library_State::~Library_State() cached_default_allocator = 0; - for(u32bit j = 0; j != allocators.size(); j++) + for(u32bit j = 0; j != allocators.size(); ++j) { allocators[j]->destroy(); delete allocators[j]; ============================================================ --- botan/libstate.h 4070e82c699e67065b4337afd0475b0e9c9e6120 +++ botan/libstate.h 4dddb269a906154b79debb9588397ac08334ccf6 @@ -1,6 +1,6 @@ /************************************************* * Library Internal/Global State Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_LIB_STATE_H__ @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -21,6 +22,15 @@ class Library_State class Library_State { public: + Library_State(); + ~Library_State(); + + void initialize(const InitializerOptions&, Modules&); + + void load(Modules&); + + void add_engine(class Engine*); + class Engine_Iterator { public: @@ -52,15 +62,11 @@ class Library_State void add_entropy(EntropySource&, bool); u32bit seed_prng(bool, u32bit); - void load(class Modules&); - void set_timer(class Timer*); u64bit system_clock() const; class Config& config() const; - void add_engine(class Engine*); - class Mutex* get_mutex() const; class Mutex* get_named_mutex(const std::string&); @@ -73,9 +79,6 @@ class Library_State void set_transcoder(class Charset_Transcoder*); std::string transcode(const std::string, Character_Set, Character_Set) const; - - Library_State(class Mutex_Factory*); - ~Library_State(); private: Library_State(const Library_State&) {} Library_State& operator=(const Library_State&) { return (*this); } @@ -84,7 +87,7 @@ class Library_State class Mutex_Factory* mutex_factory; class Timer* timer; - class Config* config_obj; + mutable class Config* config_obj; class X509_GlobalState* x509_state_obj; std::map locks; ============================================================ --- botan/license.txt 0cac4d68711b77376ac6b70d8ca304da89cc613c +++ botan/license.txt 902feeccfae30f0eb980e0f50b222cdd2c2df694 @@ -1,4 +1,4 @@ -Copyright (C) 1999-2006 The Botan Project. All rights reserved. +Copyright (C) 1999-2007 The Botan Project. All rights reserved. Redistribution and use in source and binary forms, for any use, with or without modification, is permitted provided that the following conditions are met: ============================================================ --- botan/look_add.h af2beed9ced313aefd1e307de2bde6d6100fd916 +++ botan/look_add.h 2a3f23c905f2b6e3f0b18f50ca7b22a5684bf352 @@ -1,6 +1,6 @@ /************************************************* * Lookup Table Management Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_LOOKUP_MANGEMENT_H__ ============================================================ --- botan/look_pk.cpp 13453c6cbd7be65bf71e38b40f14a8e8c3851c85 +++ botan/look_pk.cpp 80288c7dbe76f809b37a6e2189b32d45a2eab344 @@ -1,6 +1,6 @@ /************************************************* * PK Algorithm Lookup Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/look_pk.h a579cb37238f0eddb5e33277379c676e724f235a +++ botan/look_pk.h 1f2ab76b42fca7ccef876265b1f0a8df5610f944 @@ -1,6 +1,6 @@ /************************************************* * PK Algorithm Lookup Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_PK_LOOKUP_H__ ============================================================ --- botan/lookup.h 7265880bb34e5c13431307e2e57a57813540a5fa +++ botan/lookup.h dd3c4a91f50bebfd4c710a828b007b8303b5536b @@ -1,6 +1,6 @@ /************************************************* * Algorithm Lookup Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_LOOKUP_H__ ============================================================ --- botan/make_prm.cpp 4ef12c2a523d27ad2c7602374ed7aac7d0de36ef +++ botan/make_prm.cpp d665482d002305b15dd878616f4c78fdb76cf76a @@ -1,111 +1,16 @@ /************************************************* * Prime Generation Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include -#include -#include -#include #include -#include +#include #include -#include namespace Botan { -namespace { - /************************************************* -* Increment the seed by one * -*************************************************/ -void increment(SecureVector& seed) - { - for(u32bit j = seed.size(); j > 0; --j) - if(++seed[j-1]) - break; - } - -} - -/************************************************* -* Attempt DSA prime generation with given seed * -*************************************************/ -bool generate_dsa_primes(BigInt& p, BigInt& q, const byte const_seed[], - u32bit seed_len, u32bit pbits, u32bit counter_start) - { - if(seed_len < 20) - throw Invalid_Argument("DSA prime generation needs a seed " - "at least 160 bits long"); - if((pbits % 64 != 0) || (pbits > 1024) || (pbits < 512)) - throw Invalid_Argument("DSA prime generation algorithm does not support " - "prime size " + to_string(pbits)); - - std::auto_ptr sha1(get_hash("SHA-1")); - - SecureVector seed(const_seed, seed_len); - - SecureVector qhash = sha1->process(seed); - increment(seed); - SecureVector qhash2 = sha1->process(seed); - xor_buf(qhash, qhash2, qhash.size()); - - qhash[0] |= 0x80; - qhash[19] |= 0x01; - q.binary_decode(qhash, qhash.size()); - if(!is_prime(q)) - return false; - global_state().pulse(PRIME_FOUND); - - u32bit n = (pbits-1) / 160, b = (pbits-1) % 160; - SecureVector W(20 * (n+1)); - BigInt X; - - for(u32bit j = 0; j != counter_start; ++j) - for(u32bit k = 0; k != n + 1; ++k) - increment(seed); - - for(u32bit j = 0; j != 4096 - counter_start; ++j) - { - global_state().pulse(PRIME_SEARCHING); - - for(u32bit k = 0; k != n + 1; ++k) - { - increment(seed); - sha1->update(seed); - sha1->final(W + 20 * (n-k)); - } - X.binary_decode(W + (20 - 1 - b/8), W.size() - (20 - 1 - b/8)); - X.set_bit(pbits-1); - - p = X - (X % (2*q) - 1); - - if(p.bits() == pbits && is_prime(p)) - { - global_state().pulse(PRIME_FOUND); - return true; - } - } - return false; - } - -/************************************************* -* Generate DSA Primes * -*************************************************/ -SecureVector generate_dsa_primes(BigInt& p, BigInt& q, u32bit pbits) - { - SecureVector seed(20); - - while(true) - { - Global_RNG::randomize(seed, seed.size()); - global_state().pulse(PRIME_SEARCHING); - if(generate_dsa_primes(p, q, seed, seed.size(), pbits)) - return seed; - } - } - -/************************************************* * Generate a random prime * *************************************************/ BigInt random_prime(u32bit bits, const BigInt& coprime, ============================================================ --- botan/mdx_hash.cpp 92f3d7d87656522ae3f02a8cd86b1c2a957547f4 +++ botan/mdx_hash.cpp 7e90baec5a8465c7405841bc2d1075fde1165797 @@ -1,6 +1,6 @@ /************************************************* * MDx Hash Function Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -90,11 +90,13 @@ void MDx_HashFunction::write_count(byte { if(COUNT_SIZE < 8) throw Invalid_State("MDx_HashFunction::write_count: COUNT_SIZE < 8"); - for(u32bit j = 0; j != 8; ++j) - { - const u32bit choose = (BIG_BYTE_ENDIAN ? (j % 8) : (7 - (j % 8))); - out[j+COUNT_SIZE-8] = get_byte(choose, 8 * count); - } + + const u64bit bit_count = count * 8; + + if(BIG_BYTE_ENDIAN) + store_be(bit_count, out + COUNT_SIZE - 8); + else + store_le(bit_count, out + COUNT_SIZE - 8); } } ============================================================ --- botan/mdx_hash.h 5bdd8beb52cdaf9e8ac1106a542604bb7c309c64 +++ botan/mdx_hash.h 80dc1cabd3c93588afe182cf940ccc7ede9204b0 @@ -1,6 +1,6 @@ /************************************************* * MDx Hash Function Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_MDX_BASE_H__ ============================================================ --- botan/mem_ops.h 34941d88cfa5ddaf14b9ff3826b0b621a0ab53e8 +++ botan/mem_ops.h 02ca7af8ad83315a2956f25dba090cad70a6ab0a @@ -1,6 +1,6 @@ /************************************************* * Memory Operations Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_MEMORY_OPS_H__ ============================================================ --- botan/mem_pool.cpp 8050abebfa25644c457fd81b4eddf791b86f5c25 +++ botan/mem_pool.cpp 399aa8cd9dac6bce28a803b11a262d5e6d1b3fcb @@ -1,6 +1,6 @@ /************************************************* * Pooling Allocator Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -34,46 +34,21 @@ u32bit choose_pref_size(u32bit provided) /************************************************* * Memory_Block Constructor * *************************************************/ -Pooling_Allocator::Memory_Block::Memory_Block(void* buf, u32bit map_size, - u32bit block_size) +Pooling_Allocator::Memory_Block::Memory_Block(void* buf) { buffer = static_cast(buf); bitmap = 0; - this->block_size = block_size; - - buffer_end = buffer + (block_size * BITMAP_SIZE); - - clear_mem(buffer, block_size * BITMAP_SIZE); - - if(map_size != BITMAP_SIZE) - throw Invalid_Argument("Memory_Block: Bad bitmap size"); + buffer_end = buffer + (BLOCK_SIZE * BITMAP_SIZE); } /************************************************* -* Compare a Memory_Block with a void pointer * -*************************************************/ -inline bool Pooling_Allocator::Memory_Block::operator<(const void* other) const - { - if(buffer <= other && other < buffer_end) - return false; - return (buffer < other); - } - -inline bool Pooling_Allocator::Memory_Block::operator>(const void* other) const - { - if(buffer <= other && other < buffer_end) - return false; - return (buffer > other); - } - -/************************************************* * See if ptr is contained by this block * *************************************************/ bool Pooling_Allocator::Memory_Block::contains(void* ptr, u32bit length) const throw() { return ((buffer <= ptr) && - (buffer_end >= (byte*)ptr + length * block_size)); + (buffer_end >= static_cast(ptr) + length * BLOCK_SIZE)); } /************************************************* @@ -95,7 +70,7 @@ byte* Pooling_Allocator::Memory_Block::a } } - bitmap_type mask = ((bitmap_type)1 << n) - 1; + bitmap_type mask = (static_cast(1) << n) - 1; u32bit offset = 0; while(bitmap & mask) @@ -113,7 +88,7 @@ byte* Pooling_Allocator::Memory_Block::a return 0; bitmap |= mask; - return buffer + offset * block_size; + return buffer + offset * BLOCK_SIZE; } /************************************************* @@ -121,16 +96,16 @@ void Pooling_Allocator::Memory_Block::fr *************************************************/ void Pooling_Allocator::Memory_Block::free(void* ptr, u32bit blocks) throw() { - clear_mem((byte*)ptr, blocks * block_size); + clear_mem(static_cast(ptr), blocks * BLOCK_SIZE); - const u32bit offset = ((byte*)ptr - buffer) / block_size; + const u32bit offset = (static_cast(ptr) - buffer) / BLOCK_SIZE; if(offset == 0 && blocks == BITMAP_SIZE) bitmap = ~bitmap; else { for(u32bit j = 0; j != blocks; ++j) - bitmap &= ~((bitmap_type)1 << (j+offset)); + bitmap &= ~(static_cast(1) << (j+offset)); } } @@ -138,7 +113,7 @@ Pooling_Allocator::Pooling_Allocator(u32 * Pooling_Allocator Constructor * *************************************************/ Pooling_Allocator::Pooling_Allocator(u32bit p_size, bool) : - PREF_SIZE(choose_pref_size(p_size)), BLOCK_SIZE(64) + PREF_SIZE(choose_pref_size(p_size)) { mutex = global_state().get_mutex(); last_used = blocks.begin(); @@ -174,6 +149,7 @@ void* Pooling_Allocator::allocate(u32bit void* Pooling_Allocator::allocate(u32bit n) { const u32bit BITMAP_SIZE = Memory_Block::bitmap_size(); + const u32bit BLOCK_SIZE = Memory_Block::block_size(); Mutex_Holder lock(mutex); @@ -207,6 +183,7 @@ void Pooling_Allocator::deallocate(void* void Pooling_Allocator::deallocate(void* ptr, u32bit n) { const u32bit BITMAP_SIZE = Memory_Block::bitmap_size(); + const u32bit BLOCK_SIZE = Memory_Block::block_size(); if(ptr == 0 && n == 0) return; @@ -220,12 +197,12 @@ void Pooling_Allocator::deallocate(void* const u32bit block_no = round_up(n, BLOCK_SIZE) / BLOCK_SIZE; std::vector::iterator i = - std::lower_bound(blocks.begin(), blocks.end(), ptr, diff_less()); + std::lower_bound(blocks.begin(), blocks.end(), Memory_Block(ptr)); - if(i != blocks.end() && i->contains((byte*)ptr, block_no)) - i->free(ptr, block_no); - else + if(i == blocks.end() || !i->contains(ptr, block_no)) throw Invalid_State("Pointer released to the wrong allocator"); + + i->free(ptr, block_no); } } @@ -263,6 +240,7 @@ void Pooling_Allocator::get_more_core(u3 void Pooling_Allocator::get_more_core(u32bit in_bytes) { const u32bit BITMAP_SIZE = Memory_Block::bitmap_size(); + const u32bit BLOCK_SIZE = Memory_Block::block_size(); const u32bit TOTAL_BLOCK_SIZE = BLOCK_SIZE * BITMAP_SIZE; @@ -278,14 +256,12 @@ void Pooling_Allocator::get_more_core(u3 for(u32bit j = 0; j != in_blocks; ++j) { byte* byte_ptr = static_cast(ptr); - - blocks.push_back( - Memory_Block(byte_ptr + j * TOTAL_BLOCK_SIZE, BITMAP_SIZE, BLOCK_SIZE) - ); + blocks.push_back(Memory_Block(byte_ptr + j * TOTAL_BLOCK_SIZE)); } std::sort(blocks.begin(), blocks.end()); - last_used = std::lower_bound(blocks.begin(), blocks.end(), ptr, diff_less()); + last_used = std::lower_bound(blocks.begin(), blocks.end(), + Memory_Block(ptr)); } } ============================================================ --- botan/mem_pool.h e770dc2fe471f3a44c1096480ddb5e9875d50c2f +++ botan/mem_pool.h 5c7868d373529114f14223b4cb7533ffa0b7133e @@ -1,6 +1,6 @@ /************************************************* * Pooling Allocator Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_POOLING_ALLOCATOR_H__ @@ -11,7 +11,6 @@ #include #include #include -#include namespace Botan { @@ -38,40 +37,32 @@ class Pooling_Allocator : public Allocat class Memory_Block { public: - Memory_Block(void*, u32bit, u32bit); + Memory_Block(void*); static u32bit bitmap_size() { return BITMAP_SIZE; } + static u32bit block_size() { return BLOCK_SIZE; } bool contains(void*, u32bit) const throw(); byte* alloc(u32bit) throw(); void free(void*, u32bit) throw(); - bool operator<(const void*) const; - bool operator>(const void*) const; bool operator<(const Memory_Block& other) const - { return (buffer < other.buffer); } - bool operator>(const Memory_Block& other) const - { return (buffer > other.buffer); } + { + if(buffer < other.buffer && other.buffer < buffer_end) + return false; + return (buffer < other.buffer); + } private: typedef u64bit bitmap_type; static const u32bit BITMAP_SIZE = 8 * sizeof(bitmap_type); + static const u32bit BLOCK_SIZE = 64; + bitmap_type bitmap; byte* buffer, *buffer_end; - u32bit block_size; }; -template -struct diff_less : public std::binary_function<_first,_second,bool> -{ - bool operator()(const _first& __x, const _second& __y) const { return __x < __y; } -#if defined(_MSC_VER) && defined(_DEBUG) - bool operator()(const _second& __y, const _first& __x) const { return __x > __y; } - bool operator()(const _first& __x, const _first& __y) const { return __x < __y; } -#endif -}; + const u32bit PREF_SIZE; - const u32bit PREF_SIZE, BLOCK_SIZE; - std::vector blocks; std::vector::iterator last_used; std::vector > allocated; ============================================================ --- botan/mgf1.cpp 4bfd485e042f369b4fe63795d322a58a040d5610 +++ botan/mgf1.cpp 833bdd2150cc0db702b39bc4d799426504dda7d5 @@ -1,6 +1,6 @@ /************************************************* * MGF1 Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/mgf1.h 289afacc20735881b14bd084a4d170fac8703c9f +++ botan/mgf1.h ae7d0ec9bd1bf70990fe92a514843619231c8e30 @@ -1,6 +1,6 @@ /************************************************* * MGF1 Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_MGF1_H__ ============================================================ --- botan/mlock.cpp 4755235e70fac894c364c327397ee9fef15658e3 +++ botan/mlock.cpp 61e353fb8fac94a0a655a08e19fd55f04b6d2a42 @@ -1,6 +1,6 @@ /************************************************* * Memory Locking Functions Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/mode_pad.cpp f43891fdce0ba6fc32bfdee10553bb44f7d34937 +++ botan/mode_pad.cpp 3a2ad1689618276a2d9d2f064d418e25221d825b @@ -1,6 +1,6 @@ /************************************************* * CBC Padding Methods Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/mode_pad.h 23a6a4875c91d1bd11fbaaa4b2f74469c8cd4ee7 +++ botan/mode_pad.h 87c55a3918487d134cab27968dd2cfcfe61eb09a @@ -1,6 +1,6 @@ /************************************************* * CBC Padding Methods Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_CBC_PADDING_H__ ============================================================ --- botan/modebase.cpp cfe177154a0a7dd9006f87f55f17956c3d5bd087 +++ botan/modebase.cpp 1c98d29fa318a766f53c87ded0f18c6b80fbcbb1 @@ -1,6 +1,6 @@ /************************************************* * Block Cipher Mode Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/modebase.h 11a987c1e68cb7b68203f307febd5c8ab7a54fdd +++ botan/modebase.h b2233bf5cfbe0d16ec986291f086c5e07838b861 @@ -1,6 +1,6 @@ /************************************************* * Block Cipher Mode Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_MODEBASE_H__ ============================================================ --- botan/modules.cpp 78779edaa4470f509cd48d85c91dc07067b6f293 +++ botan/modules.cpp 310f410a77f14f2b559a24a0a00821880205b6c8 @@ -1,6 +1,6 @@ /************************************************* * Module Factory Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/modules.h f19773d268d095c5b67ba346f1b37adb677a028c +++ botan/modules.h d5c0714b1d1a263bee2ecb352834c9d243a893ef @@ -1,6 +1,6 @@ /************************************************* * Module Factory Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_MODULE_FACTORIES_H__ ============================================================ --- botan/mp_asm.cpp 0ab0ca22514636b06029d452ae1fb5b43b9861cd +++ botan/mp_asm.cpp 84dd140ff3a56889afd6b026b0ee40e40120cd83 @@ -1,6 +1,6 @@ /************************************************* * Lowest Level MPI Algorithms Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/mp_asm.h 963985006998064e9ebd6ae3e1ca1290b76b39c3 +++ botan/mp_asm.h 43d835beafc05c9d0e39596ba54e73a53795e5b4 @@ -1,6 +1,6 @@ /************************************************* * Lowest Level MPI Algorithms Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_MP_ASM_H__ ============================================================ --- botan/mp_asmi.h e22b2a80d57276591576424485f84332d14c9ee8 +++ botan/mp_asmi.h fb52f8210fae3cab3f224a25d9728222b2ce27f4 @@ -1,6 +1,6 @@ /************************************************* * Lowest Level MPI Algorithms Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_MP_ASM_INTERNAL_H__ ============================================================ --- botan/mp_comba.cpp 10faaacf71f061fcd639997bbab799c1211d72d6 +++ botan/mp_comba.cpp b6e3cf9668bfeebad0695e1062409cc358ce39d6 @@ -1,6 +1,6 @@ /************************************************* * Comba Multiplication and Squaring Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/mp_core.h a8e7f19af41c713977d042659aea91b0391582b5 +++ botan/mp_core.h a31479cdef207a0cf98352de2a6813ddcdb909b2 @@ -1,6 +1,6 @@ /************************************************* * MPI Algorithms Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_MP_CORE_H__ ============================================================ --- botan/mp_misc.cpp c05569bf722238f1a24f9aa56a7f72fe75516568 +++ botan/mp_misc.cpp 1602f6ca6969f4c503be6f203b5442b2ae0c1c0a @@ -1,6 +1,6 @@ /************************************************* * MP Misc Functions Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/mp_mul.cpp 52039539105a440dff115eb3e6fad4ecea642764 +++ botan/mp_mul.cpp dafb1262e69f06c17fe781aea9c7ed04ef789829 @@ -1,6 +1,6 @@ /************************************************* * Karatsuba Multiplication Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/mp_mulop.cpp 55f6e57466d94aa77efedeedcfcea77f7108fd10 +++ botan/mp_mulop.cpp cfaafb643d3d5960509ca07f8370a044c291730d @@ -1,6 +1,6 @@ /************************************************* * Multiply/Add Algorithm Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/mp_numth.cpp bd2130c283610c5fed36b561dbcb486013cc35a0 +++ botan/mp_numth.cpp 1f30af2cd34fe5b7692e984bc9f32e8fecb8fc40 @@ -1,6 +1,6 @@ /************************************************* * Fused and Important MP Algorithms Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/mp_shift.cpp 3c6d022cd0d034e7d9ea571bded9912dee93ee30 +++ botan/mp_shift.cpp 91e212e741dcd78df0619afad5539f779f4684c3 @@ -1,6 +1,6 @@ /************************************************* * MP Shift Algorithms Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/mp_sqr.cpp 28c6459fe1b2b85816ca0179a62651f67dc540c8 +++ botan/mp_sqr.cpp de1f9715b8b1420092525f08c1f37428734fce19 @@ -1,6 +1,6 @@ /************************************************* * Karatsuba Squaring Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/mp_types.h e9a7d9daa17a17667fc62e90f97ce660092de0ad +++ botan/mp_types.h 064801a43de15a3fb4af0a26b9c4bd14fcd9b8f5 @@ -1,6 +1,6 @@ /************************************************* * Low Level MPI Types Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_MPI_TYPES_H__ @@ -22,8 +22,8 @@ namespace Botan { #error BOTAN_MP_WORD_BITS must be 8, 16, 32, or 64 #endif -const word MP_WORD_MASK = ~((word)0); -const word MP_WORD_TOP_BIT = (word)1 << (8*sizeof(word) - 1); +const word MP_WORD_MASK = ~static_cast(0); +const word MP_WORD_TOP_BIT = static_cast(1) << (8*sizeof(word) - 1); const word MP_WORD_MAX = MP_WORD_MASK; } ============================================================ --- botan/mutex.cpp 82fa70864c2db1867541d8b8d3c5c6c99cbdbfdb +++ botan/mutex.cpp 3e01e31f664f2e669206c92788212288a29ed1e9 @@ -1,6 +1,6 @@ /************************************************* * Mutex Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/mutex.h aa4a392f6066b453a0dfca4ae7747ae44656753d +++ botan/mutex.h 566d2d816963e3e255e0cd7ef9e58f4619cad8f8 @@ -1,6 +1,6 @@ /************************************************* * Mutex Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_MUTEX_H__ ============================================================ --- botan/numthry.cpp 126f52c53fff81483812e62e387a63db90aad512 +++ botan/numthry.cpp 121bca14d1edfa1a93e236929dcb94e740fea001 @@ -1,6 +1,6 @@ /************************************************* * Number Theory Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/numthry.h 28f9880e0625b4df81960c9596a80ebed49ff0ae +++ botan/numthry.h 4d094d0b3a98dbd84783beb080f861d076d1a0f5 @@ -1,6 +1,6 @@ /************************************************* * Number Theory Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_NUMBTHRY_H__ @@ -58,10 +58,6 @@ BigInt random_safe_prime(u32bit); BigInt random_prime(u32bit, const BigInt& = 1, u32bit = 1, u32bit = 2); BigInt random_safe_prime(u32bit); -SecureVector generate_dsa_primes(BigInt&, BigInt&, u32bit); -bool generate_dsa_primes(BigInt&, BigInt&, const byte[], u32bit, u32bit, - u32bit = 0); - /************************************************* * Prime Numbers * *************************************************/ ============================================================ --- botan/ofb.cpp a32bc675be00576ff4d42bdbdbb3ac747335c049 +++ botan/ofb.cpp 2d9408795607ec8643f7515ed40bdbb69cafc9e2 @@ -1,6 +1,6 @@ /************************************************* * OFB Mode Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/ofb.h 88c86eb33b448ac17ad5d533224ecfc902941d3a +++ botan/ofb.h 735fe0d3455bb134d31db83f7e9dfa3e2ac0cfda @@ -1,6 +1,6 @@ /************************************************* * OFB Mode Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_OFB_H__ ============================================================ --- botan/oids.cpp e559f1aaf8bb3be8bb25b5994dbfc2bc68b822f9 +++ botan/oids.cpp 469aad470e7ec8f275bee3ad392a675828b40aeb @@ -1,6 +1,6 @@ /************************************************* * OID Registry Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -40,9 +40,17 @@ OID lookup(const std::string& name) OID lookup(const std::string& name) { std::string value = global_config().get("str2oid", name); - if(value == "") + if(value != "") + return OID(value); + + try + { return OID(name); - return OID(value); + } + catch(Exception) + { + throw Lookup_Error("No object identifier found for " + name); + } } /************************************************* ============================================================ --- botan/oids.h 11b042ec74268dc1a20292ddf899c5aae2cc57d0 +++ botan/oids.h ca7fe98e914a8def168afa1d9e29ef594245f031 @@ -1,6 +1,6 @@ /************************************************* * OID Registry Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_OIDS_H__ ============================================================ --- botan/out_buf.cpp 84c593b7de4a4e21920b9a68146f9b061ae8384a +++ botan/out_buf.cpp c5071a9eb97054a9bb82f5f9ebe48ac01c380a3c @@ -1,6 +1,6 @@ /************************************************* * Pipe Output Buffer Source file * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/out_buf.h 41a263e3362e4387260349e069f3f60b80798ff1 +++ botan/out_buf.h cfe4dc7beb6cb4816788ad929eef3be9f22ff420 @@ -1,6 +1,6 @@ /************************************************* * Output Buffer Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_OUTPUT_BUFFER_H__ ============================================================ --- botan/parsing.cpp 035b0146556a03f222348ce5917aa54937038e87 +++ botan/parsing.cpp 4c423baf1e0e9ba8d65a5feda7eb79e6be6fe445 @@ -1,6 +1,6 @@ /************************************************* * Parser Functions Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/parsing.h f75201b87b93e3c759253685c584e989ce529711 +++ botan/parsing.h d706a1c3fe72a2466149994e8e3a256b243514f5 @@ -1,6 +1,6 @@ /************************************************* * Parser Functions Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_PARSER_H__ ============================================================ --- botan/pbe.h f70f01ec9efa2119a6a28519697bc0d5da8167f0 +++ botan/pbe.h 6f41f1c709485124f6dda4dc2ac05d9218577d47 @@ -1,6 +1,6 @@ /************************************************* * PBE Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_PBE_H__ ============================================================ --- botan/pbe_pkcs.h 13c9b42c84107045259fe22f8723b2a7ec81da85 +++ botan/pbe_pkcs.h dedf1488ad73ea2bd8bcfeb286f01e01f0dfb4c7 @@ -1,6 +1,6 @@ /************************************************* * PKCS PBE Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_PBE_PKCS_H__ ============================================================ --- botan/pbes1.cpp 020b763720c532c6cd655f7d09fb99ac9a8abd37 +++ botan/pbes1.cpp 3285313a3d998f049c48d73817a98b548d2c4990 @@ -1,6 +1,6 @@ /************************************************* * PKCS #5 PBES1 Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/pbes2.cpp a1016156b21557e1069e3cbfc261c95f082006e7 +++ botan/pbes2.cpp b30dfcb03d8bd7642027a2ae878c95087ac8a572 @@ -1,6 +1,6 @@ /************************************************* * PKCS #5 PBES2 Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/pem.cpp 5d29ce30c07f59bf5df8adba88c29ac117028862 +++ botan/pem.cpp 502e34643de00820f3dbd8da75c65dd6b62ad056 @@ -1,6 +1,6 @@ /************************************************* * PEM Encoding/Decoding Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -88,7 +88,7 @@ SecureVector decode(DataSource& so throw Decoding_Error("PEM: Malformed PEM header"); if(position == 0) - label += (char)b; + label += static_cast(b); } Pipe base64(new Base64_Decoder); ============================================================ --- botan/pem.h fb888d3bc2fed16ec4745cd5179bef5cc1f13b23 +++ botan/pem.h 8f1ebb1cad4f86b291912481e8fdb5277f9ef1e0 @@ -1,6 +1,6 @@ /************************************************* * PEM Encoding/Decoding Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_PEM_H__ ============================================================ --- botan/pipe.cpp 0d1ef60657b17d5473db8b0c3a1221576c54eca4 +++ botan/pipe.cpp 945e1ff54a457469193ea353a6a51ae7888a167e @@ -1,6 +1,6 @@ /************************************************* * Pipe Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -130,7 +130,7 @@ void Pipe::process_msg(const std::string *************************************************/ void Pipe::process_msg(const std::string& input) { - process_msg((const byte*)input.c_str(), input.length()); + process_msg(reinterpret_cast(input.data()), input.length()); } /************************************************* ============================================================ --- botan/pipe.h 95a49edcf42da90fb31d68eed9d1f6d85daacae6 +++ botan/pipe.h d7528617243b81a9c2a0eb4b91f63c7b07db15aa @@ -1,6 +1,6 @@ /************************************************* * Pipe Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_PIPE_H__ ============================================================ --- botan/pipe_io.cpp b834ab95d290b21877ea8a562403b8ca76c10a6f +++ botan/pipe_io.cpp 0ac139738c9b5f02e1efc95f746b170922297e7a @@ -1,6 +1,6 @@ /************************************************* * Pipe I/O Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -17,7 +17,7 @@ std::ostream& operator<<(std::ostream& s while(stream.good() && pipe.remaining()) { u32bit got = pipe.read(buffer, buffer.size()); - stream.write((const char*)buffer.begin(), got); + stream.write(reinterpret_cast(buffer.begin()), got); } if(!stream.good()) throw Stream_IO_Error("Pipe output operator (iostream) has failed"); @@ -32,7 +32,7 @@ std::istream& operator>>(std::istream& s SecureVector buffer(DEFAULT_BUFFERSIZE); while(stream.good()) { - stream.read((char*)buffer.begin(), buffer.size()); + stream.read(reinterpret_cast(buffer.begin()), buffer.size()); pipe.write(buffer, stream.gcount()); } if(stream.bad() || (stream.fail() && !stream.eof())) ============================================================ --- botan/pipe_rw.cpp 98ddc7cd79353b886929f6706a8404bee55aa953 +++ botan/pipe_rw.cpp 8d27e71d853da473f4baec3e8a68679bd6020857 @@ -1,6 +1,6 @@ /************************************************* * Pipe Reading/Writing Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -48,7 +48,7 @@ void Pipe::write(const std::string& str) *************************************************/ void Pipe::write(const std::string& str) { - write((const byte*)str.c_str(), str.size()); + write(reinterpret_cast(str.data()), str.size()); } /************************************************* @@ -122,7 +122,7 @@ std::string Pipe::read_all_as_string(u32 u32bit got = read(buffer, buffer.size(), msg); if(got == 0) break; - str.append((const char*)buffer.begin(), got); + str.append(reinterpret_cast(buffer.begin()), got); } return str; ============================================================ --- botan/pk_algs.cpp 4eaf5dca76443211e7486ca651ae5521d7cb7181 +++ botan/pk_algs.cpp 2fd3c52de28bdc3236564e139de0b24be65e54af @@ -1,6 +1,6 @@ /************************************************* * PK Key Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/pk_algs.h e09d6c2526b142e7aefbcde01217afb84d581c7d +++ botan/pk_algs.h 0cdb3f27d4178871d62f3ffd6eb4cf749b449c8b @@ -1,6 +1,6 @@ /************************************************* * PK Key Factory Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_PK_KEY_FACTORY_H__ ============================================================ --- botan/pk_core.cpp 6aa769ae640128a26f99f53bedebdf10e0d1947d +++ botan/pk_core.cpp e451087382e2c3ab0d8f3624f07891afe1fb22aa @@ -1,6 +1,6 @@ /************************************************* * PK Algorithm Core Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/pk_core.h bcdfc58a47396cdd6023fe343683ed34d6cbc42a +++ botan/pk_core.h b6bc6c56bc5f235e84e7f797ae1b38677cc5cda5 @@ -1,6 +1,6 @@ /************************************************* * PK Algorithm Core Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_PK_CORE_H__ ============================================================ --- botan/pk_filts.cpp f0b3034376d079b3c0e142fdf137b747eb59c493 +++ botan/pk_filts.cpp 4007d826375c8f84ddf27f83b857c16f619a288c @@ -1,6 +1,6 @@ /************************************************* * PK Filters Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/pk_filts.h af8f30ddc7323c166cd55b0440ed913fd7ecb014 +++ botan/pk_filts.h 717d97bf42adf752cac13930ae6cbe484da5a60a @@ -1,6 +1,6 @@ /************************************************* * PK Filters Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_PK_FILTERS_H__ ============================================================ --- botan/pk_keys.cpp 29ab96323d2af6ebe37adb62f87a22b4c2d31490 +++ botan/pk_keys.cpp 5b7fa873a16d72e3a111cb658a8d33a47bebb05b @@ -1,6 +1,6 @@ /************************************************* * PK Key Types Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/pk_keys.h 5c7f20a734f6a954bbef01d8496325d0020dbefa +++ botan/pk_keys.h c5aee8b20fb5f7fbea75385e030e575c596802d6 @@ -1,6 +1,6 @@ /************************************************* * PK Key Types Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_PK_KEYS_H__ ============================================================ --- botan/pk_ops.h 70200faf214f2f97b8b9c119ac37938532dd2905 +++ botan/pk_ops.h 4c7b121d9c89e60bf7a836875b49715c9633da1d @@ -1,6 +1,6 @@ /************************************************* * Public Key Operations Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_PK_OPS_H__ ============================================================ --- botan/pk_util.cpp 8237a1130cf67101cdc62f6f63c5378a27ff240b +++ botan/pk_util.cpp bc6b585bbd39c1d6b76c2039d9007191797fcc15 @@ -1,6 +1,6 @@ /************************************************* * PK Utility Classes Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/pk_util.h e770acbba30020bcf8b39caaa1c0d42f49710023 +++ botan/pk_util.h a453a40c2fedec2c2aefe609f91236ee5641714c @@ -1,6 +1,6 @@ /************************************************* * PK Utility Classes Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_PUBKEY_UTIL_H__ ============================================================ --- botan/pkcs10.cpp 4ad5ae41ff8f07e2d1d2fabf1f66fabf128df070 +++ botan/pkcs10.cpp 9c89f3e653afd0c819a468514a81de9fd2c23079 @@ -1,6 +1,6 @@ /************************************************* * PKCS #10 Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/pkcs10.h 9b47bdb95cf185af680c8d32b26c95b4d83991bf +++ botan/pkcs10.h 2963efb4b97a36cdcd1bb51941ab613f9058ceaa @@ -1,6 +1,6 @@ /************************************************* * PKCS #10 Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_PKCS10_H__ ============================================================ --- botan/pkcs5.cpp a86a2c094f40ac695129fccd11be68e872206e8b +++ botan/pkcs5.cpp 74572fee997b93c59ca6e747e0d7f14b1ca47a46 @@ -1,6 +1,6 @@ /************************************************* * PKCS #5 Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -72,7 +72,10 @@ OctetString PKCS5_PBKDF2::derive(u32bit throw Invalid_Argument("PKCS#5 PBKDF2: Empty passphrase is invalid"); HMAC hmac(hash_name); - hmac.set_key((const byte*)passphrase.c_str(), passphrase.length()); + + hmac.set_key(reinterpret_cast(passphrase.data()), + passphrase.length()); + SecureVector key(key_len); byte* T = key.begin(); ============================================================ --- botan/pkcs5.h 8f8553ead419624b1aeb3041c2d84e2ec9cc4a96 +++ botan/pkcs5.h d383915babdee2ef270bba89440302a6abc522ec @@ -1,6 +1,6 @@ /************************************************* * PKCS #5 Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_PKCS5_H__ ============================================================ --- botan/pkcs8.cpp e3676b23a2b6d3446047bab03ffa1a1508c60ebf +++ botan/pkcs8.cpp 733a303d5cbf22ad09fcb583943de7120358add9 @@ -1,6 +1,6 @@ /************************************************* * PKCS #8 Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -24,23 +24,18 @@ SecureVector PKCS8_extract(DataSou * Get info from an EncryptedPrivateKeyInfo * *************************************************/ SecureVector PKCS8_extract(DataSource& source, - AlgorithmIdentifier& alg_id) + AlgorithmIdentifier& pbe_alg_id) { - SecureVector enc_pkcs8_key; + SecureVector key_data; - try { - BER_Decoder decoder(source); - BER_Decoder sequence = decoder.start_cons(SEQUENCE); - sequence.decode(alg_id); - sequence.decode(enc_pkcs8_key, OCTET_STRING); - sequence.verify_end(); - } - catch(Decoding_Error) - { - throw PKCS8_Exception("Private key decoding failed"); - } + BER_Decoder(source) + .start_cons(SEQUENCE) + .decode(pbe_alg_id) + .decode(key_data, OCTET_STRING) + .verify_end(); - return enc_pkcs8_key; + + return key_data; } /************************************************* ============================================================ --- botan/pkcs8.h 86edce68c6b423000dc6e47001ef379fefc18cdd +++ botan/pkcs8.h 71d4caac3daf75e32dc5c1c44007c2a49ea12dcf @@ -1,6 +1,6 @@ /************************************************* * PKCS #8 Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_PKCS8_H__ ============================================================ --- botan/policy.cpp e166ff18acbb721c2e2631204f7214510606a596 +++ botan/policy.cpp 979a989d26dd9cbc7a01e489136831c7c8ea5bc2 @@ -1,6 +1,6 @@ /************************************************* * Default Policy Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -32,6 +32,8 @@ void set_default_oids(Config& config) add_oid(config, "1.2.840.10040.4.1", "DSA"); add_oid(config, "1.2.840.10046.2.1", "DH"); add_oid(config, "1.3.6.1.4.1.3029.1.2.1", "ELG"); + add_oid(config, "1.3.6.1.4.1.25258.1.1", "RW"); + add_oid(config, "1.3.6.1.4.1.25258.1.2", "NR"); add_oid(config, "1.3.14.3.2.7", "DES/CBC"); add_oid(config, "1.2.840.113549.3.7", "TripleDES/CBC"); @@ -42,8 +44,13 @@ void set_default_oids(Config& config) add_oid(config, "2.16.840.1.101.3.4.1.42", "AES-256/CBC"); add_oid(config, "1.2.840.113549.2.5", "MD5"); + add_oid(config, "1.3.6.1.4.1.11591.12.2", "Tiger(24,3)"); + add_oid(config, "1.3.14.3.2.26", "SHA-160"); - add_oid(config, "1.3.6.1.4.1.11591.12.2", "Tiger(24,3)"); + add_oid(config, "2.16.840.1.101.3.4.2.4", "SHA-224"); + add_oid(config, "2.16.840.1.101.3.4.2.1", "SHA-256"); + add_oid(config, "2.16.840.1.101.3.4.2.2", "SHA-384"); + add_oid(config, "2.16.840.1.101.3.4.2.3", "SHA-512"); add_oid(config, "1.2.840.113549.1.9.16.3.6", "KeyWrap.TripleDES"); add_oid(config, "1.2.840.113549.1.9.16.3.7", "KeyWrap.RC2"); @@ -62,8 +69,32 @@ void set_default_oids(Config& config) add_oid(config, "1.2.840.113549.1.1.12", "RSA/EMSA3(SHA-384)"); add_oid(config, "1.2.840.113549.1.1.13", "RSA/EMSA3(SHA-512)"); add_oid(config, "1.3.36.3.3.1.2", "RSA/EMSA3(RIPEMD-160)"); + add_oid(config, "1.2.840.10040.4.3", "DSA/EMSA1(SHA-160)"); + add_oid(config, "2.16.840.1.101.3.4.3.1", "DSA/EMSA1(SHA-224)"); + add_oid(config, "2.16.840.1.101.3.4.3.2", "DSA/EMSA1(SHA-256)"); + add_oid(config, "1.3.6.1.4.1.25258.2.1.1.1", "RW/EMSA2(RIPEMD-160)"); + add_oid(config, "1.3.6.1.4.1.25258.2.1.1.2", "RW/EMSA2(SHA-160)"); + add_oid(config, "1.3.6.1.4.1.25258.2.1.1.3", "RW/EMSA2(SHA-224)"); + add_oid(config, "1.3.6.1.4.1.25258.2.1.1.4", "RW/EMSA2(SHA-256)"); + add_oid(config, "1.3.6.1.4.1.25258.2.1.1.5", "RW/EMSA2(SHA-384)"); + add_oid(config, "1.3.6.1.4.1.25258.2.1.1.6", "RW/EMSA2(SHA-512)"); + + add_oid(config, "1.3.6.1.4.1.25258.2.1.2.1", "RW/EMSA4(RIPEMD-160)"); + add_oid(config, "1.3.6.1.4.1.25258.2.1.2.2", "RW/EMSA4(SHA-160)"); + add_oid(config, "1.3.6.1.4.1.25258.2.1.2.3", "RW/EMSA4(SHA-224)"); + add_oid(config, "1.3.6.1.4.1.25258.2.1.2.4", "RW/EMSA4(SHA-256)"); + add_oid(config, "1.3.6.1.4.1.25258.2.1.2.5", "RW/EMSA4(SHA-384)"); + add_oid(config, "1.3.6.1.4.1.25258.2.1.2.6", "RW/EMSA4(SHA-512)"); + + add_oid(config, "1.3.6.1.4.1.25258.2.2.1.1", "NR/EMSA2(RIPEMD-160)"); + add_oid(config, "1.3.6.1.4.1.25258.2.2.1.2", "NR/EMSA2(SHA-160)"); + add_oid(config, "1.3.6.1.4.1.25258.2.2.1.3", "NR/EMSA2(SHA-224)"); + add_oid(config, "1.3.6.1.4.1.25258.2.2.1.4", "NR/EMSA2(SHA-256)"); + add_oid(config, "1.3.6.1.4.1.25258.2.2.1.5", "NR/EMSA2(SHA-384)"); + add_oid(config, "1.3.6.1.4.1.25258.2.2.1.6", "NR/EMSA2(SHA-512)"); + add_oid(config, "2.5.4.3", "X520.CommonName"); add_oid(config, "2.5.4.4", "X520.Surname"); add_oid(config, "2.5.4.5", "X520.SerialNumber"); ============================================================ --- botan/pow_mod.cpp 9d95b94f7939eda78fceec8380fec8e394296656 +++ botan/pow_mod.cpp eb6a2654eecdc0e847a132641d5e007ceb96824d @@ -1,6 +1,6 @@ /************************************************* * Modular Exponentiation Proxy Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/pow_mod.h d01bdba0bdab4579b8c0ac0df3d05b4054bb409c +++ botan/pow_mod.h 7ebb967845c2f1b069ca3d0b5c21c5349f2d55e7 @@ -1,6 +1,6 @@ /************************************************* * Modular Exponentiator Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_POWER_MOD_H__ ============================================================ --- botan/powm_fw.cpp 77a451b956445c35d79e08537d3a81db90960917 +++ botan/powm_fw.cpp 381e10f37c1800677e2845cbe31c466b38f88e10 @@ -1,6 +1,6 @@ /************************************************* * Fixed Window Exponentiation Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/powm_mnt.cpp b290cfbb2af5e05305ac9a9664628198297fb2c5 +++ botan/powm_mnt.cpp 7887c90cb82ffe8f47213fc80d5c7594f00bb92f @@ -1,6 +1,6 @@ /************************************************* * Montgomery Exponentiation Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/prf_x942.cpp f2edd1b59960de19ad85166158c461473562aebf +++ botan/prf_x942.cpp 94d6c065c580325db247150d2bce204a1b3e51ee @@ -1,6 +1,6 @@ /************************************************* * X9.42 PRF Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -21,9 +21,7 @@ MemoryVector encode_x942_int(u32bi MemoryVector encode_x942_int(u32bit n) { byte n_buf[4] = { 0 }; - for(u32bit j = 0; j != 4; ++j) - n_buf[j] = get_byte(j, n); - + store_be(n, n_buf); return DER_Encoder().encode(n_buf, 4, OCTET_STRING).get_contents(); } ============================================================ --- botan/primes.cpp b6bc7dbb320ff24cdf16689cb57361551d6bc693 +++ botan/primes.cpp ff3177db02d5f2d38318adc9c5c1d2865ba5bda3 @@ -1,6 +1,6 @@ /************************************************* * Small Primes Table * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/pubkey.cpp 938d1a0579b969ea347c6309b4e957a7f64952fc +++ botan/pubkey.cpp 413323d6652270bf268b614a10443c86987fddb9 @@ -1,6 +1,6 @@ /************************************************* * Public Key Base Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -378,7 +378,8 @@ SymmetricKey PK_Key_Agreement::derive_ke const std::string& params) const { return derive_key(key_len, in, in_len, - (const byte*)params.c_str(), params.length()); + reinterpret_cast(params.data()), + params.length()); } /************************************************* ============================================================ --- botan/pubkey.h e78803dd6f07ef25fdf132520472cdd70dd5dd48 +++ botan/pubkey.h b281c65bae28486d8ef43e7815e55f1d21553b6f @@ -1,6 +1,6 @@ /************************************************* * Public Key Interface Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_PUBKEY_H__ ============================================================ --- botan/randpool.cpp b7237c75b0d6168d7672ce0bc16679a7d5fcab71 +++ botan/randpool.cpp dcfe978754894d39838888a39221519c5ca9b260 @@ -1,6 +1,6 @@ /************************************************* * Randpool Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -9,6 +9,8 @@ #include #include +#include + namespace Botan { namespace { @@ -27,7 +29,7 @@ SecureVector randpool_prf(MessageA RANDPOOL_PRF_TAG tag, const byte in[], u32bit length) { - mac->update((byte)tag); + mac->update(static_cast(tag)); mac->update(in, length); return mac->final(); } @@ -63,8 +65,7 @@ void Randpool::update_buffer() for(u32bit j = 0; j != counter.size(); ++j) if(++counter[j]) break; - for(u32bit j = 0; j != 8; ++j) - counter[j+4] = get_byte(j, timestamp); + store_be(timestamp, counter + 4); SecureVector mac_val = randpool_prf(mac, GEN_OUTPUT, counter, counter.size()); ============================================================ --- botan/randpool.h e490e55f58dfe8deba8dd48f9badb6bad201aac4 +++ botan/randpool.h 282ae46ef6ee4355e39982da535d2de946516f9a @@ -1,6 +1,6 @@ /************************************************* * Randpool Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_RANDPOOL_H__ ============================================================ --- botan/reducer.cpp 661444aaf3a9f34794dfc85b7fa1b77e166c61ca +++ botan/reducer.cpp cbb17f184cc998fba5ca47c08ae25423826c7bf3 @@ -1,6 +1,6 @@ /************************************************* * Modular Reducer Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/reducer.h cf802c2483d8e46c6ac2b42268012f0d4dd33afa +++ botan/reducer.h 531a57bee43fa9c80f2d6f83bb0552b79ca2b548 @@ -1,6 +1,6 @@ /************************************************* * Modular Reducer Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_MODARITH_H__ ============================================================ --- botan/rng.cpp 8139450d8cf07f579a396a137018a6a0d34d488e +++ botan/rng.cpp 60471c38882ca41d868d3893765d6ea6553db036 @@ -1,6 +1,6 @@ /************************************************* * Global RNG Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/rng.h b7323e6afbef620294a9ade850838a996bfc588f +++ botan/rng.h ba9ce2605044c82d04e629ca741eda683dc4d819 @@ -1,6 +1,6 @@ /************************************************* * Global RNG Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_GLOBAL_RNG_H__ ============================================================ --- botan/rsa.cpp 2d6f73fd5688858ddf680b1d3737705e5fe2830f +++ botan/rsa.cpp 3712299fa9bc70a4b7c1631abf5667efc631eda3 @@ -1,6 +1,6 @@ /************************************************* * RSA Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/rsa.h 056dbb42daa09a95064d1f5ab04f4a6052675e3b +++ botan/rsa.h bc6b4bf21a81862bc679e9c6c8c81f8523c50ca9 @@ -1,6 +1,6 @@ /************************************************* * RSA Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_RSA_H__ ============================================================ --- botan/s2k.cpp edc80c7f6a50d8cc113d9e0ab44b2f49a05e54f2 +++ botan/s2k.cpp da0c7b7587edb08299a59e923790c1851f51a001 @@ -1,6 +1,6 @@ /************************************************* * S2K Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/s2k.h 1d434dad3a28aa524515ccc2aba8a3c9481791f0 +++ botan/s2k.h 109b40a203006c1b76f6a6c3d4caff17cdd0fac1 @@ -1,6 +1,6 @@ /************************************************* * S2K Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_S2K_H__ ============================================================ --- botan/secmem.h 6a055673dad2b1aa6531078b1f791318bdf7a331 +++ botan/secmem.h 6c5143161c26e2aa0c8585a7b0740cefc483cd59 @@ -1,6 +1,6 @@ /************************************************* * Secure Memory Buffers Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_SECURE_MEMORY_BUFFERS_H__ @@ -78,7 +78,11 @@ class MemoryRegion void init(bool locking, u32bit size = 0) { alloc = Allocator::get(locking); create(size); } private: - T* allocate(u32bit n) const { return (T*)alloc->allocate(sizeof(T)*n); } + T* allocate(u32bit n) const + { + return static_cast(alloc->allocate(sizeof(T)*n)); + } + void deallocate(T* p, u32bit n) const { alloc->deallocate(p, sizeof(T)*n); } ============================================================ --- botan/secqueue.cpp 5ccf8b1122fb6af815f4a56b424940d7cfaabc6e +++ botan/secqueue.cpp 57e872c273efcf1e5a0b9dc7990eb7d72af2e2d7 @@ -1,6 +1,6 @@ /************************************************* * SecureQueue Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/secqueue.h 76d4ccc109fe988f6fa871fcccc8a044fa35f819 +++ botan/secqueue.h a2c102173a749d25cf550df38ee83e88043e32f0 @@ -1,6 +1,6 @@ /************************************************* * SecureQueue Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_SECURE_QUEUE_H__ ============================================================ --- botan/sha160.cpp dcdbe870c5b69eadb5a6696d80094c8e3e0ce10d +++ botan/sha160.cpp 7f151f0f0f0f3c5358f422625c85d9fbfbc2520f @@ -1,6 +1,6 @@ /************************************************* * SHA-160 Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -54,7 +54,7 @@ void SHA_160::hash(const byte input[]) void SHA_160::hash(const byte input[]) { for(u32bit j = 0; j != 16; ++j) - W[j] = make_u32bit(input[4*j], input[4*j+1], input[4*j+2], input[4*j+3]); + W[j] = load_be(input, j); for(u32bit j = 16; j != 80; ++j) W[j] = rotate_left((W[j-3] ^ W[j-8] ^ W[j-14] ^ W[j-16]), 1); @@ -102,8 +102,8 @@ void SHA_160::copy_out(byte output[]) *************************************************/ void SHA_160::copy_out(byte output[]) { - for(u32bit j = 0; j != OUTPUT_LENGTH; ++j) - output[j] = get_byte(j % 4, digest[j/4]); + for(u32bit j = 0; j != OUTPUT_LENGTH; j += 4) + store_be(digest[j/4], output + j); } /************************************************* ============================================================ --- botan/sha160.h 75e734527e43bdb05151590c5cd97876b2158780 +++ botan/sha160.h 4b02347f5d3093d6f9dffa6301eba8b9c1482b03 @@ -1,6 +1,6 @@ /************************************************* * SHA-160 Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_SHA_160_H__ ============================================================ --- botan/sha256.cpp 5311156645190069e0d83433994737454ed7e748 +++ botan/sha256.cpp c301182d8aaf2804b5c52543987d0bd713acd7e2 @@ -1,6 +1,6 @@ /************************************************* * SHA-256 Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -47,7 +47,7 @@ void SHA_256::hash(const byte input[]) void SHA_256::hash(const byte input[]) { for(u32bit j = 0; j != 16; ++j) - W[j] = make_u32bit(input[4*j], input[4*j+1], input[4*j+2], input[4*j+3]); + W[j] = load_be(input, j); for(u32bit j = 16; j != 64; ++j) W[j] = sigma(W[j- 2], 17, 19, 10) + W[j- 7] + sigma(W[j-15], 7, 18, 3) + W[j-16]; @@ -99,8 +99,8 @@ void SHA_256::copy_out(byte output[]) *************************************************/ void SHA_256::copy_out(byte output[]) { - for(u32bit j = 0; j != OUTPUT_LENGTH; ++j) - output[j] = get_byte(j % 4, digest[j/4]); + for(u32bit j = 0; j != OUTPUT_LENGTH; j += 4) + store_be(digest[j/4], output + j); } /************************************************* ============================================================ --- botan/sha256.h f3fb2c1515d6e4275bfca19cf10c24bd217f9539 +++ botan/sha256.h cd9c6dd936f6352367057c5795848d46bbf248f1 @@ -1,6 +1,6 @@ /************************************************* * SHA-256 Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_SHA_256_H__ ============================================================ --- botan/stl_util.h 4c24302d12e723a8f6b2783b251ed4e7aa46a02b +++ botan/stl_util.h ffa9b20515dc96035b462d19f03aa7322cb703f2 @@ -1,6 +1,6 @@ /************************************************* * STL Utility Functions Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_STL_UTIL_H__ ============================================================ --- botan/symkey.cpp 9b1f5232e3ee804994d5d335879384b0a10e9d0a +++ botan/symkey.cpp c1151d35d6ca0800cadd554543ed1f194f51da0e @@ -1,6 +1,6 @@ /************************************************* * OctetString Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/symkey.h bb111b6485d7142552cdaf683eb32c045d3bc837 +++ botan/symkey.h f098df098267afea9e6a9d1b22529396d8f01572 @@ -1,6 +1,6 @@ /************************************************* * OctetString Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_SYMKEY_H__ ============================================================ --- botan/timers.cpp 1ec7d69295f998e49a6e3dd835366e6fab077a17 +++ botan/timers.cpp f8623fcc7c760b664bebbeb14bd602dd4f2945db @@ -1,6 +1,6 @@ /************************************************* * Timestamp Functions Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/timers.h 54ddc626b8eb21354b91f17da4ce23f04553abae +++ botan/timers.h 12c913f6363815ada0aa26530f4a98b906e8aa41 @@ -1,6 +1,6 @@ /************************************************* * Timestamp Functions Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_TIMERS_H__ ============================================================ --- botan/types.h 20b7609253789b40cc8338168fc36b6286d77e88 +++ botan/types.h a521c18fab8c790a187e0076a750897cc5c964f7 @@ -1,6 +1,6 @@ /************************************************* * Low Level Types Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_TYPES_H__ ============================================================ --- botan/ui.cpp 110c99f760077c645bd4066dee446930ad8736da +++ botan/ui.cpp cdb601e374b711ef9f5a5b4821c923781b97ca2b @@ -1,6 +1,6 @@ /************************************************* * User Interface Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/ui.h 798f616232c5e7d573b8804757aece798e38be28 +++ botan/ui.h 1062847660f76ad872e21bf1c59c70abe6339ce3 @@ -1,6 +1,6 @@ /************************************************* * User Interface Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_UI_H__ ============================================================ --- botan/util.cpp e993a6c91b6f3455787fc05d10230307b408c193 +++ botan/util.cpp 5e45f761ef28e1c32a22cd61fbdf7df28e0c31ca @@ -1,6 +1,6 @@ /************************************************* * Utility Functions Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -40,10 +40,12 @@ u32bit dl_work_factor(u32bit n_bits) const double log_x = n_bits / 1.44; - u32bit estimate = (u32bit)(2.76 * std::pow(log_x, 1.0/3.0) * - std::pow(std::log(log_x), 2.0/3.0)); + const double strength = + 2.76 * std::pow(log_x, 1.0/3.0) * std::pow(std::log(log_x), 2.0/3.0); - return std::max(estimate, MIN_ESTIMATE); + if(strength > MIN_ESTIMATE) + return static_cast(strength); + return MIN_ESTIMATE; } /************************************************* ============================================================ --- botan/util.h 02cce31e55c9e0cf5a237bef31323b20a28d616e +++ botan/util.h bff70e5c51cb75f6fcfb1335e1c5ad38c55ca924 @@ -1,6 +1,6 @@ /************************************************* * Utility Functions Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_UTIL_H__ ============================================================ --- botan/version.h 53fa3f9bc084e373ef685a521a5d185125b0ec27 +++ botan/version.h a07e925460e226f88ce01d28bcd71a00ce152a91 @@ -1,6 +1,6 @@ /************************************************* * Version Information Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_VERSION_H__ ============================================================ --- botan/x509_ca.cpp 8b0cae8065a8a62271cde6535b526cb6a3f706da +++ botan/x509_ca.cpp c490baee785765f71c2de35c8e0596b8b284a07e @@ -1,6 +1,6 @@ /************************************************* * X.509 Certificate Authority Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -15,6 +15,7 @@ #include #include #include +#include #include #include ============================================================ --- botan/x509_ca.h acceef131e954076e3440f9b9067b995fdbc4e34 +++ botan/x509_ca.h 1e8a2dd2335b23e952715f5dbf4b1b792138dbd7 @@ -1,6 +1,6 @@ /************************************************* * X.509 Certificate Authority Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_X509_CA_H__ ============================================================ --- botan/x509_crl.cpp 85cade7cc5603a9247693b7a34e9536f4e5f7b78 +++ botan/x509_crl.cpp 8d56ad20f352039dcccff53846813e8cd2600538 @@ -1,6 +1,6 @@ /************************************************* * X.509 CRL Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -50,13 +50,11 @@ void X509_CRL::force_decode() throw X509_CRL_Error("Algorithm identifier mismatch"); X509_DN dn_issuer; - X509_Time start, end; - tbs_crl.decode(dn_issuer); - tbs_crl.decode(start); - tbs_crl.decode(end); + info.add(dn_issuer.contents()); - info.add(dn_issuer.contents()); + X509_Time start, end; + tbs_crl.decode(start).decode(end); info.add("X509.CRL.start", start.readable_string()); info.add("X509.CRL.end", end.readable_string()); ============================================================ --- botan/x509_crl.h c6d5766322683f47203c0735c9bb2ca955df784f +++ botan/x509_crl.h d583fee89c7e7db9f822e212248fd451ad51f69d @@ -1,6 +1,6 @@ /************************************************* * X.509 CRL Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_X509_CRL_H__ ============================================================ --- botan/x509_ext.cpp ea9c0179d437bd8041db6761a911dad82139cc36 +++ botan/x509_ext.cpp 11ffbaf80379a237ed47a9ba13091db6e84ce95b @@ -1,6 +1,6 @@ /************************************************* * X.509 Certificate Extensions Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -525,7 +525,7 @@ MemoryVector CRL_ReasonCode::encod MemoryVector CRL_ReasonCode::encode_inner() const { return DER_Encoder() - .encode((u32bit)reason, ENUMERATED, UNIVERSAL) + .encode(static_cast(reason), ENUMERATED, UNIVERSAL) .get_contents(); } @@ -536,7 +536,7 @@ void CRL_ReasonCode::decode_inner(const { u32bit reason_code = 0; BER_Decoder(in).decode(reason_code, ENUMERATED, UNIVERSAL); - reason = (CRL_Code)reason_code; + reason = static_cast(reason_code); } /************************************************* ============================================================ --- botan/x509_ext.h 27cfb8662e0abb8f1a62383a21d91cef22a48777 +++ botan/x509_ext.h 6bde07d391500117c5bf7f17f72aecab7386e1f4 @@ -1,6 +1,6 @@ /************************************************* * X.509 Certificate Extensions Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_X509_EXTENSIONS_H__ ============================================================ --- botan/x509_key.cpp e84b71242e87113bfaa1921ea2710b7a7b3c5bce +++ botan/x509_key.cpp 7fb550c81b8c4ecf9767626751ded96208305f98 @@ -1,6 +1,6 @@ /************************************************* * X.509 Public Key Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -153,7 +153,7 @@ Key_Constraints find_constraints(const P u32bit constraints = 0; if(dynamic_cast(key)) - constraints |= KEY_ENCIPHERMENT; + constraints |= KEY_ENCIPHERMENT | DATA_ENCIPHERMENT; if(dynamic_cast(key)) constraints |= KEY_AGREEMENT; ============================================================ --- botan/x509_key.h 4f2af4aada2e273088dcec3bb988dcca3d900d16 +++ botan/x509_key.h 114ed2e6923140353e6678260cec13c71cb4a2fd @@ -1,6 +1,6 @@ /************************************************* * X.509 Public Key Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_X509_PUBLIC_KEY_H__ ============================================================ --- botan/x509_obj.cpp a55097e99c3be5538ad199ed8baac155be7e2a7f +++ botan/x509_obj.cpp f23e2574a233912956eeee348f088438350df3ca @@ -1,6 +1,6 @@ /************************************************* * X.509 SIGNED Object Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/x509_obj.h a2e42a74a17b310ddcd350f705849b4bb4b2479d +++ botan/x509_obj.h e49bcc7c9c7d559e0f746b0c2533fe635309ac54 @@ -1,6 +1,6 @@ /************************************************* * X.509 SIGNED Object Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_X509_OBJECT_H__ ============================================================ --- botan/x509cert.cpp b938b902b807ca055a678baf24b2f946edf081f3 +++ botan/x509cert.cpp d5de5f096e8a47ab498b0b0d90042775c3a1c0fa @@ -1,6 +1,6 @@ /************************************************* * X.509 Certificates Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -313,8 +313,8 @@ X509_DN create_dn(const Data_Store& info } }; - std::multimap names - = info.search_with(DN_Matcher()); + std::multimap names = + info.search_with(DN_Matcher()); X509_DN dn; @@ -335,7 +335,7 @@ AlternativeName create_alt_name(const Da public: bool operator()(const std::string& key, const std::string&) const { - for(u32bit j = 0; j != matches.size(); j++) + for(u32bit j = 0; j != matches.size(); ++j) if(key.compare(matches[j]) == 0) return true; return false; @@ -349,8 +349,8 @@ AlternativeName create_alt_name(const Da std::vector matches; }; - std::multimap names - = info.search_with(AltName_Matcher("RFC882/DNS/URI")); + std::multimap names = + info.search_with(AltName_Matcher("RFC822/DNS/URI")); AlternativeName alt_name; ============================================================ --- botan/x509cert.h 3e0aff7d3950cca7179fabe9758606bddc688d40 +++ botan/x509cert.h 361b75d7368d02b0de174bc2ec5a9884b27954af @@ -1,6 +1,6 @@ /************************************************* * X.509 Certificates Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_X509_CERTS_H__ ============================================================ --- botan/x509find.cpp 21d9e720370c439cc1dd845ddf4b7d8dea5d1f38 +++ botan/x509find.cpp de53edbd8ed1d6f43016264642025ec448d08096 @@ -1,6 +1,6 @@ /************************************************* * X.509 Certificate Store Searching Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/x509find.h b22bc9552ac96ac654e1848498879fdbfbf4411b +++ botan/x509find.h df15095cab4de9ffb349869deb618fe4e6471533 @@ -1,6 +1,6 @@ /************************************************* * X.509 Certificate Store Searching Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_X509_CERT_STORE_SEARCH_H__ ============================================================ --- botan/x509opt.cpp a8032c087cd6389064684f9b783d31cb2aa4a048 +++ botan/x509opt.cpp c8c77834ffe1078d008abc727e34e8b8397e2435 @@ -1,6 +1,6 @@ /************************************************* * X.509 Certificate Options Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/x509self.cpp 2d52d4f6a030eee94570a3c615a6d1dd62b0599e +++ botan/x509self.cpp 5f92488b35e43625413b0215aac9d1f46a1d7a99 @@ -1,6 +1,6 @@ /************************************************* * PKCS #10/Self Signed Cert Creation Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/x509self.h a92566618f91df1a52e754c25a29643b50c5c1da +++ botan/x509self.h 9aac88cb666ace50f762e4371408402e4618b33f @@ -1,6 +1,6 @@ /************************************************* * X.509 Self-Signed Certificate Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_X509_SELF_H__ ============================================================ --- botan/x509stat.cpp 3a556e846bf3e4022d3baa962a649dcba578913a +++ botan/x509stat.cpp ad0ea0d4cc9ef4a1aa9ae278b80ffce29d47f237 @@ -1,6 +1,6 @@ /************************************************* * Globally Saved X.509 State Source * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include @@ -41,8 +41,8 @@ X509_GlobalState::X509_GlobalState() { \ Certificate_Extension* make(const OID& oid) \ { \ - if(OIDS::name_of(oid, NAME)) \ - return new Cert_Extension::TYPE(); \ + if(Botan::OIDS::name_of(oid, NAME)) \ + return new Botan::Cert_Extension::TYPE(); \ return 0; \ } \ }; \ ============================================================ --- botan/x509stat.h be346323dc7106fd7c6753525422050df38b3a28 +++ botan/x509stat.h 1d90a638aa2acaeccfa96676c1019623ebec20ae @@ -1,6 +1,6 @@ /************************************************* * Globally Saved X.509 State Header * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/x509stor.cpp 4f299706a62a445d1d9d2671e9da3ec5db9f5e0f +++ botan/x509stor.cpp 6e4f9030fde21f4d670d1f669ac31868b789365b @@ -1,6 +1,6 @@ /************************************************* * X.509 Certificate Store Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/x509stor.h 0458718b33f732e7681e9ec839300efbb53c0dcf +++ botan/x509stor.h 0c872441411cdd08c7665196990b748eb6eb2710 @@ -1,6 +1,6 @@ /************************************************* * X.509 Certificate Store Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_X509_CERT_STORE_H__ ============================================================ --- botan/x931_rng.cpp f8054903a29e41dfe9ba76291d8ffc5e26bc8166 +++ botan/x931_rng.cpp e75b008bdb53486d98d7aea0dacaa607e55ea0f0 @@ -1,6 +1,6 @@ /************************************************* * ANSI X9.31 RNG Source File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #include ============================================================ --- botan/x931_rng.h aed7d488fbbe36d35fe8245abe44bb7d6b98ab98 +++ botan/x931_rng.h 2dedc53610c7b07e26bfa9b314c7e56b1db402f9 @@ -1,6 +1,6 @@ /************************************************* * ANSI X9.31 RNG Header File * -* (C) 1999-2006 The Botan Project * +* (C) 1999-2007 The Botan Project * *************************************************/ #ifndef BOTAN_ANSI_X931_RNG_H__