信息安全技术SM3密码杂凑算法(GB-T 32905-2016).docx

上传人:wo****o 文档编号:96306659 上传时间:2023-10-21 格式:DOCX 页数:19 大小:228.33KB
返回 下载 相关 举报
信息安全技术SM3密码杂凑算法(GB-T 32905-2016).docx_第1页
第1页 / 共19页
信息安全技术SM3密码杂凑算法(GB-T 32905-2016).docx_第2页
第2页 / 共19页
点击查看更多>>
资源描述

《信息安全技术SM3密码杂凑算法(GB-T 32905-2016).docx》由会员分享,可在线阅读,更多相关《信息安全技术SM3密码杂凑算法(GB-T 32905-2016).docx(19页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、ICS35.040L80中华人民共和国国家标准GB/T XXXXXXXXX信息安全技术 SM3密码杂凑算法Information security techniques - SM3 cryptographic Hash algorithm点击此处添加与国际标准一致性程度的标识XXXX - XX - XX发布XXXX - XX - XX实施目次前言IV1 范围12 术语和定义13 符号14 常数与函数24.1 初始值24.2 常量24.3 布尔函数24.4 置换函数25 算法描述25.1 概述25.2 填充35.3 迭代压缩35.4 输出杂凑值4附录A(资料性附录)运算示例5A.1 示例15A.

2、2 示例27前言本标准按照GB/T 1.1-2009给出的规则起草。本标准由国家密码管理局提出。本标准由全国信息安全标准化技术委员会(SAC/TC260)归口。本标准起草单位:清华大学、国家密码管理局商用密码检测中心、解放军信息工程大学、中国科学院数据与通信保护研究教育中心。本标准主要起草人:王小云、李 峥、王永传、于红波、谢永泉、张 超、罗 鹏、吕述望。11GB/T 信息安全技术 SM3密码杂凑算法1 范围本标准规定了SM3密码杂凑算法的计算方法和计算步骤,并给出了运算示例。本标准适用于商用密码应用中的数字签名和验证、消息认证码的生成与验证以及随机数的生成,可满足多种密码应用的安全需求。2

3、术语和定义下列术语和定义适用于本文件。2.1比特串 bit string具有0或1值的二进制数字序列。2.2大端 big-endian数据在内存中的一种表示格式,规定左边为高有效位,右边为低有效位。即数的高阶字节放在存储器的低地址,数的低阶字节放在存储器的高地址。2.3消息 message任意有限长度的比特串,本标准中消息作为杂凑算法的输入数据。2.4杂凑值 hash value杂凑算法作用于一条消息时输出的消息摘要(比特串)。2.5字 word长度为32比特的组(串)。3 符号下列符号适用于本文件。ABCDEFGH:8个字寄存器或它们的值的串连B(i):第i个消息分组 CF:压缩函数FFj:

4、布尔函数,随j的变化取不同的表达式GGj:布尔函数,随j的变化取不同的表达式IV:初始值,用于确定压缩函数寄存器的初态P0:压缩函数中的置换函数P1:消息扩展中的置换函数Tj:算法常量,随j的变化取不同的值m:消息m:填充后的消息mod:模运算n:消息分组个数:32比特与运算:32比特或运算:32比特异或运算:32比特非运算:mod 232比特算术加运算:32比特循环左移比特运算:左向赋值运算符4 常数与函数4.1 初始值=7380166f 4914b2b9 172442d7 da8a0600 a96f30bc 163138aa e38dee4d b0fb0e4e4.2 常量4.3 布尔函数其

5、中,为字。4.4 置换函数其中为字。5 算法描述5.1 概述SM3密码杂凑算法的输入为长度为比特的消息,经过填充、迭代压缩,生成杂凑值,杂凑值输出长度为256比特。运算示例参见附录A。5.2 填充假设消息的长度为比特,则首先将比特“1”添加到消息的末尾,再添加个“0”,是满足的最小的非负整数。然后再添加一个64位比特串,该比特串是长度的二进制表示。填充后的消息的比特长度为512的倍数。例如:对消息:01100001 01100010 01100011,其长度,经填充得到比特串:5.3 迭代压缩5.3.1 迭代过程将填充后的消息按512比特进行分组: ,其中。对按下列方式迭代:FOR TO EN

6、DFOR其中是压缩函数,为256比特初始值,为填充后的消息分组,迭代压缩结果为。5.3.2 消息扩展将消息分组按以下方法扩展生成132个消息字,用于压缩函数:第一步,将消息分组划分为16个字。第二步,FOR TO 67ENDFOR第三步,FOR TO 63ENDFOR5.3.3 压缩函数令为字寄存器,为中间变量,压缩函数,。计算过程描述如下:FOR TO ENDFOR其中,字的存储为大端(big-endian),左边为高有效位,右边为低有效位。5.4 输出杂凑值输出256比特的杂凑值。附录A (资料性附录)运 算 示 例A.1 示例1A.1.1 输入十六进制数据 616263A.1.2 填充后

7、的消息61626380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018A.1.3 扩展后的消息616263800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000189092e20000000000000c0606719c7

8、0ed000000008001801f939f7da9000000002c6fa1f9adaaef14000000000001801e9a965f894971004823ce86a1b2d12f1be1dae338f8061807055d68be86cfd4811f447d83d9023dbf185898e0e0061807050df55ccde0104ca5b9c955a7df01846e46cd08e3babdf870caa4220353af50a92dbca15f33cfd2e16f6e89f70fe941ca5462dc85a9015276af6296c922bdb268378cf59

9、75853440900872386faee742ab908b04a64bc50864e6e08f07e6590325c8f78accb8011e11db9ddb99c05456162638000000000000000000000000000000000000000000000000000000000000000000000000000000000000000189092e20000000000000c0606719c70f59092e2008001801f93937baf719c70ed2c6fa1f92dab6f0b939f7da90001801eb6f9fe70e4dbef5c23ce8

10、6a1b2d0af057b4cbcb1b177184f2693ee1f341efb9afe9e9ebb210425b81d05f05e66c9cc861a4988df14e22df3bde151b547d919836b4b38542e5aadb4d5736d77a48caed4c76b71a9bc89722a91a5caabf45c46116379de7dda9ace8097c00c1f3e2d54f3a263ee2912f152167fafe5b54fd853c6428e8445dd3cef148f4ee92b76848be418e587c8e6af3c416753d7d549e260d5A

11、.1.4 迭代压缩中间值jABCDEFGH7380166f4914b2b9172442d7da8a0600a96f30bc163138aae38dee4db0fb0e4e0b9edc12b7380166f29657292172442d7b2ad29f4a96f30bcc550b189e38dee4d1ea52428cb9edc12b002cdee729657292ac353a23b2ad29f485e54b79c550b1892609f2850ea52428cdb825773002cdee7d33ad5fbac353a234fa5956985e54b79335037e59609f2850a48

12、519d4db825773b8204b5fd33ad5fbd11d61a94fa5956941f99576635037e593e50a0c1a48519d48ad212eab8204b5fafde99d6d11d61a95374a0ca71f99576606fcb26a3e50a0c1acf0f6398ad212ea5afdc102afde99d6633130100374a0ca732aecc3f06fcb26a3391ec8aacf0f639975456905afdc10271022ac973313010094194e6e32aecc3f367250a13391ec8ab1cd6787975

13、456908d47caf4c1022ac972602006694194e6e6ad473a4367250a164519c8fb1cd6787959c2744bd47caf4c45592e2026020066c6a3ceae6ad473a48509b39264519c8f10481ba2a059c2744bf95e99a845592e2002afb727c6a3ceae9d2356a38509b39211694a3d09481ba2a084e896b3f95e99a89dd1b58c02afb7277576351e9d2356a31289cbcd58694a3d093745409084e896b

14、36370db629dd1b58cb938157d7576351e1324c95abc89cbcd58947a12d2374540901a4a25546370db62ac64ee8db938157d147c52977824c95abc979ab113947a12d23ee959331a4a2554db131b86ac64ee8d1534d1691e7c52977892b57849979ab11361f996463ee959332aa0d251db131b8616796afab134d1691ea52ef0f892b57849067550f561f99646c999f74a2aa0d251177

15、d27cc0e796afab1a2d23c69a52ef0f8b3c8669b067550f5b2330fccc999f74a18d7820ad17d27cc0ed5f562f2a2d23c69575c37d8b3c8669b87a833aab2330fcc19f84fd372d7820ad14f981cfad5f562f2a5dceaf1575c37d834dd9e4387a833aa2002c57896f84fd3720415a3af4f981cfa74576681a5dceaf1bec2bae134dd9e43214d0c2fcd02c578969fa6e5f00415a3af576f1

16、d0974576681578d2ee7bec2bae122eeeec41a4d0c2fcd8af12c059fa6e5f0b5523911576f1d09340ba2bb578d2ee723f368da78eeeec41a185f9a9a8af12c056a879032b5523911e84abb78340ba2bb2415ce1286f368da78dd8835dd185f9a9a620633546a879032c88daa91e84abb7825c3fd31c215ce1286d1b4f1e6dd8835dd4db58f43620633548193543cc88daa91266243be5

17、ec3fd31c29c250c2bd1b4f1e6131152fe4db58f439aa310318193543c27a549beaa6243be5efa6385879c250c2bcf65e309131152fe7a1a6dac9aa3103128e11eb847a549beaa877cbcc4fa638587e5b64e96cf65e30997f0988a7a1a6dac29ff9bac9de11eb847937d554a877cbcc49811b46de5b64e96184e7b2f97f0988a30a5a4a2b3ff9bac9d3d708fc2937d554ae92df4ea981

18、1b46d74b72db2184e7b2f3189a13e59a5a4a2b337593bff3d708fc20a1ff572e92df4eaa36cc08d74b72db2323720bd4e89a13e594945674b37593bffcf7d16830a1ff572a757496fa36cc08d339ccd089c3720bd4e427cb3134945674bda8c835fcf7d1683ab9050ffa757496f34c7a0744d9ccd089c417a9c6e427cb3130958ff1bda8c835fb41e7be8ab9050ff35d955c3edc7a07

19、44d9a113939417a9c6ec533f0ff0958ff1b1afed464b41e7be836e142d72bd955c3ed40e89b8f9a113939d4509586c533f0fff8d84ac71afed46437e7250598e142d72bab87dbb240e89b8fc7f93fd3d450958687fe299ff8d84ac7382f13c4ade725059885ae57c2ab87dbb21a6cabc9c7f93fd3ac36a28487fe299f3919f363f92f13c4ad4a0b31ce85ae57c2c302badb1a6cabc9f

20、e9e3fc9ac36a2844055e1dde219f363f927895a5e4a0b31ce459daccfc302badb5e48d365fe9e3fc941d4f4efe355e1dde2e6c7f23327895a5e5cfba85a459daccfd6de18155e48d3654248dcbc62d4f4efe3c3bbc4abe6c7f2336f49c7bb5cfba85a667a2cedd6de1815438237b8a048dcbc62e9dfc7a9c3bbc4abd89d27116f49c7bb42d2e7dd667a2ced44d86859398237b8a0b97

21、8c491e9dfc7a98ee87df5d89d27113ddb7a4e42d2e7dd45d2090a86d86859396f714104b978c4912e5336258ee87df5388ec4e93ddb7a4e46e51076b3d2090a86d0b273b06f714104d9f89e612e533625efac7743388ec4e94747c5be50e51076b312150da4d0b273b03567734ed9f89e61b1297299efac774348abddbdc847c5be5020ed67ca12150da43dfcdd113567734ef30ecfc

22、4b129729949bd708003abddbdc88b7ca08f20ed67ca93494bc03dfcdd119a71ab3bf30ecfc45015e2f5d3bd708003bb7b91578b7ca08fc3956c3f93494bc0e889efe69a71ab3b511382648615e2f5d3e100077abb7b9157cd09a51cc3956c3f5e049a4ae889efe6524a00ed2f13826486c5eba62be100077a0741f675cd09a51c61fe1cab5e049a4a53f4412e824a00ed2f04c90c27c

23、5eba62b7429807c0741f67528e6684d61fe1cab54549db4b7f4412e8201da5e9404c90c27f6bc15ed7429807cb3a83a0f28e6684d5522a79585549db4b7825d05e801da5e949d4db19af6bc15ed03e3a14cb3a83a0f5630245b7822a795853b696ea9825d05e8f6804c829d4db19aaf6fb5e003e3a14c576598314f30245b784f2b0a453b696ea9f522adb2f6804c828cd4ea6daf6fb

24、5e058c3d629a96598314f48b6f0604f2b0a4514fb0764f522adb26417b4028cd4ea6d59ddb0a26ac3d629a930629ecb48b6f060589f7d5c14fb07646d97a9156417b4026071034d71ddb0a26aac53538730629ecb14d5c7f6589f7d5c3b20a7d86d97a915615e636b4b71034d716144d5bbac53538709ccd95e14d5c7f6eae2c4fb3b20a7d8622bfa5f605e636b4b069ae2e26144d5b

25、b4ac3cf0809ccd95e3fb0a6aeeae2c4fb631547e69b2bfa5f60c6d696bc069ae2e2e808f43b4ac3cf08caf04e663fb0a6aeA.1.5 杂凑值66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0A.2 示例2A.2.1 512比特消息616263646162636461626364616263646162636461626364616263646162636461626364616263646162636461626364616263646162

26、63646162636461626364A.2.2 填充后的消息6162636461626364616263646162636461626364616263646162636461626364616263646162636461626364616263646162636461626364616263646162636480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200A.2.3 第一个消息分

27、组A.2.3.1 扩展后的消息61626364616263646162636461626364616263646162636461626364616263646162636461626364616263646162636461626364616263646162636461626364a121a024a121a024a121a0246061e0e56061e0e56061e0e5a002e345a002e345a002e34549c969ed49c969ed49c969ed85ae5679a44ff619a44ff619694b6244e8c8e0c4e8c8e0c4240e103e346e6

28、03e346e603e9a517ab58a01aa258a01aa250607191c25f8a37ad528936a89fbd8ae00606206105012567cff7ef93c78b9f9cc2b8a699f03f169df45be209ec5bee10a21290649ff72c04671724167e09a196efaa3332ebae6763475c386201dcff62f18fccf2c5f2b5ca80b9f38bc139f34c47f18a7a25ce71d4274370551baf61900000000000000000000000000000000000000000

29、0000000000000000000000000000000000000000000000000000000c043c340c043c340c043c34001038381c14040c1c14040c101234361c06303a0c06303a029a88908e9cb8aa8e9cb8aa825acb53ced869ff4ed869ff420820ba96d66b6bd4c8716dd8041e6275d25027adca680fa72999a71ae0fba1bbe6fca1b32697922bfa9d9cf5f29394f03fa728b06677b1a35a8b12ca9d7e

30、d93b5836157cc4be86f8f53e33fa3bac0d9a2bd0718c60aa36fd6fc83a99934cc61f92524f864db8a35674594b67204b1c747fd55ef41e25ffc02e5cd2a9c7e5cbe9c0e50c2eb67e4688e03cc41ea7fa83deda9692dA.2.3.2 迭代压缩中间值jABCDEFGH7380166f4914b2b9172442d7da8a0600a96f30bc163138aae38dee4db0fb0e4e0588b5dab7380166f29657292172442d7b2e561d0

31、a96f30bcc550b189e38dee4d1b31cecd3588b5dab002cdee729657292887cdf53b2e561d085e54b79c550b1892087b31dfb31cecd316bb56b1002cdee75234344f887cdf530e85972b85e54b79317448b12087b31df39d9a76616bb56b116372ca65234344ffa9c43e60e85972b4dca06de517448b12f663be1039d9a766f7bc113c16372ca6a27a91a1fa9c43e658eb847a3dca06de

32、58916242ef663be109fe64fb1f7bc113c6530b1b9a27a91a160e0f12188eb847a340dbcbb98916242e57e5fc4e9fe64fb189e7bde06530b1b97ada838270e0f1218708f471d40dbcbb955eb859157e5fc4e7d8cff3289e7bde086e12c163ada838271e24301c708f471dc26a14b855eb8591e272bf2f7d8cff329f75781176e12c16350704f5b1e24301c3433dd28c26a14b82c8aaf5

33、ce272bf2f10bc497c66f75781172582c6dc50704f5b4f85c7493433dd28a5c613502c8aaf5c11ecc59168bc497c66af022fee2582c6dc8ce5ee614f85c749e941a19ea5c613501263723715ecc5916892f8cd78af022fee38e2aa278ce5ee613a4a7c2ee941a19e13e57bfbf8637237158b22d1d992f8cd78542318e738e2aa27730c672f3a4a7c2e148ba504b1e57bfbf8e46e2ac68

34、b22d1d9a8c73777542318e75139c715730c672f15b6a4be208ba504b1f7f7f1cae46e2ac68ae4d7a0a8c73777c73aa1185139c71516c0a0e3f7b6a4be204a096317f7f7f1caf671e12a8ae4d7a0bbbd4639c73aa1181768ef7357c0a0e3f7497c416d4a096317673f9d46f671e12abd045726bbbd4639184c6499d368ef735741c7ef81497c416df01924a3673f9d460957b38fbd045

35、726199f5327354c6499d3dee6aed141c7ef8171c6ef02f01924a3ea3339fc0957b38f20231d84bd9f532735c933a698dee6aed1108149de71c6ef02251f80c9ea3339fc216a203212231d84bda64e6b3ec933a69890c31af9108149de78138e37251f80c922175c3b576a2032123b097a46a64e6b3e508f82d290c31af94ef0840a78138e3723cdcbabd5175c3b57406424d43b097a4

36、6b5a2f2fb508f82d2d7cc86184ef0840a247dd941f8cdcbabd5b876ae2e406424d4a541cb9bb5a2f2fb1692847cd7cc861825eaf54f3e7dd941f89757ab9bb876ae2e912d4e17a541cb9b97ddad171692847c26f7310a83eaf54f3eb283f0fb9757ab9bb43da5e9912d4e175cdd2a0e97ddad1727f8441d7ef7310a83ea9e7dd5b283f0fbcf194872b43da5e970bc896a5cdd2a0e282

37、70dce67f8441d7e621507eeea9e7dd57564b6c0cf1948722f4da1ed70bc896a29ac12a6c0270dce67883afdf0621507ee964015e37564b6c0439678ca2f4da1ed301bd9e6e3ac12a6c01b9cce4e883afdf00fac4cad964015e3b603ab25439678ca3132418d741bd9e6e3254d81581b9cce4e3f7176980fac4cadaf1cb200b603ab25329c89b50532418d74b3cdc637254d815838766

38、abf3f71769865687d62af1cb200333c60352a9c89b505831ae864b3cdc6378aedd93b38766abfb4c1fb8b65687d62342a116c703c60352a136a0b39831ae864476048d48aedd93b55f9c3b3b4c1fb8b35a0c7c66f2a116c70c06a5478136a0b39b47a7dc5476048d4c9dc576e55f9c3b336b7e58f33a0c7c66f22d8e054c06a54783a3537a9b47a7dc546a23b02c9dc576e3779baf4c

39、ab7e58f338f8cdf4122d8e0549455b7313a3537a9ee2da3d346a23b0238ad5b0bcf79baf4cacb1e676f8f8cdf41289d35e09455b731bd49d1a9ee2da3d339a167bd76ad5b0bcf75e994f3cb1e676fda27276b289d35e0b98ca2adbd49d1a9402ccc1878a167bd76b6179f5a75e994f37eded43bda27276baf0144e9b98ca2ad41610c60842ccc1878cf7aed42b6179f5a9da32cab7eded43b3b5ed139af0144e942a40209fe610c60849830f059cf7aed427d4838469da32cab

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 技术资料 > 国家标准

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁