Skip to content

Commit

Permalink
Add EVP_Digest one-shot test XOFs (#1820)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillChilds-Klein authored Aug 30, 2024
1 parent 7113ce7 commit 173bd09
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crypto/fipsmodule/service_indicator/service_indicator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,14 @@ TEST_P(EVPXOFServiceIndicatorTest, EVP_Xofs) {
EXPECT_EQ(approved, test.expect_approved);
EXPECT_EQ(Bytes(test.expected_digest, test.length), Bytes(digest));

// Test using the one-shot |EVP_Digest| function for approval.
unsigned digest_len = test.length;
CALL_SERVICE_AND_CHECK_APPROVED(approved,
ASSERT_TRUE(EVP_Digest(kPlaintext, sizeof(kPlaintext), digest.data(),
&digest_len, test.func(), nullptr)));
EXPECT_EQ(approved, test.expect_approved);
EXPECT_EQ(Bytes(test.expected_digest, test.length), Bytes(digest));

// Test using the one-shot API for approval.
CALL_SERVICE_AND_CHECK_APPROVED(
approved,
Expand Down

0 comments on commit 173bd09

Please sign in to comment.