summaryrefslogtreecommitdiff
path: root/extmod/crypto-algorithms
AgeCommit message (Collapse)Author
2021-07-12lib/crypto-algorithms: Move crypto-algorithms code from extmod to lib.Damien George
It's third-party code, and not necessarily tied to extmod. Signed-off-by: Damien George <damien@micropython.org>
2021-06-24all: Fix signed shifts and NULL access errors from -fsanitize=undefined.Jeff Epler
Fixes the following (the line numbers match commit 0e87459e2bfd07): ../../extmod/crypto-algorithms/sha256.c:49:19: runtime error: left shif... ../../extmod/moduasyncio.c:106:35: runtime error: member access within ... ../../py/binary.c:210:13: runtime error: left shift of negative value -... ../../py/mpz.c:744:16: runtime error: negation of -9223372036854775808 ... ../../py/objint.c:109:22: runtime error: left shift of 1 by 31 places c... ../../py/objint_mpz.c:374:9: runtime error: left shift of 4611686018427... ../../py/objint_mpz.c:374:9: runtime error: left shift of negative valu... ../../py/parsenum.c:106:14: runtime error: left shift of 46116860184273... ../../py/runtime.c:395:33: runtime error: left shift of negative value ... ../../py/showbc.c:177:28: runtime error: left shift of negative value -... ../../py/vm.c:321:36: runtime error: left shift of negative value -1``` Testing was done on an amd64 Debian Buster system using gcc-8.3 and these settings: CFLAGS += -g3 -Og -fsanitize=undefined LDFLAGS += -fsanitize=undefined The introduced TASK_PAIRHEAP macro's conditional (x ? &x->i : NULL) assembles (under amd64 gcc 8.3 -Os) to the same as &x->i, since i is the initial field of the struct. However, for the purposes of undefined behavior analysis the conditional is needed. Signed-off-by: Jeff Epler <jepler@gmail.com>
2019-08-22extmod/crypto-algorithms: Add source to header and populate copyright.Damien George
As per the README.md of the upstream source at https://github.com/B-Con/crypto-algorithms, this source code was released into the public domain, so make that explicit in the copyright line in the header.
2017-04-27extmod/crypto-algorithms/sha256: Remove non-standard memory.h header.Paul Sokolovsky
2015-12-20extmod/moduhashlib: Add namespace prefix for crypto-algorithms/sha256.h.Paul Sokolovsky
Everyone loves to names similar things the same, then there're conflicts between different libraries. The namespace prefix used is "CRYAL_", which is weird, and that's good, as that minimizes chance of another conflict.
2015-03-19extmod/crypto: Add static keyword where it should be.Damien George
2014-11-22moduhashlib: Add sha256 implementation from "crypto-algorithms" project.Paul Sokolovsky
https://github.com/B-Con/crypto-algorithms revision 100f4ff