Fabian Hüßler
a9295ae531
sys/crypto: CCM add const
2020-10-05 12:32:51 +02:00
Fabian Hüßler
83d391f6b1
sys/crypto: CBC and ECB add const
2020-10-05 12:32:51 +02:00
Francisco Molina
8372286591
sys/crypto/modes/ccm: accept input_len=0
...
CCM may be used on messages with no plaintext data.
2020-04-10 10:41:01 +02:00
08162f72b6
sys/crypto: update documentation
2020-03-06 19:49:58 +01:00
Gaëtan Harter
480a8bf076
crypto/ccm: fix plaintext_len write
...
plaintext_len should be written in MSB first order into bytes
[16-L..15] both included and not ]16-L..15].
[RFC3610: 2.2 Authentication]
2020-01-08 19:49:15 +01:00
Mathias Tausig
116240d721
crypto: Fix CCM mode when message size > 256
...
Fixes part of issue #8107
2020-01-07 23:31:35 +01:00
Francisco
4c4cb8a14f
Merge pull request #12362 from mtausig/ccm_aadlen
...
Fix CCM mode when length of AAD is > 24
2020-01-07 22:26:24 +01:00
Mathias Tausig
6fe6f8f6ca
sys/crypto: Allow CCM encryption with AAD of length > 24
...
Fixes parts of issue #8107
2020-01-07 21:25:48 +01:00
Mathias Tausig
f266275afb
sys/crypto: Make internal functions static
2020-01-07 21:23:13 +01:00
Mathias Tausig
3382a089a8
sys/crypto: Check block size for CCM operations
2020-01-07 21:22:09 +01:00
3475542650
sys/crypto: fix typos
2019-11-23 22:39:37 +01:00
Francois Berder
4a31f94cfc
many typo fixes
...
Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com>
2019-11-23 22:39:07 +01:00
607aa6fbcd
sys/crypto/ocb: fix max data condition
2019-11-22 19:21:06 +01:00
Mathias Tausig
89db40b563
sys/crypto: Fix code style
2019-10-08 20:58:52 +02:00
Mathias Tausig
66edeeb9c6
crypto: aes_init(): Fail correctly when called with bad key length
...
A proper error code is returned if a key with unsupported (either by the implementation or the AES algorithm) length is passed to aes_init.
This fixes Issue #10175
2019-08-07 11:02:16 +02:00
Mathias Tausig
0352c7406d
crypto: Fix code style
2019-08-07 11:02:16 +02:00
José Alamos
d16d911f42
Merge pull request #10120 from mtausig/ocb
...
Add OCB encryption mode
2019-04-23 11:08:30 +02:00
Mathias Tausig
aa611f6468
crypto: Implement OCB encryption mode
2019-04-23 10:34:32 +02:00
Kevin "Bear Puncher" Weiss
7dc243e3cc
Merge pull request #10220 from bergzand/pr/crypto/chacha20poly1305
...
chacha20poly1305: Initial implementation of AEAD cipher.
2019-02-04 12:52:24 +01:00
1990e1629a
crypto: Add chacha20poly1305 AEAD algorithm
2019-02-04 09:29:26 +01:00
e29adedfc5
sys/crypto/aes: avoid UB by explicit unsigned integer promotion
2019-01-21 14:01:22 +01:00
Kevin "Bear Puncher" Weiss
f05852290a
Merge pull request #9236 from bergzand/pr/crypto/poly1305
...
crypto: Poly1305 implementation
2018-12-03 14:31:28 +01:00
731ceda2f7
crypto/poly1305: Initial import
...
poly1305 implementation strongly based on
https://github.com/floodyberry/poly1305-donna
2018-12-03 09:31:09 +01:00
Juan I Carrano
77c9cc4041
Merge pull request #10219 from bergzand/pr/crypt/helper_add_wipe
...
crypto/helper: Add secure wipe function
2018-11-30 11:32:45 +01:00
Gaëtan Harter
c87fe94ec1
crypto/modes/ccm: update api to const input buffers
...
Input buffers are not modified, so can be declared const arguments.
2018-11-19 16:44:04 +01:00
Gaëtan Harter
9e6782afb4
crypto/modes/ccm: update internal functions to const input buffers
...
Input buffers are not modified, so can be declared const arguments.
This will allow using `const` inputs for `modes/ccm`.
Also say `iv` const even if not required for the api update, just because it is
the case.
2018-11-19 16:44:09 +01:00
Gaëtan Harter
9427371849
crypto/modes/ctr: update api to const input buffers
...
Input buffers are not modified, so can be declared const arguments.
This will allow using `const` inputs for `modes/ccm`.
2018-11-19 16:44:04 +01:00
Juan Carrano
3393dafe82
sys/crypto: configure AES via pseudomodules.
...
USEMODULE += crypto_aes_precalculated enables the precalculated T tables (the old
code).
USEMODULE += crypto_aes_unroll causes loops to be unrolled.
2018-11-15 18:25:26 +01:00
Oleg Artamonov
05fe168a1e
sys/crypto: optimize AES
2018-11-15 18:21:17 +01:00
Wentao Shang
3fd8276c37
crypto/ccm: fix auth_data_len upperbound value
...
RFC3610 states that len_encoding is only valid for "0x0001 ... 0xFEFF"
If 0 < l(a) < (2^16 - 2^8), then the length field is encoded as two
octets which contain the value l(a) in most-significant-byte first
order.
2018-11-12 16:38:45 +01:00
Gaëtan Harter
f0e785a430
crypto/ccm: check ccm_compute_adata_mac return value
...
Return value was ignored but function could fail
2018-11-12 16:37:00 +01:00
fa64817e61
crypto/helper: Add secure wipe function
...
Adds a cryptographically secure wipe function to wipe structs with
sensitive data. Works by first casting the pointer to a `volatile`
pointer to ensure that the compiler doesn't optimize the "memset" away.
2018-11-07 09:38:08 +01:00
ed23bdf25a
crypto/helper: Change equals arguments to const
2018-10-21 20:27:33 +02:00
7d013eb2b6
sys: fix doxygen grouping
2018-06-11 19:12:02 +02:00
Gaëtan Harter
fa33eacd1f
crypto/ccm: fix _fits_in_nbytes function
...
Function is broken with num_bytes >= 4.
Could happen when storing input_len with len_encoding >= 4.
It can take values from 2 to 8, so make it work for cases it would overflow.
2018-05-07 15:08:00 +02:00
Gaëtan Harter
ee311a331b
crypto/ccm: refactor input_len check in a function
...
Refactorg checking that length can be stored in a number of bytes to a
subfunction.
2018-05-07 15:08:00 +02:00
Wentao Shang
89023b3499
crypto/ccm: fix input_len check
...
Maximum input_len depends only on length_encoding and not auth_data_len.
The current length_max value was also wrong.
RFC3610 page 2
3. The message m, consisting of a string of l(m) octets where 0 <=
l(m) < 2^(8L). The length restriction ensures that l(m) can be
encoded in a field of L octets.
2018-05-07 15:08:00 +02:00
61f1b941ce
make: replace curly braces with parenthesis
2018-03-22 20:43:15 +01:00
4ec8f4c2fc
sys: instead of cpp-style, use C-style comments
2018-02-06 16:59:58 +01:00
Vincent Dupont
4f6fadbdc7
crypto/cbc: constify input buffers
2017-06-27 18:58:33 +02:00
Emmanuel Baccelli
6589c01aa0
sys/crypto: remove 3DES
2017-04-25 18:34:18 +02:00
Martine Lenders
62ca7f9242
crypto: fix cppcheck warnings
2017-04-14 14:36:14 +02:00
Oleg Hahm
c2893d4a88
sys: crypto: remove twofish and rc5
2017-01-15 14:53:43 +01:00
Mathias Tausig
3a3b26e70a
ciphers: Added defines for return values of cipher_init() and [specific cipher]_init() functions
...
New definitions: CIPHER_INIT_SUCCESS and CIPHER_ERR_BAD_CONTEXT_SIZE
2016-10-04 13:01:38 +02:00
Oleg Hahm
b428979a1d
debug: add missing line breaks
2016-09-27 23:38:41 +02:00
Cenk Gündoğan
e70c5d416e
Merge pull request #4787 from BytesGalore/doc_crypto_add_word_on_required_cflags
...
doc crypto: add word on using required `CFLAGS`
2016-03-03 13:36:27 +01:00
9082273746
core: header cleanup
2016-02-28 22:46:28 +01:00
BytesGalore
d09ae8f384
doc crypto: add word on using required CFLAGS
2016-02-12 08:41:53 +01:00
Oleg Hahm
825ba72751
doc crypto: fixed typo and improved example
2016-02-11 11:44:57 +01:00
Oleg Hahm
51db509f7c
sha256: move from crypto to hashes
2016-02-04 14:58:34 +01:00