This commit is contained in:
Gorachya
2019-03-12 23:50:42 -07:00
parent 1d0b3aeea8
commit 63f7b06b78
3 changed files with 69 additions and 18 deletions

View File

@@ -25,9 +25,39 @@ SM9_extract_private_key, SM9_extract_public_key - SM9 Algorithm
=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