mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
cryptolib: put constant arrays in rodata segment
The SHA256 constants and some algo definitions are currently in the .data segment, this wastes precious RAM on the EC where read-only data are stored in flash only. BUG=chrome-os-partner:12271 TEST=sudo emerge vboot_reference && emerge-daisy vboot_reference vboot_reference-firmware chromeos-ec and manually check the content of the .data segment in the EC binary. Change-Id: I67b8c0f2843312651e8ac287cea2f8cb5f075453 Reviewed-on: https://gerrit.chromium.org/gerrit/29273 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
@@ -143,7 +143,7 @@ RSA8192NUMBYTES,
|
||||
RSA8192NUMBYTES,
|
||||
};
|
||||
|
||||
const uint8_t* padding_map[NUMALGORITHMS] = {
|
||||
const uint8_t* const padding_map[NUMALGORITHMS] = {
|
||||
#ifdef CHROMEOS_EC
|
||||
0,
|
||||
0,
|
||||
@@ -233,7 +233,7 @@ SHA256_BLOCK_SIZE,
|
||||
SHA512_BLOCK_SIZE,
|
||||
};
|
||||
|
||||
const uint8_t* hash_digestinfo_map[NUMALGORITHMS] = {
|
||||
const uint8_t* const hash_digestinfo_map[NUMALGORITHMS] = {
|
||||
SHA1_digestinfo,
|
||||
SHA256_digestinfo,
|
||||
SHA512_digestinfo,
|
||||
@@ -248,7 +248,7 @@ SHA256_digestinfo,
|
||||
SHA512_digestinfo,
|
||||
};
|
||||
|
||||
const char* algo_strings[NUMALGORITHMS] = {
|
||||
const char* const algo_strings[NUMALGORITHMS] = {
|
||||
"RSA1024 SHA1",
|
||||
"RSA1024 SHA256",
|
||||
"RSA1024 SHA512",
|
||||
|
||||
Reference in New Issue
Block a user