You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/09/05 06:58:19 UTC

[GitHub] [incubator-nuttx] anjiahao1 opened a new pull request, #7003: libc:add timingsafe_bcmp to libc

anjiahao1 opened a new pull request, #7003:
URL: https://github.com/apache/incubator-nuttx/pull/7003

   Signed-off-by: anjiahao <an...@xiaomi.com>
   
   ## Summary
   add timingsafe_bcmp to libc
   ## Impact
   
   ## Testing
   CI
   


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

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #7003: libc:add timingsafe_bcmp to libc

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #7003:
URL: https://github.com/apache/incubator-nuttx/pull/7003


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

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7003: libc:add timingsafe_bcmp to libc

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7003:
URL: https://github.com/apache/incubator-nuttx/pull/7003#discussion_r962573013


##########
libs/libc/string/lib_timingsafe_bcmp.c:
##########
@@ -0,0 +1,43 @@
+/****************************************************************************
+ * libs/libc/string/lib_timingsafe_bcmp.c
+ * $OpenBSD: timingsafe_bcmp.c,v 1.3 2015/08/31 02:53:57 guenther Exp $
+ *
+ * Copyright (c) 2010 Damien Miller.  All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <string.h>
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+int timingsafe_bcmp(const void *b1, const void *b2, size_t n)
+{
+  const unsigned char *p1 = b1;

Review Comment:
   add FAR



##########
include/string.h:
##########
@@ -93,6 +93,7 @@ FAR void  *memmem(FAR const void *haystack, size_t haystacklen,
                   FAR const void *needle, size_t needlelen);
 
 void explicit_bzero(FAR void *s, size_t n);
+int timingsafe_bcmp(const void *b1, const void *b2, size_t n);

Review Comment:
   add FAR



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

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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