PicoMite V6.00.01 release candidates - please test thoroughly


Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11033
Posted: 04:33pm 22 Dec 2024      

V6.00.01RC10

PicoMiteRP2040V6.00.01RC10.zip

PicoMiteRP2350V6.00.01RC10.zip


Please, please if reporting any issues specify the exact version used and list all options set

Bug fixes
Bug in SPRITE LOADBMP not finding the file
Memory leak when AUTOSAVE APPEND is exited with Ctrl-C
Crashes in WebMite2040 caused by system heap being exceeded (in since 5.09)
Bug in VGA RP2040 caused by system/firmware memory overrun

Modifications
Tweaks the PSRAM timings to allow 372MHz operation of Pimoroni boards with RP2350B and 8Mb PSRAM. This enables 1280P resolution with a RP2350B running HDMI firmware


New functionality

LONGSTRING AES128 ENCRYPT/DECRYPT CBC/ECB/CTR key$/key[!/%](), in%(), out%() [,iv$/iv[!/%]()]

Encrypts or decrypts the longstring in in%() putting the answer in out%()
For CBC and CTR modes the encryption will generate a random initialisation vector and prepend out%() with the IV. If an explicit IV is specified this will be used instead of the random vector and this will be prepended to out%()
For CBC and CTR decryption the firmware assumes that the first 16 bytes of in%() are the initialisation vector.
In the case where you want to transmit a message without IV you can use LONGSTRING RIGHT to remove the IV before sending the message. In this case the recipient must know the IV as well as the key and create a complete longstring before using DECRYPT. This can be done by using LONGSTRING CONCAT to add the incoming message to a longstring containing the IV.

LONGSTRING BASE64 ENCODE/DECODE in%(), out%()

This BASE64 encodes or decodes the longstring in in%() placing the answer in out%(). The array used as the output must be big enough relative to the input and the direction. Encoding increases length by 4/3 and decoding decreases it by 3/4

Function
MATH(BASE64 ENCODE/DECODE in$/in(), out$/out())

Returns the length of out$/out(). This base64 encodes or decodes the data in 'in' and puts the result in 'out'. Where arrays are used as the output they must be big enough relative to the input and the direction. Encryption increases length by 4/3 and decryption decreases it by 3/4

Command
MATH AES128 ENCRYPT/DECRYPT CBC/ECB/CTR key$/key(), in$/in(), out$/out() [,iv$/iv()

This command encrypts or decrypts the data in 'in' and puts the answer in 'out' using the AES128 encryption method specified
The parameters can each be either a string, integer array, or float array with any mix possible
The key must be 16 elements long (16*8=128bits)
in and out must be a multiple of 16 elements long.
In the case of out being specified as a string (e.g. out$), the string variable must exist and should be set to empty (DIM out$="")
The maximum number of elements in 'in' and 'out' is limited by memory when defined as arrays. Strings for encrypting are limited to 240bytes (EBR) and 224bytes (CTR and CBC).
For CBC and CTR encryption you can optionally specify an initialisation vector 'iv'. 'iv' must be 16 elements long (16*8=128bits). If an initialisation vector is not specified encryption will generate a random initialisation vector.
In both cases the output is prepended with the IV.
For CBC and CTR, decryption requires that the first 16 elements of the input are the initialisation vector.
In the case where you want to transmit a message without IV you should remove the IV before sending the message using standard MMBasic manipulations. In this case the recipient must know the IV as well as the key and create a complete message before using DECRYPT by prepending the IV to the incoming message.
Edited 2024-12-23 03:00 by matherp