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 2021/06/15 13:29:45 UTC

[GitHub] [incubator-nuttx] saramonteiro commented on a change in pull request #3882: risc-v/esp32c3: Support ESP32-C3 SHA accelerator

saramonteiro commented on a change in pull request #3882:
URL: https://github.com/apache/incubator-nuttx/pull/3882#discussion_r651791715



##########
File path: arch/risc-v/src/esp32c3/esp32c3_sha.h
##########
@@ -0,0 +1,127 @@
+/****************************************************************************
+ * arch/risc-v/src/esp32c3/esp32c3_sha.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#ifndef __ARCH_RISCV_SRC_ESP32C3_ESP32C3_SHA_H
+#define __ARCH_RISCV_SRC_ESP32C3_ESP32C3_SHA_H
+
+#include <nuttx/config.h>
+#include <stdint.h>
+
+#ifndef __ASSEMBLY__
+
+#undef EXTERN
+#if defined(__cplusplus)
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+enum esp32c3_sha_type_e
+{
+    ESP32C3_SHA1_1 = 0,
+    ESP32C3_SHA2_224,
+    ESP32C3_SHA2_256,
+    ESP32C3_SHA3_384,
+    ESP32C3_SHA3_512,
+    ESP32C3_SHA_TYPE_MAX
+};
+
+enum esp32c3_sha_state_e
+{
+    ESP32C3_SHA_STATE_INIT,
+    ESP32C3_SHA_STATE_IN_PROCESS
+};
+
+/**
+ * \brief          SHA-1 context structure

Review comment:
       Fix comment.
   Adjust to one line comment.




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