Files
GmSSL/doc/crypto/SM9_setup.pod
Gorachya 63f7b06b78 add-docs
2019-03-12 23:50:42 -07:00

80 lines
3.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
=pod
=encoding utf8
=head1 NAME
SM9_setup, SM9_generate_master_secret, SM9_extract_public_parameters,
SM9_extract_private_key, SM9_extract_public_key - SM9 Algorithm
=head1 SYNOPSIS
#include <openssl/sm9.h>
int SM9_setup(int pairing, int scheme, int hash1,
SM9PublicParameters **mpk, SM9MasterSecret **msk);
SM9MasterSecret *SM9_generate_master_secret(int pairing, int scheme, int hash1);
SM9PublicParameters *SM9_extract_public_parameters(SM9MasterSecret *msk);
SM9PrivateKey *SM9_extract_private_key(SM9MasterSecret *msk,
const char *id, size_t idlen);
SM9PublicKey *SM9_extract_public_key(SM9PublicParameters *mpk,
const char *id, size_t idlen);
=head1 DESCRIPTION
SM9_setup() calls SM9_generate_master_secret() and SM9_extract_public_parameters() to set up public parameters and master key for a later usage of SM9 system.
SM9_setup()通过调用SM9_generate_master_secret()和SM9_extract_public_parameters()来设置SM9系统的公共参数和主密钥以备之后使用。
SM9_generate_master_secret() generates a new B<SM9MasterSecret> structure and set its parameters including pairing type, helper functions, master secret value and master public point.
SM9_generate_master_secret()产生一个新的B<SM9MasterSecret>结构,并为它设置双线性对类型、主密钥等参数值。
SM9_extract_public_parameters() allocates an empty B<SM9PublicParameters> structure and copies some parameters from the given B<SM9MasterSecret> structure.
SM9_extract_public_parameters()分配一个空的B<SM9PublicParameters>结构并从给定的B<SM9MasterSecret>结构中拷贝部分变量值。
SM9_extract_private_key() and SM9_extract_public_key() both call SM9_MASTER_KEY_extract_key() (but using a different identifier) to generate public or private key for SM9.
SM9_extract_private_key()和SM9_extract_public_key()都调用SM9_MASTER_KEY_extract_key()生成一个B<SM9_KEY>结构,但通过一个标识位区别生成的是公钥还是私钥。
=head1 RETURN VALUES
SM9_setup() returns 1 on success or 0 on failure.
SM9_setup()如果执行成功则返回1失败返回0。
SM9_generate_master_secret() returns a pointer to an allocated B<SM9MasterSecret> structure or NULL on error.
SM9_generate_master_secret()返回一个指向已分配的B<SM9MasterSecret>结构的指针。如果发生错误则返回NULL。
SM9_extract_public_parameters() returns a pointer to an allocated B<SM9PublicParameters> structure or NULL on error.
SM9_extract_public_parameters()返回一个指向已分配的B<SM9PublicParameters>结构的指针。如果发生错误则返回NULL。
SM9_extract_private_key() and SM9_extract_public_key() return a pointer to an allocated B<SM9_KEY> structure or NULL on error.
SM9_extract_private_key()和SM9_extract_public_key()返回一个指向已分配的B<SM9_KEY>结构的指针。如果发生错误则返回NULL。
=head1 CONFORMING TO
GM/T 0044-2016 SM9 Identification Cryptographic Algorithm
=head1 SEE ALSO
L<EVP_DigestInit(3)>
=head1 COPYRIGHT
Copyright 2014-2019 The GmSSL Project. All Rights Reserved.
Licensed under the GmSSL license (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<http://gmssl.org/license.html>.
=cut