commit | 2d6bfd7c0db20c004e83fe41869abf1020aa5458 | [log] [tgz] |
---|---|---|
author | Philipp Wagner <phw@lowrisc.org> | Thu Jun 17 17:52:06 2021 +0100 |
committer | Philipp Wagner <mail@philipp-wagner.com> | Fri Jun 18 20:24:47 2021 +0100 |
tree | 7b67114dd56d946e88fb23965b109e0b1452b1ee | |
parent | 930dbd32a91d0dff8e1c61857880063cf405387f [diff] |
[silicon_creator] Initialize argument when passing it to sigverify_mod_exp_ibex() In unit tests, the `sig` argument isn't initialized when passed on; fix fix that. Triggered by the following GCC 11 warning: ``` In file included from ../sw/vendor/google_googletest/googletest/include/gtest/gtest.h:376, from ../sw/vendor/google_googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:47, from ../sw/vendor/google_googletest/googlemock/include/gmock/gmock-actions.h:144, from ../sw/vendor/google_googletest/googlemock/include/gmock/gmock.h:59, from ../sw/device/silicon_creator/mask_rom/rsa_verify_unittest.cc:9: ../sw/device/silicon_creator/mask_rom/rsa_verify_unittest.cc: In member function ‘virtual void rsa_verify_unittest::{anonymous}::ModExp_BadExp_Test::TestBody()’: ../sw/device/silicon_creator/mask_rom/rsa_verify_unittest.cc:365:35: error: ‘empty’ may be used uninitialized [-Werror=maybe-uninitialized] 365 | EXPECT_EQ(sigverify_mod_exp_ibex(&bad_key, &empty, &empty), false); | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ../sw/device/silicon_creator/mask_rom/rsa_verify_unittest.cc:5: /home/philipp/src/opentitan/sw/device/silicon_creator/mask_rom/rsa_verify.h:62:6: note: by argument 2 of type ‘const sigverify_rsa_buffer_t*’ {aka ‘const sigverify_rsa_buffer*’} to ‘bool sigverify_mod_exp_ibex(const sigverify_rsa_key_t*, const sigverify_rsa_buffer_t*, sigverify_rsa_buffer_t*)’ declared here 62 | bool sigverify_mod_exp_ibex(const sigverify_rsa_key_t *key, | ^~~~~~~~~~~~~~~~~~~~~~ ../sw/device/silicon_creator/mask_rom/rsa_verify_unittest.cc:363:26: note: ‘empty’ declared here 363 | sigverify_rsa_buffer_t empty; | ^~~~~ ``` Signed-off-by: Philipp Wagner <phw@lowrisc.org>
OpenTitan is an open source silicon Root of Trust (RoT) project. OpenTitan will make the silicon RoT design and implementation more transparent, trustworthy, and secure for enterprises, platform providers, and chip manufacturers. OpenTitan is administered by lowRISC CIC as a collaborative project to produce high quality, open IP for instantiation as a full-featured product. See the OpenTitan site and OpenTitan docs for more information about the project.
This repository contains hardware, software and utilities written as part of the OpenTitan project. It is structured as monolithic repository, or “monorepo”, where all components live in one repository. It exists to enable collaboration across partners participating in the OpenTitan project.
The project contains comprehensive documentation of all IPs and tools. You can access it online at docs.opentitan.org.
Have a look at CONTRIBUTING and our documentation on project organization and processes for guidelines on how to contribute code to this repository.
Unless otherwise noted, everything in this repository is covered by the Apache License, Version 2.0 (see LICENSE for full text).