Audacity 3.2.0
Functions
CryptoTests.cpp File Reference
#include <catch2/catch.hpp>
#include "crypto/SHA256.h"
Include dependency graph for CryptoTests.cpp:

Go to the source code of this file.

Functions

 TEST_CASE ("SHA256", "")
 

Function Documentation

◆ TEST_CASE()

TEST_CASE ( "SHA256"  ,
""   
)

Definition at line 11 of file CryptoTests.cpp.

12{
14
15 REQUIRE(sha256.Finalize() == "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855");
16
17 sha256.Update("a");
18
19 REQUIRE(
20 sha256.Finalize() ==
21 "CA978112CA1BBDCAFAC231B39A23DC4DA786EFF8147C4E72B9807785AFEE48BB");
22
23 sha256.Update("bc", 2);
24
25 REQUIRE(
26 sha256.Finalize() ==
27 "1E0BBD6C686BA050B8EB03FFEEDC64FDC9D80947FCE821ABBE5D6DC8D252C5AC");
28
29 REQUIRE(
30 crypto::sha256("Audacity") ==
31 "CF21DBCF13FC6B66CCBF713B88AD02EC1EF0C6196ACAF28B0FB48D04858A5D04");
32
33 REQUIRE(
35 " is a free, open source, cross-platform audio software for multi-track recording and editing.") ==
36 "00E7C81A5357B1734035CE4CAE5DC0B3F886D22C8AF2E3952E2F5569A994B8A8");
37}
std::string sha256(const T &data)
Definition: SHA256.h:50

References crypto::sha256().

Here is the call graph for this function: