VirtualBox

Ignore:
Timestamp:
Aug 5, 2020 8:49:27 PM (4 years ago)
Author:
vboxsync
Message:

IPRT: SHA-3 nits. bugref:9734

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/checksum/openssl-sha3.cpp

    r85618 r85623  
    2727#if 1 /* For now: */
    2828# include "alt-sha3.cpp"
     29
    2930#else
    3031
     
    3435*********************************************************************************************************************************/
    3536#include "internal/iprt.h"
     37#include <iprt/assert.h>
     38#include <iprt/err.h>
     39#include <iprt/string.h>
    3640
    3741#include "internal/openssl-pre.h"
    3842#include <openssl/evp.h>
    3943#include "internal/openssl-post.h"
    40 
    41 
    42 /* Internal EVP structure that we fake here to avoid lots of casting. */
    43 struct evp_md_ctx_st
    44 {
    45     void *apvWhatever[10];
    46 };
    47 
    48 /** The OpenSSL private context structure. */
    49 typedef struct RTSHA3PRIVATECTX
    50 {
    51     /** RTSHA3PRIVATECTX_MAGIC / RTSHA3PRIVATECTX_MAGIC_FINAL / RTSHA3PRIVATECTX_MAGIC_DEAD */
    52     uint64_t                u64Magic;
    53     /** The OpenSSL context.  We cheat to avoid EVP_MD_CTX_new/free. */
    54     struct evp_md_ctx_st    MdCtx;
    55 } RTSHA3PRIVATECTX;
    56 
    57 #define RT_SHA3_PRIVATE_CONTEXT
    58 #include <iprt/sha.h>
    59 AssertCompile(RT_SIZEOFMEMB(RTSHA3CONTEXT, abPadding) >= RT_SIZEOFMEMB(RTSHA3CONTEXT, Private));
    60 
    61 #include <iprt/assert.h>
    62 #include <iprt/err.h>
    63 #include <iprt/string.h>
    6444
    6545
     
    7050#define RTSHA3PRIVATECTX_MAGIC_FINAL    UINT64_C(0x40890fe0e474215d)
    7151#define RTSHA3PRIVATECTX_MAGIC_DEAD     UINT64_C(0xdead7a05081cbeef)
     52
     53
     54/*********************************************************************************************************************************
     55*   Structures and Typedefs                                                                                                      *
     56*********************************************************************************************************************************/
     57/* Internal EVP structure that we fake here to avoid lots of casting. */
     58struct evp_md_ctx_st
     59{
     60    void *apvWhatever[10];
     61};
     62
     63/** The OpenSSL private context structure. */
     64typedef struct RTSHA3PRIVATECTX
     65{
     66    /** RTSHA3PRIVATECTX_MAGIC / RTSHA3PRIVATECTX_MAGIC_FINAL / RTSHA3PRIVATECTX_MAGIC_DEAD */
     67    uint64_t                u64Magic;
     68    /** The OpenSSL context.  We cheat to avoid EVP_MD_CTX_new/free. */
     69    struct evp_md_ctx_st    MdCtx;
     70} RTSHA3PRIVATECTX;
     71
     72#define RT_SHA3_PRIVATE_CONTEXT
     73#include <iprt/sha.h>
     74AssertCompile(RT_SIZEOFMEMB(RTSHA3CONTEXT, abPadding) >= RT_SIZEOFMEMB(RTSHA3CONTEXT, Private));
     75
    7276
    7377
Note: See TracChangeset for help on using the changeset viewer.

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