[Cryptech-Commits] [core/platform/novena] 02/02: (1) Changed to using symbolic defines for core name and version. (2) Minor cleanup of defines in header file.

git at cryptech.is git at cryptech.is
Tue Apr 21 13:08:27 UTC 2015


This is an automated email from the git hooks/post-receive script.

joachim at secworks.se pushed a commit to branch master
in repository core/platform/novena.

commit 7bc543a279dca902bbbefedb66e5f639b82de635
Author: Joachim Strömbergson <joachim at secworks.se>
Date:   Tue Apr 21 15:08:16 2015 +0200

    (1) Changed to using symbolic defines for core name and version. (2) Minor cleanup of defines in header file.
---
 eim/sw/cryptech_memory_map.h | 20 +++++++++++++++++---
 eim/sw/trng_extractor_eim.c  | 12 ++++++------
 2 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/eim/sw/cryptech_memory_map.h b/eim/sw/cryptech_memory_map.h
index dd4dc36..1dea087 100644
--- a/eim/sw/cryptech_memory_map.h
+++ b/eim/sw/cryptech_memory_map.h
@@ -88,12 +88,11 @@
 #define NOVENA_BOARD_NAME1   "    ";
 #define NOVENA_BOARD_VERSION "0.10";
 
-#define EIM_INTERFACE_NAME0 "eim ";
-#define EIM_INTERFACE_NAME1 "    ";
+#define EIM_INTERFACE_NAME0   "eim ";
+#define EIM_INTERFACE_NAME1   "    ";
 #define EIM_INTERFACE_VERSION "0.10";
 
 
-
 //------------------------------------------------------------------
 // Hashes segment.
 //------------------------------------------------------------------
@@ -153,6 +152,18 @@
 #define MODE_SHA_384            2 << 2
 #define MODE_SHA_512            3 << 2
 
+#define SHA1_NAME0   "sha1"
+#define SHA1_NAME1   "    "
+#define SHA1_VERSION "0.50"
+
+#define SHA256_NAME0   "sha2";
+#define SHA256_NAME1   "-256";
+#define SHA256_VERSION "0.80";
+
+#define SHA512_NAME0   "sha2";
+#define SHA512_NAME1   "-512";
+#define SHA512_VERSION "0.80";
+
 
 // -----------------------------------------------------------------
 // TRNG segment.
@@ -221,6 +232,9 @@
 #define CSPRNG_ADDR_NBLOCKS_LO  CSPRNG_ADDR_BASE + ADDR(0x41)
 #define CSPRNG_ADDR_NBLOCKS_HI  CSPRNG_ADDR_BASE + ADDR(0x42)
 
+#define TRNG_NAME0   "trng";
+#define TRNG_NAME1   "    ";
+#define TRNG_VERSION "0.01";
 
 #define AVALANCHE_ENTROPY_NAME0   "extn"
 #define AVALANCHE_ENTROPY_NAME1   "oise"
diff --git a/eim/sw/trng_extractor_eim.c b/eim/sw/trng_extractor_eim.c
index 36e653e..330c153 100644
--- a/eim/sw/trng_extractor_eim.c
+++ b/eim/sw/trng_extractor_eim.c
@@ -59,9 +59,9 @@ int debug = 0;          /* for dump() */
 // Check availability of avalanche entropy core by reading core name and version.
 uint32_t avalanche_check(void)
 {
-    uint8_t name0[4]   = "extn";
-    uint8_t name1[4]   = "oise";
-    uint8_t version[4] = "0.10";
+    uint8_t name0[4]   = AVALANCHE_ENTROPY_NAME0;
+    uint8_t name1[4]   = AVALANCHE_ENTROPY_NAME1;
+    uint8_t version[4] = AVALANCHE_ENTROPY_VERSION;
 
     printf("Reading name and version words from avalanche_entropy core.\n");
 
@@ -75,9 +75,9 @@ uint32_t avalanche_check(void)
 // check availability of rosc core by reading the core name and version.
 uint32_t rosc_check(void)
 {
-    uint8_t name0[4]   = "rosc";
-    uint8_t name1[4]   = " ent";
-    uint8_t version[4] = "0.10";
+    uint8_t name0[4]   = ROSC_ENTROPY_NAME0;
+    uint8_t name1[4]   = ROSC_ENTROPY_NAME1;
+    uint8_t version[4] = ROSC_ENTROPY_VERSION;
 
     printf("Reading name and version words from rosc_entropy core.\n");
 



More information about the Commits mailing list