Skip to content

allow hash or mac on large buffers with less memory use #9758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

NirSonnenschein
Copy link
Contributor

Description

Previously a buffer the size of whole input was allocated for hash or MAC operations which is inefficient. This change allows the use of a fixed size buffer for large inputs to process the input
in multiple smaller pieces.

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[x] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@avolinski @itayzafrir

Release Notes

description: Hash and mac operations are now processed in secure partition in multiple chunks internally leading to decrease in memory use for large buffers.
effect analysis: This change has no impact on API and should not alter behavior from the user perspective.
Migration: not action should be required from the user side.

…ation

use a fixed size buffer for large inputs to process the input
in multiple smaller pieces.
@ciarmcom ciarmcom requested review from alekshex, itayzafrir and a team February 19, 2019 18:00
@ciarmcom
Copy link
Member

@NirSonnenschein, thank you for your changes.
@avolinski @itayzafrir @ARMmbed/mbed-os-maintainers please review.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 20, 2019

Needs coding style update (review Travis astyle job)

@@ -28,6 +33,12 @@ typedef struct psa_spm_hash_clone_s {
// ---------------------------------- Globals ----------------------------------
static int psa_spm_init_refence_counter = 0;

/* maximal memoty allocation for reading large hash ort mac input buffers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memoty -> memory ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, good catch : fixed.

Copy link
Contributor

@itayzafrir itayzafrir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 25, 2019

Ci started

@mbed-ci
Copy link

mbed-ci commented Feb 25, 2019

Test run: SUCCESS

Summary: 12 of 12 test jobs passed
Build number : 1
Build artifacts

@cmonr cmonr merged commit ed350dc into ARMmbed:master Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants