summaryrefslogtreecommitdiff
path: root/chip/host/trng.c
Commit message (Collapse)AuthorAgeFilesLines
* common: move chip agnostic trng code from stm32 to commonDavid Cross2023-05-121-0/+5
| | | | | | | | | | | | | | | | | | | | | Making this change causes common trng functions to move memory locations. This change only affects fingerprint (FPMCU) boards BUG=b:280889889 TEST=make BOARD=bloonchipper, CONFIG_CMD_RAND enabled in board.h ALLOW_CONFIG=1 ./util/compare_build.sh -b all => All boards match, except the following Fingerprint boards: bloonchipper dartmonkey hatch_fp nami_fp nocturne_fp nucleo-dartmonkey Change-Id: I4dbb5e255be0f61eb7b446af4565bea487c08e52 Signed-off-by: David Cross <davidmcross@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4507892 Reviewed-by: Bobby Casey <bobbycasey@google.com>
* chip: Sort header filesJeremy Bettis2022-11-291-2/+2
| | | | | | | | | | | | | | | | | | | | Sort all includes in chip with the clang-format rules used by the zephyr project. BRANCH=None BUG=b:247100970 TEST=zmake build -a TEST=./twister --clobber -v -i TEST=make -j72 buildall_only runtests TEST=zmake compare-builds -a Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I13454e38fa3766aa0ba26a058075f51965b8462e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4053346 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* Update license boilerplate text in source code filesMike Frysinger2022-09-121-1/+1
| | | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* trng: Rename rand to trng_randTom Hughes2022-07-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | The declaration for rand conflicts with the standard library declaration so rename it from "rand" to "trng_rand". This has the benefit of making it obvious when we're using the true random number generator. For consistency, this also renames init_trng/exit_trng to trng_init/trng_exit. This is a reland of commit a6b0b3554f59cc9b0c4aae9bff7dff075f2089a9. BRANCH=none BUG=b:234181908, b:237344361 TEST=./util/compare_build.sh -b all -j 120 => MATCH TEST=emerge-hatch ec-utils-test Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ic26890572cb9865275c866b65b0532c5ab029865 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3738978 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Bobby Casey <bobbycasey@google.com>
* chip/host/trng.c: Format with clang-formatJack Rosenthal2022-06-301-1/+1
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Ic32b80e3807336a9d293824bfa7977680e181423 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729169 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* Revert "trng: Rename rand to trng_rand"Pin-yen Lin2022-06-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a6b0b3554f59cc9b0c4aae9bff7dff075f2089a9. Reason for revert: This CL breaks ec-utils-test package and affects CQ Original change's description: > trng: Rename rand to trng_rand > > The declaration for rand conflicts with the standard library declaration > so rename it from "rand" to "trng_rand". This has the benefit of making > it obvious when we're using the true random number generator. > > For consistency, this also renames init_trng/exit_trng to > trng_init/trng_exit. > > BRANCH=none > BUG=b:234181908 > TEST=./util/compare_build.sh -b all -j 120 > => MATCH > > Signed-off-by: Tom Hughes <tomhughes@chromium.org> > Change-Id: Ic3305a91263c45786c051eaa5b3689e7464aa0ab > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3712032 > Reviewed-by: Bobby Casey <bobbycasey@google.com> > Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Bug: b:234181908,b:237344361 Change-Id: Iceae55ad9ff0e6aa98aebd474f92a98e12c287e2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3726597 Tested-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Pin-yen Lin <treapking@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Owners-Override: Pin-yen Lin <treapking@chromium.org> Commit-Queue: Pin-yen Lin <treapking@chromium.org> Tested-by: Pin-yen Lin <treapking@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
* trng: Rename rand to trng_randTom Hughes2022-06-281-3/+3
| | | | | | | | | | | | | | | | | | | | The declaration for rand conflicts with the standard library declaration so rename it from "rand" to "trng_rand". This has the benefit of making it obvious when we're using the true random number generator. For consistency, this also renames init_trng/exit_trng to trng_init/trng_exit. BRANCH=none BUG=b:234181908 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ic3305a91263c45786c051eaa5b3689e7464aa0ab Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3712032 Reviewed-by: Bobby Casey <bobbycasey@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* ec: change usage of dummySam Hurst2020-08-051-1/+1
| | | | | | | | | | | | | | | | | | Google is working to change its source code to use more inclusive language. To that end, replace the term "dummy" with inclusive alternatives. BUG=b:162781382 BRANCH=None TEST=make -j buildall `grep -ir dummy *` The only results are in "private/nordic_keyboard/sdk8.0.0" which is not our code. Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I6a42183d998e4db4bb61625f962867fda10722e2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2335737 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* chip/host: Add check for TEST_BUILD in trng.cCraig Hesling2019-07-271-0/+4
| | | | | | | | | | | | | | | | | | | Due to the possibly unnoticeable security vulnerability it would cause if the dummy host trng driver made it's way into production (non-test) code, this change adds a small check to ensure it is being used only in test or fuzz builds. This isn't as much of a concern for other dummy host drivers. For example, including a fake spi driver may simply manifest as broken feature. BRANCH=none BUG=none TEST=make buildall -j Change-Id: I31138976566d39ed44d905bbb2c43c5f6decbaf4 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1722182 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* chip/host: Add spi+trng support, and add gpio funcCraig Hesling2019-07-181-0/+36
This adds fake SPI Master and TRNG support to the host target. This change also adds the missing emulated gpio interface function. Although general purpose, these changes are setup for allowing fuzzing of the FPMCU specific host commands. Thus, they do not impact any outstanding code. BRANCH=none BUG=b:116065496 TEST=make buildall -j Change-Id: Icfc40e7bf8ee421a4c3ad15377fd56ae68c763d7 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1684223 Reviewed-by: Randall Spangler <rspangler@chromium.org>