VirtualBox

Ignore:
Timestamp:
Mar 3, 2022 7:17:34 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
150325
Message:

libs/openssl-3.0.1: started applying and adjusting our OpenSSL changes to 3.0.1. bugref:10128

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  
        1212/vendor/openssl/1.1.1c:131722-131725
        1313/vendor/openssl/1.1.1k:145841-145843
         14/vendor/openssl/3.0.1:150323-150324
         15/vendor/openssl/current:147554-150322
  • trunk/src/libs/openssl-3.0.1/include/crypto/sm2.h

    r91772 r94082  
    44 * Ported from Ribose contributions from Botan.
    55 *
    6  * Licensed under the OpenSSL license (the "License").  You may not use
     6 * Licensed under the Apache License 2.0 (the "License").  You may not use
    77 * this file except in compliance with the License.  You can obtain a copy
    88 * in the file LICENSE in the source distribution or at
     
    1212#ifndef OSSL_CRYPTO_SM2_H
    1313# define OSSL_CRYPTO_SM2_H
     14# pragma once
     15
    1416# include <openssl/opensslconf.h>
    1517
    16 # ifndef OPENSSL_NO_SM2
     18# if !defined(OPENSSL_NO_SM2) && !defined(FIPS_MODULE)
    1719
    1820#  include <openssl/ec.h>
     21#  include "crypto/types.h"
     22
     23int ossl_sm2_key_private_check(const EC_KEY *eckey);
    1924
    2025/* The default user id as specified in GM/T 0009-2012 */
    2126#  define SM2_DEFAULT_USERID "1234567812345678"
    2227
    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);
     28int 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);
    2833
    2934/*
    3035 * SM2 signature operation. Computes Z and then signs H(Z || msg) using SM2
    3136 */
    32 ECDSA_SIG *sm2_do_sign(const EC_KEY *key,
     37ECDSA_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
     43int ossl_sm2_do_verify(const EC_KEY *key,
    3344                       const EVP_MD *digest,
     45                       const ECDSA_SIG *signature,
    3446                       const uint8_t *id,
    3547                       const size_t id_len,
    3648                       const uint8_t *msg, size_t msg_len);
    3749
    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 
    4550/*
    4651 * SM2 signature generation.
    4752 */
    48 int sm2_sign(const unsigned char *dgst, int dgstlen,
    49              unsigned char *sig, unsigned int *siglen, EC_KEY *eckey);
     53int ossl_sm2_internal_sign(const unsigned char *dgst, int dgstlen,
     54                           unsigned char *sig, unsigned int *siglen,
     55                           EC_KEY *eckey);
    5056
    5157/*
    5258 * SM2 signature verification.
    5359 */
    54 int sm2_verify(const unsigned char *dgst, int dgstlen,
    55                const unsigned char *sig, int siglen, EC_KEY *eckey);
     60int ossl_sm2_internal_verify(const unsigned char *dgst, int dgstlen,
     61                             const unsigned char *sig, int siglen,
     62                             EC_KEY *eckey);
    5663
    5764/*
    5865 * SM2 encryption
    5966 */
    60 int sm2_ciphertext_size(const EC_KEY *key, const EVP_MD *digest, size_t msg_len,
    61                         size_t *ct_size);
     67int ossl_sm2_ciphertext_size(const EC_KEY *key, const EVP_MD *digest,
     68                             size_t msg_len, size_t *ct_size);
    6269
    63 int sm2_plaintext_size(const unsigned char *ct, size_t ct_size, size_t *pt_size);
     70int ossl_sm2_plaintext_size(const unsigned char *ct, size_t ct_size,
     71                            size_t *pt_size);
    6472
    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);
     73int 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);
    7077
    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);
     78int 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);
    7582
     83const unsigned char *ossl_sm2_algorithmidentifier_encoding(int md_nid,
     84                                                           size_t *len);
    7685# endif /* OPENSSL_NO_SM2 */
    7786#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette