mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-06-29 09:13:38 +08:00
fast SMS4 with Intel AVX2/KNC-NI
This commit is contained in:
32
demos/gmssl/pem.c
Normal file
32
demos/gmssl/pem.c
Normal file
@@ -0,0 +1,32 @@
|
||||
#include <stdio.h>
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/ec.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
BIO *in = BIO_new_fp(stdin, BIO_NOCLOSE);
|
||||
EC_GROUP *group = NULL;
|
||||
EC_KEY *ec_key = NULL;
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
|
||||
|
||||
group = PEM_read_bio_SM2PKParameters(in, NULL, NULL, NULL);
|
||||
if (!group) {
|
||||
ERR_print_errors_fp(stderr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!EC_GROUP_check(group, NULL)) {
|
||||
ERR_print_errors_fp(stderr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
ec_key = EC_KEY_new();
|
||||
EC_KEY_set_group(ec_key, group);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user