资 源 简 介
SM2算法C语言源码,KDF使用标准HASH算法
SM2算法静态库编译步骤:
1、将目录sm2放置于linux的共享目录下,使用cd命令进入miracl目录
2、在miracl目录执行命令:./armlinux.sh 执行完成之后会在当前目录生成libsm2.a静态库文件
3、将刚才生成的.a文件拷贝至sm2目录,然后在sm2目录下执行命令:
arm-linux-g++ -o test sm2.c sm2.hpp -L . -lsm2 就会生成sm2测试文件test,将其下载到开发板修改权限后即可运行。
注意:
1、此libsm2.a文件,可直接替换加密机源码common/lib/下的同一文件;
2、armlinux.sh编译脚本不要随意更改。
文 件 列 表
miracl
sample
mirdef
linux64
linux
fact
brent_
brent
aesgcm.txt
ake.txt
ake12blsa.cpp
ake12bna.cpp
ake12bne.cpp
ake12bnr.cpp
ake12bnx.cpp
ake18kssx.cpp
ake1kmt.cpp
ake24blsa.cpp
ake2cpt.cpp
ake2cpt2.cpp
ake2cpw.cpp
ake2nsst.cpp
ake2sst.cpp
ake4cpt.cpp
ake4fsta.cpp
ake4mnta.c
ake4mnta.cpp
ake4mntt.c
ake4mntt.cpp
ake4sbt.cpp
ake6fsta.cpp
ake6mnta.cpp
ake6mntt.c
ake6mntt.cpp
ake6mntx.cpp
ake8bwt.cpp
ake8cpt.cpp
amd64.mcs
amd64.txt
arm.mcs
arm.txt
armlinux.sh
armlinux.sh.bak
avr.mcs
avr2.mcs
avr4.mcs
bandw.cpp
bc32doit.bat
bcldoit.bat
bcxdoit.bat
big.cpp
big.h
bk2.ecs
bls12.cpp
bls24.cpp
bls_gen.cpp
bls_sign.cpp
bls_ver.cpp
bmark.c
bn.cpp
borland.txt
brent.c
brent.cpp
brent_mt.c
brick.c
brick.cpp
brick.h
brute.c
brute.cpp
c.mcs
c1.mcs
c2.mcs
cardano.cpp
clmul.mcs
cm.cpp
cm.txt
common.dss
common.ecs
common2.ecs
complex.cpp
complex.h
config.c
crdecode.cpp
crencode.cpp
crgen.cpp
crsetup.cpp
crt.cpp
crt.h
cs.mcs
cygwin.txt
deciph.c
deciph.cpp
decode.c
decode.cpp
dl.cpp
dl2.cpp
doubig.txt
double.txt
dssetup.c
dssetup.cpp
dssgen.c
dssgen.cpp
dssign.c
dssign.cpp
dssver.c
dssver.cpp
ebrick.c
ebrick.cpp
ebrick.h
ebrick2.c
ebrick2.cpp
ebrick2.h
ec2.cpp
ec2.h
ecdh2m.c
ecdh2m16.c
ecdh2m8.c
ecdhp.c
ecdhp16.c
ecdhp32.c
ecdhp8.c
ecn.cpp
ecn.h
ecn2.cpp
ecn2.h
ecn2_opt.c
ecn3.cpp
ecn3.h
ecn4.cpp
ecn4.h
ecn6.cpp
ecn6.h
ecsgen.c
ecsgen.cpp
ecsgen2.c
ecsgen2.cpp
ecsgen2s.c
ecsgen_s.c
ecsign.c
ecsign.cpp
ecsign2.c
ecsign2.cpp
ecsign2s.c
ecsign_s.c
ecsver.c
ecsver.cpp
ecsver2.c
ecsver2.cpp
ecsver2s.c
ecsver_s.c
edwards.ecs
edwards.txt
enciph.c
enciph.cpp
encode.c
encode.cpp
etat271.c
fact.c
fact.cpp
factor.c
fastgf2m.txt
findbase.cpp
first.txt
flash.cpp
flash.h
float.txt
floating.cpp
floating.h
flpoly.cpp
flpoly.h
folklore.cpp
freeman.cpp
fsample.cpp
gcc386.mcs
gccarm.mcs
gcclmul.mcs
gccmsp430.mcs
gccppc.mcs
gccsse2.mcs
gcdoit.bat
genkey.c
genkey.cpp
genprime.c
genprime.cpp
gf2m.cpp
gf2m.h
gf2m12x.cpp
gf2m12x.h
gf2m4x.cpp
gf2m4x.h
gf2m6x.cpp
gf2m6x.h
glv.cpp
hail.c
hail.cpp
hilbert.c
hilbert.cpp
ibe.txt
ibe_dec.cpp
ibe_decx.cpp
ibe_enc.cpp
ibe_encx.cpp
ibe_exp.cpp
ibe_ext.cpp
ibe_extx.cpp
ibe_set.cpp
ibe_setx.cpp
identity.c
imratio.c
imratio2.c
index.c
index.cpp
ipk.txt
ipk_dec.cpp
ipk_enc.cpp
ipk_ext.cpp
ipk_set.cpp
irp.cpp
irred.cpp
itanium.mcs
itanium.txt
k2.ecs
k2ss.ecs
k4.ecs
k4mnt.ecs
k6.ecs
k8.ecs
kangaroo.c
kangaroo.cpp
kcmcomba.txt
kob163.ecs
kob233.ecs
kob283.ecs
kob571.ecs
kss18.cpp
kss36.cpp
kss8.cpp
kw4.ecs
lenstra.c
lenstra.cpp
libsm2.a
libsm2_x86.a
limlee.c
limlee.cpp
linux.txt
mac.txt
makemcs.txt
make_k1.cpp
make_x86.sh
managed.txt
mersenne.c
mersenne.cpp
mex.c
miracl.h
miracl.mak
mirdef.amd
mirdef.arm
mirdef.ash
mirdef.atm
mirdef.bfp
mirdef.bpp
mirdef.bs
mirdef.ccc
mirdef.cm
mirdef.dll
mirdef.gcc
mirdef.gen
mirdef.gfp
mirdef.h
mirdef.h16
mirdef.h32
mirdef.h64
mirdef.haf
mirdef.hio
mirdef.hpc
mirdef.ibe
mirdef.kep
mirdef.lnx
mirdef.mik
mirdef.mip
mirdef.mmm
mirdef.ol
mirdef.ppc
mirdef.scr
mirdef.sjc
mirdef.spr
mirdef.tst
mirdef.w64
mirdef_arm9260.h
mirdef_x86.lnx
mnt.cpp
mnt.ecs
mnt6.dat
modpol.cpp
mr87f.c
mr87v.c
mraes.c
mraes.o
mralloc.c
mralloc.o
mrarth0.c
mrarth0.o
mrarth1.c
mrarth1.o
mrarth2.c
mrarth2.o
mrarth3.c
mrarth3.o
mrbits.c
mrbits.o
mrbrick.c
mrbrick.o
mrbuild.c
mrcomba.tpl
mrcomba2.tpl
mrcore.c
mrcore.o
mrcrt.c
mrcrt.o
mrcurve.c
mrcurve.o
mrdouble.c
mrebrick.c
mrebrick.o
mrebrick2.c
mrec2m.c
mrec2m.o
mrecn2.c
mrecn2.o
mrfast.c
mrfast.o
mrflash.c
mrflsh1.c
mrflsh2.c
mrflsh3.c
mrflsh4.c
mrfrnd.c
mrgcd.c
mrgcd.o
mrgcm.c
mrgcm.o
mrgf2m.c
mrgf2m.o
mrio1.c
mrio1.o
mrio2.c
mrio2.o
mrjack.c
mrjack.o
mrkcm.tpl
mrlucas.c
mrlucas.o
mrmonty.c
mrmonty.o
mrmuldv.any
mrmuldv.c
mrmuldv.c32
mrmuldv.ccc
mrmuldv.c_
mrmuldv.gcc
mrmuldv.gpp
mrmuldv.ppc
mrmuldv.s
mrmuldv.s64
mrmuldv.tcc
mrmuldv.w64
mrpi.c
mrpower.c
mrpower.o
mrprime.c
mrprime.o
mrrand.c
mrrand.o
mrround.c
mrscrt.c
mrscrt.o
mrshs.c
mrshs.o
mrshs256.c
mrshs256.o
mrshs512.c
mrshs512.o
mrsmall.c
mrsmall.o
mrsroot.c
mrsroot.o
mrstrong.c
mrstrong.o
mrxgcd.c
mrxgcd.o
mrzzn2.c
mrzzn2.o
mrzzn2b.c
mrzzn2b.o
mrzzn3.c
mrzzn3.o
ms32doit.bat
ms64doit.bat
ms86.mcs
msiodoit.bat
msldoit.bat
msp430.mcs
msvisual.txt
mueller.cpp
my160.ecs
newbasis.cpp
nist163.ecs
nist233.ecs
nist283.ecs
nist571.ecs
nk4.ecs
p1363.c
p1363.h
pairings.txt
palin.c
palin.cpp
pal_dec.cpp
pal_enc.cpp
pk-demo.c
pk-demo.cpp
pm.cpp
pm112.ecs
pm128.ecs
pm160.ecs
pollard.c
pollard.cpp
poly.cpp
poly.h
poly2.cpp
poly2.h
poly2mod.cpp
poly2mod.h
poly2xy.cpp
poly2xy.h
polymod.cpp
polymod.h
polyxy.cpp
polyxy.h
powerpc.txt
private.key
problems.txt
process.cpp
ps_big.cpp
ps_big.h
ps_zzn.cpp
ps_zzn.h
public.key
qsieve.c
qsieve.cpp
ratcalc.c
read.txt
readme.txt
romaker.c
romaker2.c
roots.c
roots.cpp
rsa.c
rsat.c
sample.c
sample.cpp
schoof.cpp
schoof.txt
schoof2.cpp
schoof2.txt
sea.cpp
sea.txt
secp160.ecs
secp192.ecs
secp224.ecs
secp256.ecs
secp521.ecs
sf2m12x.cpp
sf2m12x.h
sm2.c
sm2.h
sm2.o
sm2_test.c
sm3.c
sm3.h
sm3.o
smartmip.mcs
smartmip.txt
sparc.txt
sparc32.mcs
sparc64.mcs
sse2.mcs
sse2.txt
st22.txt
super2.cpp
tc86.mcs
test1363.c
threadmp.cpp
threadux.cpp
threadwn.cpp
tp.cpp
trans.cpp
update.txt
variable.h
vc2005.txt
weil.cpp
weng.ecs
williams.c
williams.cpp
win64.mcs
win64.txt
xk1.ecs
zzn.cpp
zzn.h
zzn12.cpp
zzn12.h
zzn12a.cpp
zzn12a.h
zzn12b.cpp
zzn12b.h
zzn18.cpp
zzn18.h
zzn2.cpp
zzn2.h
zzn24.cpp
zzn24.h
zzn3.cpp
zzn3.h
zzn36.cpp
zzn36.h
zzn4.cpp
zzn4.h
zzn6.cpp
zzn6.dat
zzn6.h
zzn6a.cpp
zzn6a.h
zzn8.cpp
zzn8.h
test
libsm2.a
miracl.hpp
mirdef.hpp
sm2.c
sm2.hpp
编译.txt
sm3.hpp
types.hpp