cantora / avr-crypto-lib Goto Github PK
View Code? Open in Web Editor NEWmirror of avr-crypto-lib (http://code.nerilex.org/bg/avr-crypto-lib.git)
Home Page: http://www.das-labor.org/wiki/AVR-Crypto-Lib/en
License: GNU General Public License v2.0
mirror of avr-crypto-lib (http://code.nerilex.org/bg/avr-crypto-lib.git)
Home Page: http://www.das-labor.org/wiki/AVR-Crypto-Lib/en
License: GNU General Public License v2.0
I am trying to use the hmac sha256 in an Arduino project, but I have an issue, where if there are zeros in the hash value, the first zero gets omitted, resulting in a hash length of only 63 bytes. Otherwise the values correspond with online calculators. Has anyone encountered this issue? Any solutions?
Not sure if this makes a difference, but I am including the header with
extern "C"{ #include "hmac-sha256.h" };
because I am compiling with the Arduino IDE (C++).
edit. so for example if I try to hash "hello" with the key "key" I get
937B3B915EFB5171FF14D8CB55FBCC798C6C0EF1456D66DED1A6AA723A58B7B
instead of
9307b3b915efb5171ff14d8cb55fbcc798c6c0ef1456d66ded1a6aa723a58b7b
Hello.
I am using the library in a somewhat unconventional way. Note that I have not tried compiling with the stock Makefile utils that come bundled with the library. Basically I only need a few of the crypto methods, so I am extracting these couple of directories into my source, and compiling them with my project's own standalone Makefile.
This seems to work well, with the exception of a caveat I just ran into trying to compile this way: In the des/des.*{c,h}
files, there is a discrepancy in a few of the functions with the way the key buffers are typed: sometimes it's void *key
, others it's uint8_t *key
. This caused avr-gcc
to issue me an error, so I thought to pass it on to the developers.
Overall, the library seems to be very neatly coded and minimal enough that other crypto overhead can be built on top of it. Thanks.
Just tried the BIG_ENDIAN option in sha256.c (though I'm not sure why anyone would use it... it's there...), and suggest the following modifications:
line 197: *((uint64_t *)&(lb[56])) = state->length;
line 213: if ((void *) dest != (void *) &(state->h))
Hi!
Nice to see that AES-256 is working on AVR also. I want to implement AES-256 CBC technique for my application. So does it contain that implementation?
Can you please provide an example of these?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.