mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 12:40:15 +01:00
top: Update Python formatting to black "2023 stable style".
See https://black.readthedocs.io/en/stable/the_black_code_style/index.html Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import _thread
|
||||
# the shared bytearray
|
||||
ba = bytearray()
|
||||
|
||||
|
||||
# main thread function
|
||||
def th(n, lo, hi):
|
||||
for repeat in range(n):
|
||||
|
||||
@@ -7,6 +7,7 @@ import _thread
|
||||
# the shared dict
|
||||
di = {"a": "A", "b": "B", "c": "C", "d": "D"}
|
||||
|
||||
|
||||
# main thread function
|
||||
def th(n, lo, hi):
|
||||
for repeat in range(n):
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
import _thread
|
||||
|
||||
|
||||
# the shared user class and instance
|
||||
class User:
|
||||
def __init__(self):
|
||||
@@ -14,6 +15,7 @@ class User:
|
||||
|
||||
user = User()
|
||||
|
||||
|
||||
# main thread function
|
||||
def th(n, lo, hi):
|
||||
for repeat in range(n):
|
||||
|
||||
@@ -7,6 +7,7 @@ import _thread
|
||||
# the shared list
|
||||
li = list()
|
||||
|
||||
|
||||
# main thread function
|
||||
def th(n, lo, hi):
|
||||
for repeat in range(n):
|
||||
|
||||
@@ -7,6 +7,7 @@ import _thread
|
||||
# the shared set
|
||||
se = set([-1, -2, -3, -4])
|
||||
|
||||
|
||||
# main thread function
|
||||
def th(n, lo, hi):
|
||||
for repeat in range(n):
|
||||
|
||||
@@ -38,6 +38,7 @@ aes_s_box_table = bytes((
|
||||
))
|
||||
# fmt: on
|
||||
|
||||
|
||||
# multiplication of polynomials modulo x^8 + x^4 + x^3 + x + 1 = 0x11b
|
||||
def aes_gf8_mul_2(x):
|
||||
if x & 0x80:
|
||||
@@ -80,6 +81,7 @@ def aes_r_con(a):
|
||||
# using OCB, where the sequence is xored against the plaintext.
|
||||
# Care must be taken to (almost) always choose a different IV.
|
||||
|
||||
|
||||
# all inputs must be size 16
|
||||
def aes_add_round_key(state, w):
|
||||
for i in range(16):
|
||||
|
||||
@@ -8,6 +8,7 @@ except ImportError:
|
||||
import time
|
||||
import _thread
|
||||
|
||||
|
||||
# function to check the interned string
|
||||
def check(s, val):
|
||||
assert type(s) == str
|
||||
|
||||
Reference in New Issue
Block a user