diff --git a/lib/hash/fletcher16.c b/lib/hash/fletcher16.c index 0537aad..a0e6438 100644 --- a/lib/hash/fletcher16.c +++ b/lib/hash/fletcher16.c @@ -37,7 +37,10 @@ #include /* - * Simple implementation of Fletcher's checksum (16-bit version). + * Simple implementation of the 16-bit variant of Fletcher's checksum, + * described in Fletcher, J. G. (January 1982), "An Arithmetic Checksum + * for Serial Transmissions", IEEE Transactions on Communications. COM-30 + * (1): 247–252, doi:10.1109/tcom.1982.1095369 */ uint16_t fletcher16_hash(const void *data, size_t len) diff --git a/lib/hash/fletcher32.c b/lib/hash/fletcher32.c index b5b35ed..5d2c3a5 100644 --- a/lib/hash/fletcher32.c +++ b/lib/hash/fletcher32.c @@ -37,8 +37,14 @@ #include /* - * Simple implementation of Fletcher's checksum (32-bit version). The - * input length is zero-padded to the nearest multiple of 2 bytes. + * Simple implementation of the 32-bit variant of Fletcher's checksum, + * described in Fletcher, J. G. (January 1982), "An Arithmetic Checksum + * for Serial Transmissions", IEEE Transactions on Communications. COM-30 + * (1): 247–252, doi:10.1109/tcom.1982.1095369 + * + * The paper assumes that the input length is a multiple of the checksum + * algorithm's word size (half the checksum size). This implementation + * will zero-pad the input up to the nearest multiple of the word size. */ uint32_t fletcher32_hash(const void *data, size_t len) diff --git a/lib/hash/fletcher64.c b/lib/hash/fletcher64.c index 42fb251..6c67a52 100644 --- a/lib/hash/fletcher64.c +++ b/lib/hash/fletcher64.c @@ -37,8 +37,14 @@ #include /* - * Simple implementation of Fletcher's checksum (64-bit version). The - * input length is zero-padded to the nearest multiple of 4 bytes. + * Simple implementation of the 64-bit variant of Fletcher's checksum, + * described in Fletcher, J. G. (January 1982), "An Arithmetic Checksum + * for Serial Transmissions", IEEE Transactions on Communications. COM-30 + * (1): 247–252, doi:10.1109/tcom.1982.1095369 + * + * The paper assumes that the input length is a multiple of the checksum + * algorithm's word size (half the checksum size). This implementation + * will zero-pad the input up to the nearest multiple of the word size. */ uint64_t fletcher64_hash(const void *data, size_t len)