This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int32_t m_chacha20_poly_run(bvm *vm, int32_t _encrypt) { | |
int32_t argc = be_top(vm); // Get the number of arguments | |
if (argc >= 4 && be_isbytes(vm, 1) // secret_key - 32 bytes | |
&& be_isbytes(vm, 2) // iv/nonce - 12 bytes | |
&& be_isbytes(vm, 3) // data/cipher | |
&& be_isbytes(vm, 4) // mac/tag - 16 bytes | |
// optional: aad | |
) { | |
size_t key_len = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import crypto | |
e = crypto.ED25519() | |
seed = bytes("9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60") | |
secret_key=e.secret_key(seed) | |
message = bytes() | |
public_key = secret_key[-32..] | |
_public_key = bytes("d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a") | |
assert(public_key == _public_key) | |
signature = e.sign(message, secret_key) | |
assert(signature == bytes("e5564300c360ac729086e2cc806e828a84877f1eb8e5d974d873e065224901555fb8821590a33bacc61e39701cf9b46bd25bf5f0595bbe24655141438e7a100b")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AudioEncoderOpus : public AudioEncoder | |
{ | |
public: | |
AudioEncoderOpus() { | |
AddLog(LOG_LEVEL_DEBUG,PSTR("I2S: AudioEncoderOpus")); | |
headerBuffer = (uint8_t*)&combHeader; | |
packetno = 0; | |
}; | |
virtual ~AudioEncoderOpus() { | |
if(inBuffer){ free(inBuffer); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
xdrv_42_i2s_audio.ino - Audio dac support for Tasmota | |
Copyright (C) 2021 Gerhard Mutz and Theo Arends | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image, ImageSequence | |
import io | |
import requests | |
fname = 'img.gif' | |
id ='23041' | |
url = 'https://developer.lametric.com/content/apps/icon_thumbs/'+id+'_icon_thumb.gif' | |
r = requests.get(url) | |
open(fname , 'wb').write(r.content) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run in lib/libesp32_div/esp-nimble-cpp/src/ | |
import os | |
excludes = ["mega_header.h","NimBLEBeacon.h","NimBLEBeacon.cpp","HIDKeyboardTypes.h","HIDTypes.h","NimBLEHIDDevice.h","NimBLEHIDDevice.cpp","NimBLEEddystoneURL.h","NimBLEEddystoneURL.cpp","NimBLEEddystoneTLM.h","NimBLEEddystoneTLM.cpp"] | |
src_dir = os.path.join("./") | |
src_files=os.listdir(src_dir) | |
headers = [f for f in src_files if (f.endswith(".h") and f not in excludes)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UNANIM | |
var color, cycles, delay, mode | |
var clist | |
var steps | |
def init(color, cycles, delay, mode) | |
self.color = color | |
self.cycles = cycles | |
self.delay = delay | |
self.mode = mode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD | |
* | |
* SPDX-License-Identifier: Unlicense OR CC0-1.0 | |
*/ | |
/* ULP-RISC-V example | |
This example code is in the Public Domain (or CC0 licensed, at your option.) | |
Unless required by applicable law or agreed to in writing, this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NC # NVS Constants | |
static page_size = 4096 | |
static entry_size = 32 | |
static item_type = { | |
0x01: 'uint8_t', | |
0x11: 'int8_t', | |
0x02: 'uint16_t', | |
0x12: 'int16_t', | |
0x04: 'uint32_t', |
Convert to Berry
NewerOlder