/src/SymCrypt/lib/shake_pattern.c
Line | Count | Source (jump to first uncovered line) |
1 | | // |
2 | | // shake_pattern.c |
3 | | // |
4 | | // Copyright (c) Microsoft Corporation. Licensed under the MIT license. |
5 | | // |
6 | | |
7 | | |
8 | | // |
9 | | // This source file implements SHAKE128 and SHAKE256 |
10 | | // |
11 | | // See the symcrypt.h file for documentation on what the various functions do. |
12 | | // |
13 | | |
14 | | // |
15 | | // SymCryptShake |
16 | | // |
17 | | VOID |
18 | | SYMCRYPT_CALL |
19 | | SYMCRYPT_XxxDefault( |
20 | | _In_reads_( cbData ) PCBYTE pbData, |
21 | | SIZE_T cbData, |
22 | | _Out_writes_( SYMCRYPT_SHAKEXXX_RESULT_SIZE ) PBYTE pbResult) |
23 | 0 | { |
24 | 0 | SYMCRYPT_Xxx(pbData, cbData, pbResult, SYMCRYPT_SHAKEXXX_RESULT_SIZE); |
25 | 0 | } Unexecuted instantiation: SymCryptShake128Default Unexecuted instantiation: SymCryptShake256Default |
26 | | |
27 | | // |
28 | | // SymCryptShakeEx |
29 | | // |
30 | | VOID |
31 | | SYMCRYPT_CALL |
32 | | SYMCRYPT_Xxx( |
33 | | _In_reads_( cbData ) PCBYTE pbData, |
34 | | SIZE_T cbData, |
35 | | _Out_writes_( cbResult ) PBYTE pbResult, |
36 | | SIZE_T cbResult) |
37 | 0 | { |
38 | 0 | SYMCRYPT_XXX_STATE state; |
39 | |
|
40 | 0 | SYMCRYPT_XxxInit(&state); |
41 | 0 | SYMCRYPT_XxxAppend(&state, pbData, cbData); |
42 | 0 | SYMCRYPT_XxxExtract(&state, pbResult, cbResult, TRUE); |
43 | 0 | } Unexecuted instantiation: SymCryptShake128 Unexecuted instantiation: SymCryptShake256 |
44 | | |
45 | | // |
46 | | // SymCryptShakeStateCopy |
47 | | // |
48 | | VOID |
49 | | SYMCRYPT_CALL |
50 | | SYMCRYPT_XxxStateCopy(_In_ const SYMCRYPT_XXX_STATE* pSrc, _Out_ SYMCRYPT_XXX_STATE* pDst) |
51 | 0 | { |
52 | 0 | SYMCRYPT_CHECK_MAGIC(pSrc); |
53 | 0 | *pDst = *pSrc; |
54 | 0 | SYMCRYPT_SET_MAGIC(pDst); |
55 | 0 | } Unexecuted instantiation: SymCryptShake128StateCopy Unexecuted instantiation: SymCryptShake256StateCopy |
56 | | |
57 | | // |
58 | | // SymCryptShakeInit |
59 | | // |
60 | | VOID |
61 | | SYMCRYPT_CALL |
62 | | SYMCRYPT_XxxInit(_Out_ PSYMCRYPT_XXX_STATE pState) |
63 | 0 | { |
64 | 0 | SymCryptKeccakInit(&pState->ks, |
65 | 0 | SYMCRYPT_SHAKEXXX_INPUT_BLOCK_SIZE, |
66 | 0 | SYMCRYPT_SHAKE_PADDING_VALUE); |
67 | |
|
68 | 0 | SYMCRYPT_SET_MAGIC(pState); |
69 | 0 | } Unexecuted instantiation: SymCryptShake128Init Unexecuted instantiation: SymCryptShake256Init |
70 | | |
71 | | // |
72 | | // SymCryptShakeAppend |
73 | | // |
74 | | VOID |
75 | | SYMCRYPT_CALL |
76 | | SYMCRYPT_XxxAppend( |
77 | | _Inout_ PSYMCRYPT_XXX_STATE pState, |
78 | | _In_reads_(cbData) PCBYTE pbData, |
79 | | SIZE_T cbData) |
80 | 0 | { |
81 | 0 | SymCryptKeccakAppend(&pState->ks, pbData, cbData); |
82 | 0 | } Unexecuted instantiation: SymCryptShake128Append Unexecuted instantiation: SymCryptShake256Append |
83 | | |
84 | | // |
85 | | // SymCryptShakeExtract |
86 | | // |
87 | | VOID |
88 | | SYMCRYPT_CALL |
89 | | SYMCRYPT_XxxExtract( |
90 | | _Inout_ PSYMCRYPT_XXX_STATE pState, |
91 | | _Out_writes_(cbResult) PBYTE pbResult, |
92 | | SIZE_T cbResult, |
93 | | BOOLEAN bWipe) |
94 | 0 | { |
95 | 0 | SymCryptKeccakExtract(&pState->ks, pbResult, cbResult, bWipe); |
96 | 0 | } Unexecuted instantiation: SymCryptShake128Extract Unexecuted instantiation: SymCryptShake256Extract |
97 | | |
98 | | // |
99 | | // SymCryptShakeResult |
100 | | // |
101 | | VOID |
102 | | SYMCRYPT_CALL |
103 | | SYMCRYPT_XxxResult( |
104 | | _Inout_ PSYMCRYPT_XXX_STATE pState, |
105 | | _Out_writes_(SYMCRYPT_SHAKEXXX_RESULT_SIZE) PBYTE pbResult) |
106 | 0 | { |
107 | 0 | SymCryptKeccakExtract(&pState->ks, pbResult, SYMCRYPT_SHAKEXXX_RESULT_SIZE, TRUE); |
108 | 0 | } Unexecuted instantiation: SymCryptShake128Result Unexecuted instantiation: SymCryptShake256Result |