[ctrtool] Improved efficiency of aes-ctr operations.

This commit is contained in:
jakcron
2016-06-14 20:35:05 +08:00
parent de5c4e1b2a
commit 01cd4cba7b
8 changed files with 96 additions and 44 deletions
+2 -1
View File
@@ -93,7 +93,8 @@ void exheader_read(exheader_context* ctx, u32 actions)
fseeko64(ctx->file, ctx->offset, SEEK_SET);
fread(&ctx->header, 1, sizeof(exheader_header), ctx->file);
ctr_init_counter(&ctx->aes, ctx->key, ctx->counter);
ctr_init_key(&ctx->aes, ctx->key);
ctr_init_counter(&ctx->aes, ctx->counter);
if (ctx->encrypted)
ctr_crypt_counter(&ctx->aes, (u8*)&ctx->header, (u8*)&ctx->header, sizeof(exheader_header));