|
12 | 12 | // See the License for the specific language governing permissions and |
13 | 13 | // limitations under the License. |
14 | 14 |
|
15 | | -/// \file Provides a simple SHA256 algorithm for hashing. |
16 | | -/// This implementation makes no security guarantees, its use case |
17 | | -/// is for non-sensitive comparison of message digests |
18 | | -/// Implementation originally copied from Brad Conte |
19 | | -/// https://github.com/B-Con/crypto-algorithms/blob/master/sha256.c |
20 | | - |
21 | 15 | /** \file sha256.h |
22 | 16 | * \brief SHA256 implementation |
23 | 17 | * |
|
28 | 22 | * Algorithm specification can be found here: |
29 | 23 | * http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf |
30 | 24 | * This implementation uses little endian byte order. |
| 25 | + * This implementation makes no security guarantees, its use case if for |
| 26 | + * non-sensitive comparison of message digests. |
31 | 27 | */ |
32 | 28 |
|
33 | 29 | #ifndef RCUTILS__SHA256_H_ |
@@ -83,10 +79,19 @@ void rcutils_sha256_update(rcutils_sha256_ctx_t * ctx, const uint8_t * data, siz |
83 | 79 | * \param[out] output_hash Calculated sha256 message digest to be filled |
84 | 80 | * \return void |
85 | 81 | */ |
| 82 | +#ifdef DOXYGEN_ONLY |
| 83 | +// One of the tools used by rosdoc2 misunderstands uint8_t[] as a uint8_t, |
| 84 | +// so make it a pointer for documentation purposes. |
| 85 | +RCUTILS_PUBLIC |
| 86 | +void rcutils_sha256_final( |
| 87 | + rcutils_sha256_ctx_t * ctx, |
| 88 | + uint8_t * output_hash); |
| 89 | +#else |
86 | 90 | RCUTILS_PUBLIC |
87 | 91 | void rcutils_sha256_final( |
88 | 92 | rcutils_sha256_ctx_t * ctx, |
89 | 93 | uint8_t output_hash[RCUTILS_SHA256_BLOCK_SIZE]); |
| 94 | +#endif |
90 | 95 |
|
91 | 96 | #ifdef __cplusplus |
92 | 97 | } |
|
0 commit comments