diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-01-17 16:05:16 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-01-17 16:05:16 +0000 |
commit | 71e181512d1cd61d3865f93f5b85b208b5720ba5 (patch) | |
tree | dd2dbd4e56236318208f1dad5acf02faa341fa2b /src/include/gnunet_crypto_lib.h | |
parent | 38e65c6c5268614b482d1234fea76cda11811044 (diff) | |
download | gnunet-71e181512d1cd61d3865f93f5b85b208b5720ba5.tar.gz gnunet-71e181512d1cd61d3865f93f5b85b208b5720ba5.zip |
add crc8
Diffstat (limited to 'src/include/gnunet_crypto_lib.h')
-rw-r--r-- | src/include/gnunet_crypto_lib.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 77b4d0452..23caade12 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -403,6 +403,19 @@ GNUNET_CRYPTO_seed_weak_random (int32_t seed); | |||
403 | 403 | ||
404 | 404 | ||
405 | /** | 405 | /** |
406 | * @ingroup hash | ||
407 | * Calculate the checksum of a buffer in one step. | ||
408 | * | ||
409 | * @param buf buffer to calculate CRC over | ||
410 | * @param len number of bytes in @a buf | ||
411 | * @return crc8 value | ||
412 | */ | ||
413 | uint8_t | ||
414 | GNUNET_CRYPTO_crc8_n (const void *buf, | ||
415 | size_t len); | ||
416 | |||
417 | |||
418 | /** | ||
406 | * Perform an incremental step in a CRC16 (for TCP/IP) calculation. | 419 | * Perform an incremental step in a CRC16 (for TCP/IP) calculation. |
407 | * | 420 | * |
408 | * @param sum current sum, initially 0 | 421 | * @param sum current sum, initially 0 |
@@ -439,6 +452,8 @@ GNUNET_CRYPTO_crc16_n (const void *buf, | |||
439 | size_t len); | 452 | size_t len); |
440 | 453 | ||
441 | 454 | ||
455 | |||
456 | |||
442 | /** | 457 | /** |
443 | * @ingroup hash | 458 | * @ingroup hash |
444 | * Compute the CRC32 checksum for the first len | 459 | * Compute the CRC32 checksum for the first len |