CN110197076A - 一种sm4加密算法的软件优化实现方法 - Google Patents

一种sm4加密算法的软件优化实现方法 Download PDF

Info

Publication number
CN110197076A
CN110197076A CN201910428737.6A CN201910428737A CN110197076A CN 110197076 A CN110197076 A CN 110197076A CN 201910428737 A CN201910428737 A CN 201910428737A CN 110197076 A CN110197076 A CN 110197076A
Authority
CN
China
Prior art keywords
bit
abc
fgh
bcd
efg
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910428737.6A
Other languages
English (en)
Other versions
CN110197076B (zh
Inventor
张笑从
郜雅
郭华
王闯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beihang University
Original Assignee
Beihang University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beihang University filed Critical Beihang University
Priority to CN201910428737.6A priority Critical patent/CN110197076B/zh
Publication of CN110197076A publication Critical patent/CN110197076A/zh
Application granted granted Critical
Publication of CN110197076B publication Critical patent/CN110197076B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Technology Law (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Lubricants (AREA)

Abstract

本发明公开了一种SM4加密算法的软件优化实现方法,该方法包括:预处理步骤,包括明文编排和密钥编排,其中明文编排将256*128到128*256大小的比特粒度矩阵转置;密钥编排与明文编排类似;迭代计算步骤,将256组128比特的数据表示为 32轮的加密密钥记为进行32次迭代运算: 其中^表示异或运算;反序计算步骤,将输出的128比特的加密数据表示为

Description

一种SM4加密算法的软件优化实现方法
技术领域
本发明涉及计算机安全技术领域,特别是一种SM4软件优化实现方法。
背景技术
目前的各种数据加密体制可分为对称密码加密体制和公钥密码加密体制。常用的对称密码算法有DES、AES、SM4等。
SM4分组密码算法是我国自主设计的分组对称密码,明文长度、密钥长度和密文长度都是128比特,加密和解密密钥相同。加解密通过32次循环的非线性迭代轮函数来实现,其中包括非线性变换S盒及由循环移位异或构成的线性变换。加密时,首先把128比特密钥按照32比特一组分成4组,然后根据密钥扩展算法,生成32组32比特轮密钥;同时把输入的128比特数据按照32比特一组分成4组进行循环运算。
切片实现是密码算法的快速实现方法之一,以若干比特为基本单位进行并行加解密,其中单比特切片与宽泛意义上的切片仍有较大不同。
切片实现中单比特的切片是最早的切片方式,切片粒度为比特,算法中的非线性部分S盒视为逻辑电路实现。使用1比特切片时,将处理器视为并行的1比特SIMD处理器。线性移位操作只需要改变索引,不需要任何实际指令去实现,所以没有时间消耗。
发明内容
本发明用单比特粒度的切片方法实现SM4算法,在原有切片技术的基础上提出了如下改进的技术方案。
一种SM4加密算法的软件优化实现方法,以1比特为单位切片,在X86架构下一次并行加解/密256组,包括:
作为数据预处理的数据编排和密钥编排步骤,包括:
数据编排步骤,从常规256组128比特数据组织方式到单比特切片要求的256组的同一比特组织在一起的组织方式之间,存在比特矩阵转置变换TRANS(),特征在于,输入为256*128比特,输出为128*256比特。若将输入第i比特表示为二维数组X[256][128]的X[i/128][i mod 128]项,则输出为二位数组X[128][256]的X[i mod 128][i/128]项。
密钥编排步骤,对于第i轮加密的128比特密钥RKi,变换得到表示将RKi每比特重复256次得到的结果,即
迭代计算步骤,将256组128比特的数据表示为32轮的加密密钥记为进行32次迭代运算:
其中^表示异或运算;
反序计算步骤,令则输出的128比特的加密数据表示为
其中,合成置换T的输入和输出都是256组32比特,由非线性变换τ和线性变换L复合而成T(·)=L(τ(·))。
上述256组的同1比特存储在一起(ymm拓展寄存器或一块内存)。表示二维数组X[128][256]的X[0]项,其长度为256比特。
更进一步地,将256组32比特输入数据表示为:其中,均为8*256比特,则
更进一步地,合成变换T中的非线性变换τ中的四个S()为,
S0~S7在逻辑函数表达形式基础上用逻辑运算实现。逻辑表达式采用与或式的表达如下:
S0=~a~b~d~e~g~h+~b~c~d~eh+~b~c~d~fh+~a~c~e~fg~h+~a~b~d~e~fgh+~a~c~d~ef~g~h+~a~b~df~gh+~a~bef~gh+~a~b~cdfh+~a~bde~f~g~h+~a~bc~df~h+~bc~ef~h+~acd~e~g~h+~a~bcd~fh+~a~bcdgh+~a~bcde~f+~acdegh+~ab~c~egh+~ab~c~de~g~h+~ab~c~def~g+b~defgh+~ab~cdfg~h+~ab~cde~f~g+~abc~d~efg+~abcdf~g+~abcdef+bcdef~g+a~b~c~d~f+a~b~e~f~gh+a~d~e~fg~h+a~b~c~dgh+a~c~e~fgh+a~b~ce~g~h+a~b~de~f~g~h+a~b~de~fgh+a~bd~e~g~h+a~bd~f~gh+a~cdef+a~bcd~e~g+acd~f~gh+ab~c~d~e~h+ab~d~e~f~h+ab~c~ef~g+ab~ef~gh+ab~de~f~gh+ab~cd~eh+abd~e~fh+ab~cdeg~h+abc~d~fg~h+abc~def~h
S1=~a~c~d~e~g~h+~b~c~d~e~g~h+~a~b~d~e~fg+~a~d~e~fgh+~b~c~d~fgh+~b~df~gh+~a~cd~f~gh+~a~b~cd~egh+~b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g+a~ce~f~g~h+a~b~cef~h+a~def~g~h+ad~e~fg~h+a~b~cdf~g~h+a~bdefg+a~bc~e~f~g~h+a~bc~deh+a~bcd~f~g+a~bcd~eh+ab~d~f~g+ab~cd~ef+abdef~gh+abc~d~f~h+abcde~h
以上S0~S7式中,a,b,c,d,e,f,g,h为顺序排列的8位256比特输入,~为非运算,+为或运算,与运算*省略,运算优先级为~>*>+。
S0~S7的逻辑表达式,特征在于,8个表达式中的输入a~h是相同的。
对于S0~S7中任意一个逻辑函数,可以表达为“选择函数”形式。
选择函数形式为:
Fo=(F1 and sel)or(F2 and not sel)
其中Fo为n输入单输出逻辑函数,sel为a~h中任一位输入,F1、F2为与sel位无关的n-1位输入单输出的逻辑函数。
还有以下选择函数形式:
Fo=(F3 and sel)xor F2
Fo=(F3 and not sel)xor F1
Fo=(F4 or sel)xor not F1
Fo=(F4 or not sel)xor not F2
Fo=(F4 nand sel)xor F2
Fo=(F4 nand not sel)xor F1
Fo=(F3 nor sel)xor not F1
Fo=(F3 nor not sel)xor not F2
其中F3=F1 xor F2,F4=notF3,A nand B=not A and B,A nor B=not A or B.
限定只与n-1位输入有关后,F1、F2是唯一确定的。有这样的关系:2n=2n-1×2n-1,对于n比特输入逻辑函数,恰好需要2n比特进行表示;F1、F2至少需要2n-1比特进行表示,但实际上仍以2n比特进行表示。以F1为例进行求解:对于(Fo and sel),将输入项为ab…not sel…h的输出由0改为与输入ab…sel…h相同即可。对于2输入单输出逻辑函数,共有16种,除去0、1和两个输入仍有12种不平凡的,可以用12个逻辑门实现。
对于n输入的逻辑函数,递归地使用“选择函数”生成表达式,若选择上面包含两个逻辑门的“选择函数”表达式,可以用最多12+21+22+...2n-2个逻辑门实现。
对于S0~S7,使用选择函数表达,可以用不超过12+8*(21+22+...26)=1020个逻辑门实现。
S0~S78个逻辑函数以任意顺序先后生成“选择函数”形式的表达式;选择函数表达式中sel位按任意顺序选择输入a~h中某一位;后生成的表达式可以借助前面已经生成的结果;上面给出的多个“选择函数”表达式都可以被尝试从而选择逻辑门数最少的表达式。充分尝试上述各种生成表达式的顺序,混合使用多种“选择函数”表达式,可以找到很少门数的S0~S7表达式。
S0~S7的“选择函数”表达式存在互相借用中间结果,实现了S0~S7并行运算。可以找到逻辑门数为514的“选择函数”表达式实现了S0~S7。
X86平台上使用AVX2指令集,具体为vpand、vpnand、vpor、vpxor、vmovdqa指令即可实现上述表达式。汇编语句除去vmovdqa进行数据存取,其余为逻辑运算,需要语句数与上述表达式的逻辑门数相同。
数据反编排步骤,从切片后的128组256比特数据组织方式恢复到正常256组128比特数据,需要进行比特矩阵转置变换inv_TRANS(),特征在于,输入为128*256比特,输出为256*128比特。若将输入第i比特表示为二维数组X[128][256]的X[i/256][i mod 256]项,则输出为二位数组X[256][128]的X[i mod 256][i/256]项。
具体实施方式
作为数据预处理的数据编排和密钥编排步骤,包括:
数据编排步骤,从常规256组128比特数据组织方式到单比特切片要求的256组的同一比特组织在一起的组织方式之间,存在比特矩阵转置变换TRANS(),特征在于,输入为256*128比特,输出为128*256比特。若将输入第i比特表示为二维数组X[256][128]的X[i/128][i mod 128]项,则输出为二位数组X[128][256]的X[i mod 128][i/128]项。
密钥编排步骤,对于第i轮加密的128比特密钥RKi,变换得到表示将RKi每比特重复256次得到的结果,即
迭代计算步骤,将256组128比特的数据表示为32轮的加密密钥记为进行32次迭代运算: 其中^表示异或运算;
反序计算步骤,令则输出的128比特的加密数据表示为
其中,合成置换T的输入和输出都是256组32比特,由非线性变换τ和线性变换L复合而成T(·)=L(τ(·))。
上述256组的同1比特存储在一起(ymm拓展寄存器或一块内存)。表示二维数组X[128][256]的X0]项,其长度为256比特。
更进一步地,将256组32比特输入数据表示为:其中,均为8*256比特,则
更进一步地,合成变换T中的非线性变换τ中的四个S()为,
S0~S7在逻辑函数表达形式基础上用逻辑运算实现。逻辑表达式采用与或式的表达如下:
S0=~a~b~d~e~g~h+~b~c~d~eh+~b~c~d~fh+~a~c~e~fg~h+~a~b~d~e~fgh+~a~c~d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~fg+~abce~fh+~abcd~ef+bcde~fg+a~b~c~d~f+a~b~c~f~gh+a~b~d~e~gh+a~c~d~e~fh+a~d~e~fg+a~be~fg~h+a~bd~ef~h+a~cd~efg~h+a~b~cdefgh+a~bcg~h+a~bc~ef~h+ac~df~gh+ac~dfg~h+a~bc~deg+a~bcd~efg+a~bcde~f+ab~cd~e~f~g~h+abcdf~g~h+abcdef~g
S7=~a~c~d~eg~h+~b~c~dfh+~b~cfgh+~a~def~gh+~a~b~cd~e~f~g+~a~cdfgh+~a~cde~fg~h+~bdef~g~h+~a~bc~df~g+~a~bcf~g~h+~ac~de~g~h+~bc~de~fg+~bcd~e~fh+~bcd~egh+~a~bcde~gh+~bcdef~h+b~c~d~e~g+b~c~d~f~g+b~c~e~f~gh+b~c~e~fg~h+~ab~ef~g~h+~ab~c~dfg~h+~ab~ce~fh+b~de~fgh+~ab~cdeg+bc~efg~h+~abc~defh+~abcd~fgh+~abcd~ef~g+a~b~c~d~gh+a~c~d~efh+a~b~ce~f~g+a~ce~f~g~h+a~b~cef~h+a~def~g~h+ad~e~fg~h+a~b~cdf~g~h+a~bdefg+a~bc~e~f~g~h+a~bc~deh+a~bcd~f~g+a~bcd~eh+ab~d~f~g+ab~cd~ef+abdef~gh+abc~d~f~h+abcde~h
以上S0~S7式中,a,b,c,d,e,f,g,h为顺序排列的8位256比特输入,~为非运算,+为或运算,与运算*省略,运算优先级为~>*>+。
S0~S7的逻辑表达式,特征在于,8个表达式中的输入a~h是相同的。
对于S0~S7中任意一个逻辑函数,可以表达为“选择函数”形式。
选择函数形式为:
Fo=(F1 and sel)or(F2 and not sel)
其中Fo为n输入单输出逻辑函数,sel为a~h中任一位输入,F1、F2为与sel位无关的n-1位输入单输出的逻辑函数。
还有以下选择函数形式:
Fo=(F3 and sel)xor F2
Fo=(F3 and not sel)xor F1
Fo=(F4 or sel)xor not F1
Fo=(F4 or not sel)xor not F2
Fo=(F4 nand sel)xor F2
Fo=(F4 nand not sel)xor F1
Fo=(F3 nor sel)xor not F1
Fo=(F3 nor not sel)xor not F2
其中F3=F1 xor F2,F4=not F3,A nand B=not A and B,A nor B=not A or B.
对于2输入单输出逻辑函数,共有16种,除去0、1和两个输入仍有12种不平凡的,可以用12个逻辑门实现。
对于n输入的逻辑函数,递归地使用“选择函数”生成表达式,若选择上面包含两个逻辑门的“选择函数”表达式,可以用最多12+21+22+...2n-2个逻辑门实现。
对于S0~S7,使用选择函数表达,可以用不超过12+8*(21+22+...26)=1020个逻辑门实现。
S0~S78个逻辑函数以任意顺序先后生成“选择函数”形式的表达式;选择函数表达式中sel位按任意顺序选择输入a~h中某一位;后生成的表达式可以借助前面已经生成的结果;上面给出的多个“选择函数”表达式都可以被尝试从而选择逻辑门数最少的表达式。
S0~S7生成顺序共有40320种可能,sel选择顺序共有40320种可能,确定一个S进行生成并选择一位输入为sel后可以尝试9个等效的“选择函数”表达式,进行这样的穷举搜索可以找到很少门数的S0~S7表达式。
S0~S7的“选择函数”表达式存在互相借用中间结果,实现了S0~S7并行运算。可以找到逻辑门数为514的“选择函数”表达式实现了S0~S7。
X86平台上使用AVX2指令集,具体为vpand、vpnand、vpor、vpxor、vmovdqa指令即可实现上述表达式。汇编语句除去vmovdqa进行数据存取,其余为逻辑运算,需要语句数与上述表达式的逻辑门数相同。
数据反编排步骤,从切片后的128组256比特数据组织方式恢复到正常256组128比特数据,需要进行比特矩阵转置变换inv_TRANS(),特征在于,输入为128*256比特,输出为256*128比特。若将输入第i比特表示为二维数组X[128][256]的X[i/256][i mod 256]项,则输出为二位数组X[256][128]的X[i mo d 256][i/256]项。反编排实现与预处理的编排基本一致。

Claims (5)

1.一种SM4加密算法的软件优化实现方法,特征在于,包括:
预处理步骤,包括明文编排和密钥编排,其中明文编排将输入为256*128比特的256组128比特数据,通过比特矩阵转置变换,输出为128*256比特;密钥编排将第i轮加密的128比特密钥RKi变换得到其中表示将RKi每比特重复256次得到的结果;
迭代计算步骤,将256组128比特的数据表示为32轮的加密密钥记为进行32次迭代运算: 其中^表示异或运算;合成置换T的输入和输出都是256组32比特,由非线性变换τ和线性变换L复合而成T(·)=L(τ(·));
反序计算步骤,将输出的128比特的加密数据表示为
反编排步骤,从切片后的128组256比特数据组织方式恢复到正常256组128比特数据。
2.根据权利要求1所述的SM4加密算法的软件优化实现方法,其特征在于:对于数据编排步骤,利用掩码移动实现方阵的转置,对于需要编排的256*128比特矩阵看作两个128*128矩阵。
3.根据权利要求1所述的SM4加密算法的软件优化实现方法,其特征在于,在迭代计算步骤中,将256组32比特输入数据表示为:其中,均为8*256比特,则
合成变换T中的非线性变换τ中的四个完全相同的代替函数S()为, 其中S()的输入输出均为8*256比特数据;Si()输入为8*256比特数据,输出为1*256比特数据,i=0、1、2、3、4、5、6、7,为切片后的8个256比特数据,代表原始数据中256个分组中相同的8比特。
4.根据权利要求1所述的SM4加密算法的软件优化实现方法,在非线性变换的实现中,S0~S7在逻辑函数表达形式基础上用逻辑运算实现,逻辑表达式采用与或式的表达如下:
S0
~a~b~d~e~g~h+~b~c~d~eh+~b~c~d~fh+~a~c~e~fg~h+~a~b~d~e~fgh+~a~c~d~ef~g~h+~a~b~df~gh+~a~bef~gh+~a~b~cdfh+~a~bde~f~g~h+~a~bc~df~h+~bc~ef~h+~acd~e~g~h+~a~bcd~fh+~a~bcdgh+~a~bcde~f+~acdegh+~ab~c~egh+~ab~c~de~g~h+~ab~c~def~g+b~defgh+~ab~cdfg~h+~ab~cde~f~g+~abc~d~efg+~abcdf~g+~abcdef+bcdef~g+a~b~c~d~f+a~b~e~f~gh+a~d~e~fg~h+a~b~c~dgh+a~c~e~fgh+a~b~ce~g~h+a~b~de~f~g~h+a~b~de~fgh+a~bd~e~g~h+a~bd~f~gh+a~cdef+a~bcd~e~g+acd~f~gh+ab~c~d~e~h+ab~d~e~f~h+ab~c~ef~g+ab~ef~gh+ab~de~f~gh+ab~cd~eh+abd~e~fh+ab~cdeg~h+abc~d~fg~h+abc~def~h
S1
~a~c~d~e~g~h+~b~c~d~e~g~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ab~cdeg+bc~efg~h+~abc~defh+~abcd~fgh+~abcd~ef~g+a~b~c~d~gh+a~c~d~efh+a~b~ce~f~g+a~ce~f~g~h+a~b~cef~h+a~def~g~h+ad~e~fg~h+a~b~cdf~g~h+a~bdefg+a~bc~e~f~g~h+a~bc~deh+a~bcd~f~g+a~bcd~eh+ab~d~f~g+ab~cd~ef+abdef~gh+abc~d~f~h+abcde~h
上式中a,b,c,d,e,f,g,h为顺序排列的8组256比特输入,~为非运算,+为或运算,与运算*省略,运算优先级为~>*>+。
5.根据权利要求3所述的SM4加密算法的软件优化实现方法,其特征在于,对于S0~S7中任意一个逻辑函数,可以表达为以下“选择函数”形式之一;
选择函数的形式为:
Fo=(F1 and sel)or(F2 and not sel)
Fo=(F3 and sel)xor F2
Fo=(F3and not sel)xorF1
Fo=(F4 or sel)xor not F1
Fo=(F4 or not sel)xor not F2
Fo=(F4 nand sel)xor F2
Fo=(F4 nand not sel)xor F1
Fo=(F3 nor sel)xor not F1
Fo=(F3 nor not sel)xor not F2
其中F3=F1 xor F2,F4=not F3,A nand B=not A and B,A nor B=not A or B;
其中Fo为n输入单输出逻辑函数,sel为a~h中任一位输入,F1、F2为与sel位无关的n-1位输入单输出的逻辑函数。
CN201910428737.6A 2019-05-22 2019-05-22 一种sm4加密算法的软件优化实现方法 Active CN110197076B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910428737.6A CN110197076B (zh) 2019-05-22 2019-05-22 一种sm4加密算法的软件优化实现方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910428737.6A CN110197076B (zh) 2019-05-22 2019-05-22 一种sm4加密算法的软件优化实现方法

Publications (2)

Publication Number Publication Date
CN110197076A true CN110197076A (zh) 2019-09-03
CN110197076B CN110197076B (zh) 2021-03-26

Family

ID=67752950

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910428737.6A Active CN110197076B (zh) 2019-05-22 2019-05-22 一种sm4加密算法的软件优化实现方法

Country Status (1)

Country Link
CN (1) CN110197076B (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111310203A (zh) * 2020-02-10 2020-06-19 广东工业大学 一种基于sm2和sm4的电子病历混合加密方法
CN112507644A (zh) * 2020-12-03 2021-03-16 湖北大学 优化的sm4算法线性层电路
CN113282947A (zh) * 2021-07-21 2021-08-20 杭州安恒信息技术股份有限公司 一种基于sm4算法的数据加密方法、装置及计算机平台
CN114091086A (zh) * 2022-01-14 2022-02-25 麒麟软件有限公司 一种基于比特切片的sm4算法快速实现方法
CN114244496A (zh) * 2021-12-01 2022-03-25 华南师范大学 基于塔域优化s盒的sm4加解密算法并行化实现方法
CN114710285A (zh) * 2022-05-19 2022-07-05 北京大学 一种面向异构并行架构的高性能sm4比特切片优化方法

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103647637A (zh) * 2013-11-19 2014-03-19 国家密码管理局商用密码检测中心 一种对简单掩码的sm4算法进行二阶侧信道能量分析方法
CN104065473A (zh) * 2014-06-25 2014-09-24 成都信息工程学院 Sm4分组密码算法s盒的紧凑实现方法
CN105490802A (zh) * 2015-11-27 2016-04-13 桂林电子科技大学 基于gpu的改进sm4并行加解密通信方法
CN105553638A (zh) * 2015-12-07 2016-05-04 成都芯安尤里卡信息科技有限公司 针对sm4一阶掩码算法的二阶频域能量分析攻击
US20160231991A1 (en) * 2015-02-05 2016-08-11 Weng Tianxiang Systematic method of coding wave-pipelined circuits in HDL
CN106712930A (zh) * 2017-01-24 2017-05-24 北京炼石网络技术有限公司 一种sm4加密方法及装置
CN107612683A (zh) * 2017-09-30 2018-01-19 上海众人网络安全技术有限公司 一种加解密方法、装置、系统、设备和存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103647637A (zh) * 2013-11-19 2014-03-19 国家密码管理局商用密码检测中心 一种对简单掩码的sm4算法进行二阶侧信道能量分析方法
CN104065473A (zh) * 2014-06-25 2014-09-24 成都信息工程学院 Sm4分组密码算法s盒的紧凑实现方法
US20160231991A1 (en) * 2015-02-05 2016-08-11 Weng Tianxiang Systematic method of coding wave-pipelined circuits in HDL
CN105490802A (zh) * 2015-11-27 2016-04-13 桂林电子科技大学 基于gpu的改进sm4并行加解密通信方法
CN105553638A (zh) * 2015-12-07 2016-05-04 成都芯安尤里卡信息科技有限公司 针对sm4一阶掩码算法的二阶频域能量分析攻击
CN106712930A (zh) * 2017-01-24 2017-05-24 北京炼石网络技术有限公司 一种sm4加密方法及装置
CN107612683A (zh) * 2017-09-30 2018-01-19 上海众人网络安全技术有限公司 一种加解密方法、装置、系统、设备和存储介质

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
XIN WANG 等: "Flow-based SM4 Encryption via Tilera Multiprocessor", 《2016 IEEE 18TH INTERNATIONAL CONFERENCE ON HIGH PERFORMANCE COMPUTING AND COMMUNICATIONS; IEEE 14TH INTERNATIONAL CONFERENCE ON SMART CITY; IEEE 2ND INTERNATIONAL CONFERENCE ON DATA SCIENCE AND SYSTEMS》 *
吕述望 等: "SM4分组密码算法综述", 《信息安全研究》 *
郎欢 等: "SM4的快速软件实现技术", 《中国科学院大学学报》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111310203A (zh) * 2020-02-10 2020-06-19 广东工业大学 一种基于sm2和sm4的电子病历混合加密方法
CN111310203B (zh) * 2020-02-10 2023-02-03 广东工业大学 一种基于sm2和sm4的电子病历混合加密方法
CN112507644A (zh) * 2020-12-03 2021-03-16 湖北大学 优化的sm4算法线性层电路
CN112507644B (zh) * 2020-12-03 2021-05-14 湖北大学 优化的sm4算法线性层电路
CN113282947A (zh) * 2021-07-21 2021-08-20 杭州安恒信息技术股份有限公司 一种基于sm4算法的数据加密方法、装置及计算机平台
CN114244496A (zh) * 2021-12-01 2022-03-25 华南师范大学 基于塔域优化s盒的sm4加解密算法并行化实现方法
CN114244496B (zh) * 2021-12-01 2023-07-18 华南师范大学 基于塔域优化s盒的sm4加解密算法并行化实现方法
CN114091086A (zh) * 2022-01-14 2022-02-25 麒麟软件有限公司 一种基于比特切片的sm4算法快速实现方法
CN114710285A (zh) * 2022-05-19 2022-07-05 北京大学 一种面向异构并行架构的高性能sm4比特切片优化方法

Also Published As

Publication number Publication date
CN110197076B (zh) 2021-03-26

Similar Documents

Publication Publication Date Title
CN110197076A (zh) 一种sm4加密算法的软件优化实现方法
Nandi et al. Theory and applications of cellular automata in cryptography
CN102025484B (zh) 一种分组密码加解密方法
US6320964B1 (en) Cryptographic accelerator
JP2006317802A (ja) 擬似乱数発生システム、暗号化システム及び復号化システム
CN101848081A (zh) 一种s盒构造方法及s盒
JP2009175167A (ja) データ変換装置、およびデータ変換方法、並びにコンピュータ・プログラム
US20070297614A1 (en) Device, System and Method for Fast Secure Message Encryption Without Key Distribution
Deshpande et al. Area optimized implementation of AES algorithm on FPGA
EP0700614B1 (en) Nonlinear dynamic block substitutions method
CN109033892A (zh) 基于合成矩阵的轮变换复用电路及aes解密电路
Vahi et al. SEPAR: A new lightweight hybrid encryption algorithm with a novel design approach for IoT
Deb et al. Design and analysis of LFSR-based stream cipher
CN110995403B (zh) 一种搜索密码算法线性层硬件实现优化的方法
WO2019126044A1 (en) Techniques for securely executing code that operates on encrypted data on a public computer
JP5207153B2 (ja) 擬似乱数発生システム
US20090022310A1 (en) Cryptographic device and method for generating pseudo-random numbers
Yao et al. FPGA implementation of dynamic key management for DES encryption algorithm
Jegier et al. An approach to constructing reversible multi-qubit benchmarks with provably minimal implementations
KR20060014420A (ko) 암호화/암호 해독용 장치, 메모리 요구량 감소 방법 및컴퓨터 프로그램 제품
US11750369B2 (en) Circuit module of single round advanced encryption standard
Sarkar On Approximating addition by exclusive Or
IL113864A (en) Encoding methods using lump replacement
JP5268011B2 (ja) 暗号化システム及び復号化システム
Korabel’shchikova An extension of the class of Boolean functions used in symmetric cipher algorithms

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant