Skip to content

NUCLEO_F756ZG / mbedTLS_SHA1 hw acceleration #4158

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
merged 2 commits into from
Jul 31, 2017

Conversation

adustm
Copy link
Member

@adustm adustm commented Apr 11, 2017

Description

mbedtls_SHA1 hw acceleration for NUCLEO_F756ZG

Status

READY

Related PRs

Same as #3957 on another branch

This PR needs #3954 + #3947 to be merged first

Steps to test or reproduce

same as in #3947

@adustm
Copy link
Member Author

adustm commented Apr 11, 2017

@sg-

Copy link
Contributor

@RonEld RonEld left a comment

Choose a reason for hiding this comment

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

functionally, I believe it will work, however I would consider replacing the dynamically allocated buffer (ctx->sbuf) to a buffer in the context of size SHA1_BLOCK_SIZE (64) .Whenever it gets to 64, call HAL_HASH_SHA1_Accumulate with this buffer. amd another call to HAL_HASH_SHA1_Accumulate with the rest of the input. This will save memcpy to intermediate buffer, it will save memory fragmentation, so probably improve performance as well. (sometimes two calls to HAL_HASH_SHA1_Accumulate but I think it is faster then memcpy to buffer and memory fragmentation)



#define MBEDTLS_SHA1_C
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

@adustm I think it wasn't removed

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct, I missed this one because this branch is focusing on F7 family.

}
if (ctx->sbuf !=NULL) { // allocation occured
memcpy(ctx->sbuf, ptr, size);
ctx->flag = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

please rename flag to something more clear, such as sbuf_flag

Copy link
Member Author

Choose a reason for hiding this comment

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

not applicable with the new storing mechanism

@0xc0170
Copy link
Contributor

0xc0170 commented May 16, 2017

retest uvisor

@adustm adustm force-pushed the STM_sha1_f756zg branch from 97fc115 to 716dc76 Compare May 22, 2017 11:44
@adustm
Copy link
Member Author

adustm commented May 22, 2017

This branch is now aligned with the NUCLEO_F439ZI.

@gilles-peskine-arm
Copy link

Almost identical to PR #4157 so I won't comment on this one.

@andresag01
Copy link

This is equivalent to #4162 and I have already reviewed that PR.

@adustm
Copy link
Member Author

adustm commented Jun 12, 2017

Hello,
@0xc0170 do you know what is failing in the Cam-CI uvisor Build & Test script ?
Kind regards
Armelle

@sg- sg- requested a review from yanesca June 15, 2017 14:59
@adustm adustm force-pushed the STM_sha1_f756zg branch from 2cc502a to 38299b5 Compare June 16, 2017 09:33
@adustm adustm changed the base branch from mbed-os-workshop-17q2 to master June 16, 2017 09:35
@adustm
Copy link
Member Author

adustm commented Jun 16, 2017

Hello
Approvals are ok, rebase is done.
Kind regards

@adustm
Copy link
Member Author

adustm commented Jun 19, 2017

Hello, the scripts are still running after 3 days, I guess it should be executed again ?

Thanks in advance
Armelle

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 19, 2017

@adustm Yes, I noticed today as well, notified already CI owners to restart the jobs in another PR

cc @tommikas @miklis

@tommikas
Copy link
Contributor

@0xc0170 Only travis seems to be hanging in this one.

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 19, 2017

I restarted Travis, the job is https://travis-ci.org/ARMmbed/mbed-os/builds/243562660

Copy link
Contributor

@yanesca yanesca left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@adustm
Copy link
Member Author

adustm commented Jun 20, 2017

Hello @RonEld
Your review approval is missing here. Kind regards
Armelle

@adustm
Copy link
Member Author

adustm commented Jun 22, 2017

bump ?

@adbridge
Copy link
Contributor

@adustm sorry for the delays, our ci has been tied up with the 5.5.0 and 5.5.1 releases.

@adbridge
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 622

Example Build failed!

@adustm
Copy link
Member Author

adustm commented Jul 3, 2017

+-----------------------+---------------+------------------------+--------+--------------------+-------------+
| target                | platform_name | test suite             | result | elapsed_time (sec) | copy_method |
+-----------------------+---------------+------------------------+--------+--------------------+-------------+
| NUCLEO_F756ZG-GCC_ARM | NUCLEO_F756ZG | tests-mbedtls-multi    | OK     | 18.17              | shell       |
| NUCLEO_F756ZG-GCC_ARM | NUCLEO_F756ZG | tests-mbedtls-selftest | OK     | 29.2               | shell       |
| NUCLEO_F756ZG-IAR     | NUCLEO_F756ZG | tests-mbedtls-multi    | OK     | 19.56              | shell       |
| NUCLEO_F756ZG-IAR     | NUCLEO_F756ZG | tests-mbedtls-selftest | OK     | 30.5               | shell       |
| NUCLEO_F756ZG-ARM     | NUCLEO_F756ZG | tests-mbedtls-multi    | OK     | 18.58              | shell       |
| NUCLEO_F756ZG-ARM     | NUCLEO_F756ZG | tests-mbedtls-selftest | OK     | 29.85              | shell       |
+-----------------------+---------------+------------------------+--------+--------------------+-------------+

@adustm
Copy link
Member Author

adustm commented Jul 6, 2017

hello, I guess the next step is another morph test ?
Kind regards

@theotherjimmy
Copy link
Contributor

@adustm Yep

/morph test

@mbed-bot
Copy link

mbed-bot commented Jul 6, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 742

All builds and test passed!

@adustm
Copy link
Member Author

adustm commented Jul 7, 2017

Hello,
Happy to see the morph test pass at last !
Does anyone know how the morph test has been fixed ?
Kind regards

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 10, 2017

Does anyone know how the morph test has been fixed ?

We fixed few targets - real issues with timings mostly, and host tests improvements that exercise those time tests

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 13, 2017

@adustm Is there any dependency for this PR? Or ready to go?

@adustm adustm force-pushed the STM_sha1_f756zg branch from 55550e2 to 45dcf59 Compare July 25, 2017 09:24
@adustm
Copy link
Member Author

adustm commented Jul 25, 2017

Hello @0xc0170

I just rebased this PR on the master. It is ready to go.

Kind regards
Armelle

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 25, 2017

Thank you @adustm , we will retrigger the tests

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 25, 2017

/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 886

Example Build failed!

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 26, 2017

/morph test-nightly

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 897

All builds and test passed!

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.