You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2021/02/19 09:57:20 UTC

[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2492: hw: drivers: hash: fix Mbed TLS md interface usage

apache-mynewt-bot commented on pull request #2492:
URL: https://github.com/apache/mynewt-core/pull/2492#issuecomment-781968182


   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### hw/drivers/hash/include/hash/sha256_alt.h
   <details>
   
   ```diff
   @@ -38,23 +38,23 @@
    void mbedtls_sha256_init(mbedtls_sha256_context *ctx);
    void mbedtls_sha256_free(mbedtls_sha256_context *ctx);
    void mbedtls_sha256_clone(mbedtls_sha256_context *dst,
   -        const mbedtls_sha256_context *src);
   +                          const mbedtls_sha256_context *src);
    int mbedtls_sha256_starts_ret(mbedtls_sha256_context *ctx, int is224);
    int mbedtls_sha256_update_ret(mbedtls_sha256_context *ctx,
   -        const unsigned char *input, size_t ilen);
   +                              const unsigned char *input, size_t ilen);
    int mbedtls_sha256_finish_ret(mbedtls_sha256_context *ctx,
   -        unsigned char output[32]);
   +                              unsigned char output[32]);
    int mbedtls_internal_sha256_process(mbedtls_sha256_context *ctx,
   -        const unsigned char data[64]);
   +                                    const unsigned char data[64]);
    
    /*
     * XXX deprecated functions
     */
    void mbedtls_sha256_starts(mbedtls_sha256_context *ctx, int is224);
    void mbedtls_sha256_update(mbedtls_sha256_context *ctx,
   -        const unsigned char *input, size_t ilen);
   +                           const unsigned char *input, size_t ilen);
    void mbedtls_sha256_finish(mbedtls_sha256_context *ctx,
   -        unsigned char output[32]);
   +                           unsigned char output[32]);
    
    #ifdef __cplusplus
    }
   ```
   
   </details>
   
   #### hw/drivers/hash/src/mbedtls_sha256_alt.c
   <details>
   
   ```diff
   @@ -83,20 +85,23 @@
        (void)hash_sha256_start(&ctx->sha256ctx, ctx->hash);
    }
    
   -void mbedtls_sha256_update(mbedtls_sha256_context *ctx,
   -        const unsigned char *input, size_t ilen)
   +void
   +mbedtls_sha256_update(mbedtls_sha256_context *ctx,
   +                      const unsigned char *input, size_t ilen)
    {
        (void)hash_sha256_update(&ctx->sha256ctx, input, ilen);
    }
    
   -void mbedtls_sha256_finish(mbedtls_sha256_context *ctx,
   -        unsigned char output[32])
   +void
   +mbedtls_sha256_finish(mbedtls_sha256_context *ctx,
   +                      unsigned char output[32])
    {
        (void)hash_sha256_finish(&ctx->sha256ctx, output);
    }
    
   -int mbedtls_internal_sha256_process(mbedtls_sha256_context *ctx,
   -        const unsigned char data[64])
   +int
   +mbedtls_internal_sha256_process(mbedtls_sha256_context *ctx,
   +                                const unsigned char data[64])
    {
        /*
         * Note: This function is only called by SHA-224 functions, only
   ```
   
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org