Skip to content

Commit

Permalink
Fix for x86_64 which affects the performance.
Browse files Browse the repository at this point in the history
Showing also printing the first 4 blocks.
This commit is to be reverted.
  • Loading branch information
nebeid committed Jul 5, 2024
1 parent 61074b6 commit 69b858a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crypto/fipsmodule/aes/aes_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,18 @@ TEST(AESTest, ABI) {
SCOPED_TRACE(blocks);
CHECK_ABI(aes_hw_cbc_encrypt, buf, buf, AES_BLOCK_SIZE * blocks, &key,
block, AES_ENCRYPT);
if (blocks == 0) {
std::cout << "blocks: " << blocks << std::endl;
std::cout << "buf before: " << Bytes(buf,64) << std::endl;
}
std::string buf_before = testing::PrintToString(Bytes(buf,64));
CHECK_ABI(aes_hw_ctr32_encrypt_blocks, buf, buf, blocks, &key, block);
if (blocks == 0) {
std::cout << "buf after: " << Bytes(buf,64) << std::endl;
EXPECT_EQ(buf_before, testing::PrintToString(Bytes(buf,64)));
}
//EXPECT_TRUE(0) << testing::PrintToString(Bytes(buf,64));
//EXPECT_TRUE(0) << Bytes(buf);
#if defined(HWAES_ECB)
CHECK_ABI(aes_hw_ecb_encrypt, buf, buf, AES_BLOCK_SIZE * blocks, &key,
AES_ENCRYPT);
Expand Down
1 change: 1 addition & 0 deletions crypto/fipsmodule/aes/asm/aesni-x86_64.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,7 @@ sub aesni_generate8 {
.align 16
.Lctr32_bulk:
jb .Lctr32_epilogue # if $len < 1, go to done
lea (%rsp),$key_ # use $key_ as frame pointer
.cfi_def_cfa_register $key_
push %rbp
Expand Down

0 comments on commit 69b858a

Please sign in to comment.