mirror of
https://github.com/logos-storage/logos-storage-docs-obsidian.git
synced 2026-01-03 13:53:13 +00:00
updates the encryption design doc to use the data size different from initialization vector size
This commit is contained in:
parent
31e26020ba
commit
453906fd47
@ -99,11 +99,12 @@ let blockIndexArray = toBytes(blockIndex, bigEndian)
|
||||
|
||||
const KEY_SIZE = 24 # 192 bits for AES-192
|
||||
const IV_SIZE = 16 # 128 bits
|
||||
const DefaultBlockSize* = uint 1024 * 64 # as used in Codex
|
||||
|
||||
let keyForBlock = hash(addr sha256Vtable, masterKey & @[byte(0x01)] & blockIndexArray.toSeq)[0 ..< KEY_SIZE]
|
||||
let ivForBlock = hash(addr sha256Vtable, masterKey & @[byte(0x02)] & blockIndexArray.toSeq)[0 ..< IV_SIZE]
|
||||
|
||||
var plaintext = newSeqWith(IV_SIZE, Rng.instance.rand(uint8.high).byte)
|
||||
var plaintext = newSeqWith(DefaultBlockSize.int, Rng.instance.rand(uint8.high).byte)
|
||||
|
||||
let key = keyForBlock
|
||||
let ive = ivForBlock
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user