circuitpython/shared-bindings
Sean Cross b168784fa0 aesio: add basic AES encryption and decryption
This adds initial support for an AES module named aesio.  This
implementation supports only a subset of AES modes, namely
ECB, CBC, and CTR modes.

Example usage:

```
>>> import aesio
>>>
>>> key = b'Sixteen byte key'
>>> cipher = aesio.AES(key, aesio.MODE_ECB)
>>> output = bytearray(16)
>>> cipher.encrypt_into(b'Circuit Python!!', output)
>>> output
bytearray(b'E\x14\x85\x18\x9a\x9c\r\x95>\xa7kV\xa2`\x8b\n')
>>>
```

This key is 16-bytes, so it uses AES128.  If your key is 24- or 32-
bytes long, it will switch to AES192 or AES256 respectively.

This has been tested with many of the official NIST test vectors,
such as those used in `pycryptodome` at
39626a5b01/lib/Crypto/SelfTest/Cipher/test_vectors/AES

CTR has not been tested as NIST does not provide test vectors for it.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-06 17:40:06 +08:00
..
_bleio trivial change to force rebuild 2020-05-04 23:05:47 -04:00
_eve Split ROMDECLS for readability 2020-02-13 07:28:21 -08:00
_pew Refactor deinit check to reduce code size. 2019-06-12 11:36:43 -07:00
_pixelbuf Encapsulate buffers inside PixelBuf and refactor it. 2020-01-24 18:23:07 -08:00
_stage circuitpython-stage: allow choosing background color 2020-01-30 15:24:04 +01:00
aesio aesio: add basic AES encryption and decryption 2020-05-06 17:40:06 +08:00
analogio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
audiobusio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
audiocore ulab: Incorporate it 2020-02-27 11:03:03 -06:00
audioio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
audiomixer audiosample: convert to use a protocol 2019-12-04 09:31:52 -06:00
audiomp3 fix doc build error 2020-01-06 09:26:32 -06:00
audiopwmio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
bitbangio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
board Corrected UART output. 2020-04-30 19:14:51 -05:00
busio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
digitalio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
displayio displayio: Fix "bus type" problem introduced at 8cba145c90 2020-04-21 13:48:34 -05:00
fontio Fix reference to Bitmap in fontio.Glyph docs. 2019-06-18 18:44:50 -05:00
framebufferio framebufferio: update copyright information 2020-04-17 18:44:07 -05:00
frequencyio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
gamepad When clearing gamepad buffer, use the last button state, not 0 2019-06-12 11:42:41 -07:00
gamepadshift When clearing gamepad buffer, use the last button state, not 0 2019-06-12 11:42:41 -07:00
i2cslave rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
math Support internationalisation. 2018-08-07 14:58:57 -07:00
microcontroller Add Protomatter and FramebufferDisplay 2020-04-14 18:24:54 -05:00
multiterminal Support internationalisation. 2018-08-07 14:58:57 -07:00
neopixel_write Fix iMX builds 2020-03-31 17:00:30 -07:00
network Improve rST consistency for rst2pyi use 2019-05-30 19:02:47 -07:00
nvm Revert subscr signature change 2019-12-13 14:29:15 -05:00
os avoid os.stat() int overflow on smallint-only builds 2020-02-14 18:33:37 -05:00
ps2io rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
pulseio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
random Merge branch 'master' into new-pixelbuf-api 2019-12-20 19:22:27 -05:00
rgbmatrix RGBMatrix: nonessential change to kick Actions 2020-04-19 09:10:08 -05:00
rotaryio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
rtc Improve documentation for rtc. 2019-10-23 15:48:34 -07:00
socket protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
storage Improve rST consistency for rst2pyi use 2019-05-30 19:02:47 -07:00
struct Improve rST consistency for rst2pyi use 2019-05-30 19:02:47 -07:00
supervisor Remove nRF52832 support 2018-12-30 22:49:20 -05:00
terminalio protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
time time.sleep() rounds to nearest msec 2020-02-07 10:24:11 -05:00
touchio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
uheap Improve rST consistency for rst2pyi use 2019-05-30 19:02:47 -07:00
ulab ulab: Update from upstream 2020-04-22 09:04:12 -05:00
usb_hid A variety of displayio improvements 2019-02-11 20:55:05 -08:00
usb_midi protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
ustack Improve rST consistency for rst2pyi use 2019-05-30 19:02:47 -07:00
wiznet rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
help.c Improve rST consistency for rst2pyi use 2019-05-30 19:02:47 -07:00
index.rst update rST ref link for support matrix 2019-07-28 21:25:43 -05:00
support_matrix.rst update rST ref link for support matrix 2019-07-28 21:25:43 -05:00
util.c Refactor deinit check to reduce code size. 2019-06-12 11:36:43 -07:00
util.h Refactor deinit check to reduce code size. 2019-06-12 11:36:43 -07:00