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 2020/02/21 07:36:28 UTC

[GitHub] [mynewt-core] kasjer commented on a change in pull request #2184: WIP DONOT MERGE: crypto/mbedtls: Enable AES and SECP256R1

kasjer commented on a change in pull request #2184: WIP DONOT MERGE: crypto/mbedtls: Enable AES and SECP256R1
URL: https://github.com/apache/mynewt-core/pull/2184#discussion_r382427853
 
 

 ##########
 File path: hw/drivers/trng/trng_da1469x/src/trng_da1469x.c
 ##########
 @@ -105,3 +106,20 @@ da1469x_trng_init(struct os_dev *dev, void *arg)
 
     return 0;
 }
+
+#ifdef MBEDTLS_ENTROPY_HARDWARE_ALT
+int
+mbedtls_hardware_poll( void *data, unsigned char *output, size_t len, size_t *olen ) {
+    struct trng_dev *trng;
+
+    trng = (struct trng_dev *)os_dev_lookup("trng");
+    da1469x_trng_init((struct os_dev *)trng, NULL);
+    int ret = da1469x_trng_read(trng, output, len);
+    if ( ret == len )
+        *olen = len;
+    else
+        olen = NULL;
 
 Review comment:
   olen = NULL dose not make sense here

----------------------------------------------------------------
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


With regards,
Apache Git Services