From 2aedbdd01911a42565cd6d154f82fa00a66410cd Mon Sep 17 00:00:00 2001 From: Weiwei Li Date: Fri, 1 Jul 2022 16:09:02 +0800 Subject: remove multi blank lines --- riscv/entropy_source.h | 1 - 1 file changed, 1 deletion(-) (limited to 'riscv/entropy_source.h') diff --git a/riscv/entropy_source.h b/riscv/entropy_source.h index 47823ff..184bec7 100644 --- a/riscv/entropy_source.h +++ b/riscv/entropy_source.h @@ -36,7 +36,6 @@ public: // to handle the side-effect of the changing seed value on a read. } - // // The format of seed is described in Section 4.1 of // the scalar cryptography specification. -- cgit v1.1 From 793ffe508a5b81ce27f1baf2c5afb0b58a4236c6 Mon Sep 17 00:00:00 2001 From: Weiwei Li Date: Sun, 31 Jul 2022 20:39:47 +0800 Subject: Fix code indentation in processor.cc, interactive.cc, debug_module.h/cc execute.cc, entropy_source.h and v_ext_macros.h --- riscv/entropy_source.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'riscv/entropy_source.h') diff --git a/riscv/entropy_source.h b/riscv/entropy_source.h index 184bec7..38645ae 100644 --- a/riscv/entropy_source.h +++ b/riscv/entropy_source.h @@ -51,25 +51,25 @@ public: if(return_status == OPST_ES16) { - // Add some sampled entropy into the low 16 bits - uint16_t entropy = this -> get_two_random_bytes(); - result |= entropy; + // Add some sampled entropy into the low 16 bits + uint16_t entropy = this -> get_two_random_bytes(); + result |= entropy; } else if(return_status == OPST_BIST) { - // Do nothing. + // Do nothing. } else if(return_status == OPST_WAIT) { - // Do nothing. + // Do nothing. } else if(return_status == OPST_DEAD) { - // Do nothing. Stay dead. + // Do nothing. Stay dead. } else { - // Unreachable. + // Unreachable. } @@ -92,25 +92,25 @@ public: // Read two random bytes from the entropy source file. uint16_t get_two_random_bytes() { - std::ifstream fh(this -> randomness_source, std::ios::binary); + std::ifstream fh(this -> randomness_source, std::ios::binary); - if(fh.is_open()) { + if(fh.is_open()) { - uint16_t random_bytes; + uint16_t random_bytes; - fh.read((char*)(&random_bytes), 2); + fh.read((char*)(&random_bytes), 2); - fh.close(); + fh.close(); - return random_bytes; + return random_bytes; - } else { + } else { - fprintf(stderr, "Could not open randomness source file:\n\t"); - fprintf(stderr, "%s", randomness_source.c_str()); - abort(); + fprintf(stderr, "Could not open randomness source file:\n\t"); + fprintf(stderr, "%s", randomness_source.c_str()); + abort(); - } + } } -- cgit v1.1 From ce34edb0eecec520d6d2cfec5bda57ca90a69f14 Mon Sep 17 00:00:00 2001 From: Weiwei Li Date: Wed, 10 Aug 2022 22:55:07 +0800 Subject: Add space between if/while/switch and '(' Add space between ')' and '{' --- riscv/entropy_source.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'riscv/entropy_source.h') diff --git a/riscv/entropy_source.h b/riscv/entropy_source.h index 38645ae..c2ee2c4 100644 --- a/riscv/entropy_source.h +++ b/riscv/entropy_source.h @@ -49,21 +49,21 @@ public: // the bare minimum. uint32_t return_status = OPST_ES16; - if(return_status == OPST_ES16) { + if (return_status == OPST_ES16) { // Add some sampled entropy into the low 16 bits uint16_t entropy = this -> get_two_random_bytes(); result |= entropy; - } else if(return_status == OPST_BIST) { + } else if (return_status == OPST_BIST) { // Do nothing. - } else if(return_status == OPST_WAIT) { + } else if (return_status == OPST_WAIT) { // Do nothing. - } else if(return_status == OPST_DEAD) { + } else if (return_status == OPST_DEAD) { // Do nothing. Stay dead. @@ -94,7 +94,7 @@ public: std::ifstream fh(this -> randomness_source, std::ios::binary); - if(fh.is_open()) { + if (fh.is_open()) { uint16_t random_bytes; -- cgit v1.1 From ce69fb5db97ecf240336b7826dd9dddeb32e5dca Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Thu, 22 Sep 2022 17:34:33 -0700 Subject: Suppress most unused variable warnings --- riscv/entropy_source.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'riscv/entropy_source.h') diff --git a/riscv/entropy_source.h b/riscv/entropy_source.h index c2ee2c4..3a3c8e6 100644 --- a/riscv/entropy_source.h +++ b/riscv/entropy_source.h @@ -3,6 +3,7 @@ #include #include "internals.h" +#include "common.h" // // Used to model the cryptography extension entropy source. @@ -30,7 +31,7 @@ public: // seed register // ------------------------------------------------------------ - void set_seed(reg_t val) { + void set_seed(reg_t UNUSED val) { // Always ignore writes to seed. // This CSR is strictly read only. It occupies a RW CSR address // to handle the side-effect of the changing seed value on a read. -- cgit v1.1