Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build linking error (When ENABLE_SM2_Z256 is OFF) #1631

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Mike4Feet
Copy link

解决当ENABLE_SM2_Z256开关是关闭时,编译时会报错;
编译命令:
cmake .. -DCMAKE_C_STANDARD=99
make -j8

报错信息:
Linking C executable bin/gmssl
bin/libgmssl.so.3.1:对‘sm2_z256_modn_add’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_modn_rand’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_one’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_modn_inv’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_point_mul’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_order’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_to_bytes’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_print’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_is_zero’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_point_is_on_curve’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_cmp’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_add’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_point_to_bytes’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_point_mul_sum’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_modn_mul’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_sub’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_modn_sub’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_point_from_bytes’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_point_mul_generator’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_from_bytes’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_point_get_xy’未定义的引用
collect2: 错误:ld 返回 1
make[2]: *** [CMakeFiles/gmssl-bin.dir/build.make:786:bin/gmssl] 错误 1
make[1]: *** [CMakeFiles/Makefile2:241:CMakeFiles/gmssl-bin.dir/all] 错误 2
make: *** [Makefile:166:all] 错误 2

@Mike4Feet
Copy link
Author

编译的系统为 centos7
gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)

@Mike4Feet
Copy link
Author

更新了sm4_ecb.c,支持ECB加密时填充:
之前的版本对ECB加密时,仅支持16字节的倍速,现在使用PKCS#7的方式进行填充

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant