Changeset 94082 in vbox for trunk/src/libs/openssl-3.0.1/include/crypto/sm2.h
- Timestamp:
- Mar 3, 2022 7:17:34 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 150325
- Location:
- trunk/src/libs/openssl-3.0.1
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/openssl-3.0.1
- Property svn:mergeinfo
-
old new 12 12 /vendor/openssl/1.1.1c:131722-131725 13 13 /vendor/openssl/1.1.1k:145841-145843 14 /vendor/openssl/3.0.1:150323-150324 15 /vendor/openssl/current:147554-150322
-
- Property svn:mergeinfo
-
trunk/src/libs/openssl-3.0.1/include/crypto/sm2.h
r91772 r94082 4 4 * Ported from Ribose contributions from Botan. 5 5 * 6 * Licensed under the OpenSSL license(the "License"). You may not use6 * Licensed under the Apache License 2.0 (the "License"). You may not use 7 7 * this file except in compliance with the License. You can obtain a copy 8 8 * in the file LICENSE in the source distribution or at … … 12 12 #ifndef OSSL_CRYPTO_SM2_H 13 13 # define OSSL_CRYPTO_SM2_H 14 # pragma once 15 14 16 # include <openssl/opensslconf.h> 15 17 16 # if ndef OPENSSL_NO_SM218 # if !defined(OPENSSL_NO_SM2) && !defined(FIPS_MODULE) 17 19 18 20 # include <openssl/ec.h> 21 # include "crypto/types.h" 22 23 int ossl_sm2_key_private_check(const EC_KEY *eckey); 19 24 20 25 /* The default user id as specified in GM/T 0009-2012 */ 21 26 # define SM2_DEFAULT_USERID "1234567812345678" 22 27 23 int sm2_compute_z_digest(uint8_t *out,24 const EVP_MD *digest,25 const uint8_t *id,26 const size_t id_len,27 const EC_KEY *key);28 int ossl_sm2_compute_z_digest(uint8_t *out, 29 const EVP_MD *digest, 30 const uint8_t *id, 31 const size_t id_len, 32 const EC_KEY *key); 28 33 29 34 /* 30 35 * SM2 signature operation. Computes Z and then signs H(Z || msg) using SM2 31 36 */ 32 ECDSA_SIG *sm2_do_sign(const EC_KEY *key, 37 ECDSA_SIG *ossl_sm2_do_sign(const EC_KEY *key, 38 const EVP_MD *digest, 39 const uint8_t *id, 40 const size_t id_len, 41 const uint8_t *msg, size_t msg_len); 42 43 int ossl_sm2_do_verify(const EC_KEY *key, 33 44 const EVP_MD *digest, 45 const ECDSA_SIG *signature, 34 46 const uint8_t *id, 35 47 const size_t id_len, 36 48 const uint8_t *msg, size_t msg_len); 37 49 38 int sm2_do_verify(const EC_KEY *key,39 const EVP_MD *digest,40 const ECDSA_SIG *signature,41 const uint8_t *id,42 const size_t id_len,43 const uint8_t *msg, size_t msg_len);44 45 50 /* 46 51 * SM2 signature generation. 47 52 */ 48 int sm2_sign(const unsigned char *dgst, int dgstlen, 49 unsigned char *sig, unsigned int *siglen, EC_KEY *eckey); 53 int ossl_sm2_internal_sign(const unsigned char *dgst, int dgstlen, 54 unsigned char *sig, unsigned int *siglen, 55 EC_KEY *eckey); 50 56 51 57 /* 52 58 * SM2 signature verification. 53 59 */ 54 int sm2_verify(const unsigned char *dgst, int dgstlen, 55 const unsigned char *sig, int siglen, EC_KEY *eckey); 60 int ossl_sm2_internal_verify(const unsigned char *dgst, int dgstlen, 61 const unsigned char *sig, int siglen, 62 EC_KEY *eckey); 56 63 57 64 /* 58 65 * SM2 encryption 59 66 */ 60 int sm2_ciphertext_size(const EC_KEY *key, const EVP_MD *digest, size_t msg_len,61 size_t *ct_size);67 int ossl_sm2_ciphertext_size(const EC_KEY *key, const EVP_MD *digest, 68 size_t msg_len, size_t *ct_size); 62 69 63 int sm2_plaintext_size(const unsigned char *ct, size_t ct_size, size_t *pt_size); 70 int ossl_sm2_plaintext_size(const unsigned char *ct, size_t ct_size, 71 size_t *pt_size); 64 72 65 int sm2_encrypt(const EC_KEY *key, 66 const EVP_MD *digest, 67 const uint8_t *msg, 68 size_t msg_len, 69 uint8_t *ciphertext_buf, size_t *ciphertext_len); 73 int ossl_sm2_encrypt(const EC_KEY *key, 74 const EVP_MD *digest, 75 const uint8_t *msg, size_t msg_len, 76 uint8_t *ciphertext_buf, size_t *ciphertext_len); 70 77 71 int sm2_decrypt(const EC_KEY *key,72 const EVP_MD *digest,73 const uint8_t *ciphertext,74 size_t ciphertext_len,uint8_t *ptext_buf, size_t *ptext_len);78 int ossl_sm2_decrypt(const EC_KEY *key, 79 const EVP_MD *digest, 80 const uint8_t *ciphertext, size_t ciphertext_len, 81 uint8_t *ptext_buf, size_t *ptext_len); 75 82 83 const unsigned char *ossl_sm2_algorithmidentifier_encoding(int md_nid, 84 size_t *len); 76 85 # endif /* OPENSSL_NO_SM2 */ 77 86 #endif
Note:
See TracChangeset
for help on using the changeset viewer.