Module utils

Source

Functionsยง

pad_bytes ๐Ÿ”’
Pads bytes to a minimum length using PKCS7-like padding. The last N bytes of the padded bytes all have the value N. Minimum of 1 padding byte. maximum of 255 bytes. For example, padded to size 4, the value 0,0 becomes 0,0,2,2. If the more than 255 bytes of padding is required, this will return an error.
stretch_key ๐Ÿ”’
Stretch the given key using HKDF. This can be either a kdf-derived key (PIN/Master password) or a random key from key connector
unpad_bytes ๐Ÿ”’
Unpads bytes that is padded using the PKCS7-like padding defined by pad_bytes. The last N bytes of the padded bytes all have the value N. Minimum of 1 padding byte. For example, padded to size 4, the value 0,0 becomes 0,0,2,2.