Support set of initial counter value for CTR modes

This commit is contained in:
Peter D. Gray 2018-05-25 10:18:08 -04:00
parent 2a6f399e90
commit 146d89ef22

View File

@ -63,7 +63,8 @@ STATIC mp_obj_t mod_trezorcrypto_AES_make_new(const mp_obj_type_t *type, size_t
memset(o->iv, 0, AES_BLOCK_SIZE);
}
memset(o->ctr, 0, AES_BLOCK_SIZE);
// for CTR modes, use IV
memcpy(o->ctr, o->iv, AES_BLOCK_SIZE);
switch (key.len) {
default: