Home > Backend Development > Golang > golang gmssl fails to compile

golang gmssl fails to compile

(*-*)浩
Release: 2019-12-16 15:37:28
Original
2865 people have browsed it

golang gmssl fails to compile

I have cross-compiled openssl-1.0.2k on ubuntu before and used the following script to implement it: #

./config --prefix=/opt/openssl --cross-compile-prefix=arm-linux-gnueabihf- no-asm shared
sed -i "s/ -m64//g" Makefile
make
make install
Copy after login
All development environments are controlled through svn, including the establishment process of library files, tools, etc. Therefore, after using config to generate the Makefile file, use a script to automatically delete the m64 option that is not supported by the arm compiler. After using the same method to compile gmssl, a runtime error occurs when generating the secret key on the device; openssl-1.1.1 preview version stops responding after compilation.

After much exploration, I finally found the reason: Configure should be used to configure the target platform! The new compilation script is as follows:

./Configure --prefix=/opt/openssl --cross-compile-prefix=arm-linux-gnueabihf- no-asm shared linux-armv4
make
make install
Copy after login

Because it is an arm device, the target platform is configured here as linux-armv4. The compilation method for other platforms is similar. Use ./Configure --help to display all supported platforms.

In addition, when specifying the arm platform, the unsupported m64 option will not appear in the Makefile, so there is no need to delete it.

After using the new compilation method, both gmssl and openssl-1.1.1 can work normally on arm devices.

GmSSL-Go is the Go language interface binding

of the GmSSL library.

Provides functions such as cryptographic algorithms, X.509 certificates, SSL protocols, and Engine for Go language applications.

GmSSL-Go uses CGO to encapsulate the high-level interface of GmSSL as a Go language component. It is a lightweight middle layer loosely coupled with the GmSSL library. All cryptographic functions are provided by the underlying GmSSL library provided.

Why use GmSSL-Go

Although the official library of Go language provides commonly used cryptographic algorithm packages and SSL protocol packages, there are also some third-party pure Go languages Cryptocurrency library, integrating GmSSL-Go in the project still has many irreplaceable advantages: GmSSL-Go provides complete and rich support for national encryption algorithms, certificates and SSL protocols through the underlying GmSSL library.

GmSSL-Go can provide system security, availability and password compliance through Engine objects that meet domestic hardware cryptographic devices such as U-shields and PCI-E encryption cards that meet national cryptographic standards.

GmSSL-Go uses the CGO method to call the cryptographic algorithm implementation of the GmSSL library. Compared with the pure Go language implementation, it has performance advantages in cryptographic algorithms. Please refer to the GmSSL Benchmark.

The functions and performance of GmSSL-Go have been continuously improved with the upgrade of GmSSL.

The above is the detailed content of golang gmssl fails to compile. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template