Skip to content
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

Stsck mem optimization for sha256 hash generation #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mavlink_sha256.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ MAVLINK_HELPER void mavlink_sha256_init(mavlink_sha256_ctx *m)
static inline void mavlink_sha256_calc(mavlink_sha256_ctx *m, uint32_t *in)
{
uint32_t AA, BB, CC, DD, EE, FF, GG, HH;
uint32_t data[64];
thread_local uint32_t data[64];
int i;

AA = m->counter[0];
Expand Down Expand Up @@ -170,7 +170,7 @@ MAVLINK_HELPER void mavlink_sha256_update(mavlink_sha256_ctx *m, const void *v,
len -= l;
if(offset == 64){
int i;
uint32_t current[16];
thread_local uint32_t current[16];
const uint32_t *u = m->u.save_u32;
for (i = 0; i < 16; i++){
const uint8_t *p1 = (const uint8_t *)&u[i];
Expand Down