| rfc9923v2.txt | rfc9923.txt | |||
|---|---|---|---|---|
| skipping to change at line 885 ¶ | skipping to change at line 885 ¶ | |||
| This section provides the direct FNV-1a function for each of the | This section provides the direct FNV-1a function for each of the | |||
| lengths for which it is specified in this document. | lengths for which it is specified in this document. | |||
| The following is a configuration header to set whether 64-bit | The following is a configuration header to set whether 64-bit | |||
| integers are supported and establish an enum used for return values. | integers are supported and establish an enum used for return values. | |||
| <CODE BEGINS> file "FNVconfig.h" | <CODE BEGINS> file "FNVconfig.h" | |||
| //************************ FNVconfig.h **************************// | //************************ FNVconfig.h **************************// | |||
| //**************** See RFC 9923 for details. ********************// | //**************** See RFC 9923 for details. ********************// | |||
| /* Copyright (c) 2016, 2024, 2025 IETF Trust and the persons | /* Copyright (c) 2016-2025 IETF Trust and the persons | |||
| * identified as authors of the code. All rights reserved. | * identified as authors of the code. All rights reserved. | |||
| * See fnv-private.h for terms of use and redistribution. | * See fnv-private.h for terms of use and redistribution. | |||
| */ | */ | |||
| #ifndef _FNVconfig_H_ | #ifndef _FNVconfig_H_ | |||
| #define _FNVconfig_H_ | #define _FNVconfig_H_ | |||
| /* | /* | |||
| * Description: | * Description: | |||
| * This file provides configuration ifdefs for the | * This file provides configuration ifdefs for the | |||
| skipping to change at line 943 ¶ | skipping to change at line 943 ¶ | |||
| #endif /* _FNVconfig_H_ */ | #endif /* _FNVconfig_H_ */ | |||
| <CODE ENDS> | <CODE ENDS> | |||
| The following code is a simple header file to define the return value | The following code is a simple header file to define the return value | |||
| error codes for the FNV routines. | error codes for the FNV routines. | |||
| <CODE BEGINS> file "FNVErrorCodes.h" | <CODE BEGINS> file "FNVErrorCodes.h" | |||
| //********************** FNVErrorCodes.h **************************// | //********************** FNVErrorCodes.h **************************// | |||
| //**************** See RFC 9923 for details. **********************// | //**************** See RFC 9923 for details. **********************// | |||
| /* Copyright (c) 2016, 2023, 2024, 2025 IETF Trust and the persons | /* Copyright (c) 2016-2025 IETF Trust and the persons | |||
| * identified as authors of the code. All rights reserved. | * identified as authors of the code. All rights reserved. | |||
| * See fnv-private.h for terms of use and redistribution. | * See fnv-private.h for terms of use and redistribution. | |||
| */ | */ | |||
| #ifndef _FNV_ErrCodes_ | #ifndef _FNV_ErrCodes_ | |||
| #define _FNV_ErrCodes_ | #define _FNV_ErrCodes_ | |||
| //****************************************************************// | //****************************************************************// | |||
| // | // | |||
| // All FNV functions, except the FNVxxxfile functions, | // All FNV functions, except the FNVxxxfile functions, | |||
| // return an integer as follows: | // return an integer as follows: | |||
| skipping to change at line 973 ¶ | skipping to change at line 973 ¶ | |||
| #endif /* _FNV_ErrCodes_ */ | #endif /* _FNV_ErrCodes_ */ | |||
| <CODE ENDS> | <CODE ENDS> | |||
| The following code is a private header file that is used by all the | The following code is a private header file that is used by all the | |||
| FNV functions further below and that states the terms for use and | FNV functions further below and that states the terms for use and | |||
| redistribution of all of this source code. | redistribution of all of this source code. | |||
| <CODE BEGINS> file "fnv-private.h" | <CODE BEGINS> file "fnv-private.h" | |||
| //************************ fnv-private.h **************************// | //************************ fnv-private.h **************************// | |||
| //****************** See RFC 9923 for details. ********************// | //****************** See RFC 9923 for details. ********************// | |||
| /* Copyright (c) 2016, 2023, 2024, 2025 IETF Trust and the persons | /* Copyright (c) 2016-2025 IETF Trust and the persons | |||
| * identified as authors of the code. All rights reserved. | * identified as authors of the code. All rights reserved. | |||
| * | * | |||
| * Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | |||
| * modification, are permitted provided that the following conditions | * modification, are permitted provided that the following conditions | |||
| * are met: | * are met: | |||
| * | * | |||
| * * Redistributions of source code must retain the above copyright | * * Redistributions of source code must retain the above copyright | |||
| * notice, this list of conditions and the following disclaimer. | * notice, this list of conditions and the following disclaimer. | |||
| * | * | |||
| * * Redistributions in binary form must reproduce the above | * * Redistributions in binary form must reproduce the above | |||
| skipping to change at line 1053 ¶ | skipping to change at line 1053 ¶ | |||
| <CODE ENDS> | <CODE ENDS> | |||
| 8.2.1. FNV32 Code | 8.2.1. FNV32 Code | |||
| The following code is the header and C source for 32-bit FNV-1a | The following code is the header and C source for 32-bit FNV-1a | |||
| providing a 32-bit integer or 4-byte vector hash. | providing a 32-bit integer or 4-byte vector hash. | |||
| <CODE BEGINS> file "FNV32.h" | <CODE BEGINS> file "FNV32.h" | |||
| //*************************** FNV32.h ****************************// | //*************************** FNV32.h ****************************// | |||
| //****************** See RFC 9923 for details. *******************// | //****************** See RFC 9923 for details. *******************// | |||
| /* Copyright (c) 2016, 2024, 2025 IETF Trust and the persons | /* Copyright (c) 2016-2025 IETF Trust and the persons | |||
| * identified as authors of the code. All rights reserved. | * identified as authors of the code. All rights reserved. | |||
| * See fnv-private.h for terms of use and redistribution. | * See fnv-private.h for terms of use and redistribution. | |||
| */ | */ | |||
| #ifndef _FNV32_H_ | #ifndef _FNV32_H_ | |||
| #define _FNV32_H_ | #define _FNV32_H_ | |||
| /* | /* | |||
| * Description: | * Description: | |||
| * This file provides headers for the 32-bit version of | * This file provides headers for the 32-bit version of | |||
| skipping to change at line 1195 ¶ | skipping to change at line 1195 ¶ | |||
| #ifdef __cplusplus | #ifdef __cplusplus | |||
| } | } | |||
| #endif | #endif | |||
| #endif /* _FNV32_H_ */ | #endif /* _FNV32_H_ */ | |||
| <CODE ENDS> | <CODE ENDS> | |||
| <CODE BEGINS> file "FNV32.c" | <CODE BEGINS> file "FNV32.c" | |||
| //************************** FNV32.c **************************// | //************************** FNV32.c **************************// | |||
| //**************** See RFC 9923 for details. ******************// | //**************** See RFC 9923 for details. ******************// | |||
| /* Copyright (c) 2016, 2024, 2025 IETF Trust and the persons | /* Copyright (c) 2016-2025 IETF Trust and the persons | |||
| * identified as authors of the code. All rights reserved. | * identified as authors of the code. All rights reserved. | |||
| * See fnv-private.h for terms of use and redistribution. | * See fnv-private.h for terms of use and redistribution. | |||
| */ | */ | |||
| /* This code implements the FNV (Fowler/Noll/Vo) non-cryptographic | /* This code implements the FNV (Fowler/Noll/Vo) non-cryptographic | |||
| * hash function FNV-1a for 32-bit hashes. | * hash function FNV-1a for 32-bit hashes. | |||
| */ | */ | |||
| #include <stdio.h> | #include <stdio.h> | |||
| skipping to change at line 1560 ¶ | skipping to change at line 1560 ¶ | |||
| 8.2.2. FNV64 Code | 8.2.2. FNV64 Code | |||
| The following code is the header and C source for 64-bit FNV-1a | The following code is the header and C source for 64-bit FNV-1a | |||
| providing an 8-byte vector or, optionally, if 64-bit integers are | providing an 8-byte vector or, optionally, if 64-bit integers are | |||
| supported, a 64-bit integer hash. | supported, a 64-bit integer hash. | |||
| <CODE BEGINS> file "FNV64.h" | <CODE BEGINS> file "FNV64.h" | |||
| //*************************** FNV64.h ****************************// | //*************************** FNV64.h ****************************// | |||
| //***************** See RFC 9923 for details. ********************// | //***************** See RFC 9923 for details. ********************// | |||
| /* Copyright (c) 2016, 2024, 2025 IETF Trust and the persons | /* Copyright (c) 2016-2025 IETF Trust and the persons | |||
| * identified as authors of the code. All rights reserved. | * identified as authors of the code. All rights reserved. | |||
| * See fnv-private.h for terms of use and redistribution. | * See fnv-private.h for terms of use and redistribution. | |||
| */ | */ | |||
| #ifndef _FNV64_H_ | #ifndef _FNV64_H_ | |||
| #define _FNV64_H_ | #define _FNV64_H_ | |||
| /* | /* | |||
| * Description: | * Description: | |||
| * This file provides headers for the 64-bit version of | * This file provides headers for the 64-bit version of | |||
| skipping to change at line 1721 ¶ | skipping to change at line 1721 ¶ | |||
| #ifdef __cplusplus | #ifdef __cplusplus | |||
| } | } | |||
| #endif | #endif | |||
| #endif /* _FNV64_H_ */ | #endif /* _FNV64_H_ */ | |||
| <CODE ENDS> | <CODE ENDS> | |||
| <CODE BEGINS> file "FNV64.c" | <CODE BEGINS> file "FNV64.c" | |||
| //*************************** FNV64.c ****************************// | //*************************** FNV64.c ****************************// | |||
| //****************** See RFC 9923 for details. *******************// | //****************** See RFC 9923 for details. *******************// | |||
| /* Copyright (c) 2016, 2024, 2025 IETF Trust and the persons | /* Copyright (c) 2016-2025 IETF Trust and the persons | |||
| * identified as authors of the code. All rights reserved. | * identified as authors of the code. All rights reserved. | |||
| * See fnv-private.h for terms of use and redistribution. | * See fnv-private.h for terms of use and redistribution. | |||
| */ | */ | |||
| /* This file implements the FNV (Fowler/Noll/Vo) non-cryptographic | /* This file implements the FNV (Fowler/Noll/Vo) non-cryptographic | |||
| * hash function FNV-1a for 64-bit hashes. | * hash function FNV-1a for 64-bit hashes. | |||
| */ | */ | |||
| #include <stdio.h> | #include <stdio.h> | |||
| skipping to change at line 2326 ¶ | skipping to change at line 2326 ¶ | |||
| <CODE ENDS> | <CODE ENDS> | |||
| 8.2.3. FNV128 Code | 8.2.3. FNV128 Code | |||
| The following code is the header and C source for 128-bit FNV-1a | The following code is the header and C source for 128-bit FNV-1a | |||
| providing a byte vector hash. | providing a byte vector hash. | |||
| <CODE BEGINS> file "FNV128.h" | <CODE BEGINS> file "FNV128.h" | |||
| //************************** FNV128.h ************************// | //************************** FNV128.h ************************// | |||
| //*************** See RFC 9923 for details. ******************// | //*************** See RFC 9923 for details. ******************// | |||
| /* Copyright (c) 2016, 2024, 2025 IETF Trust and the persons | /* Copyright (c) 2016-2025 IETF Trust and the persons | |||
| * identified as authors of the code. All rights reserved. | * identified as authors of the code. All rights reserved. | |||
| * See fnv-private.h for terms of use and redistribution. | * See fnv-private.h for terms of use and redistribution. | |||
| */ | */ | |||
| #ifndef _FNV128_H_ | #ifndef _FNV128_H_ | |||
| #define _FNV128_H_ | #define _FNV128_H_ | |||
| /* | /* | |||
| * Description: | * Description: | |||
| * This file provides headers for the 128-bit version of | * This file provides headers for the 128-bit version of | |||
| skipping to change at line 2444 ¶ | skipping to change at line 2444 ¶ | |||
| #ifdef __cplusplus | #ifdef __cplusplus | |||
| } | } | |||
| #endif | #endif | |||
| #endif /* _FNV128_H_ */ | #endif /* _FNV128_H_ */ | |||
| <CODE ENDS> | <CODE ENDS> | |||
| <CODE BEGINS> file "FNV128.c" | <CODE BEGINS> file "FNV128.c" | |||
| //**************************** FNV128.c **************************// | //**************************** FNV128.c **************************// | |||
| //******************* See RFC 9923 for details. ******************// | //******************* See RFC 9923 for details. ******************// | |||
| /* Copyright (c) 2016, 2024, 2025 IETF Trust and the persons | /* Copyright (c) 2016-2025 IETF Trust and the persons | |||
| * identified as authors of the code. All rights reserved. | * identified as authors of the code. All rights reserved. | |||
| * See fnv-private.h for terms of use and redistribution. | * See fnv-private.h for terms of use and redistribution. | |||
| */ | */ | |||
| /* This file implements the FNV (Fowler/Noll/Vo) non-cryptographic | /* This file implements the FNV (Fowler/Noll/Vo) non-cryptographic | |||
| * hash function FNV-1a for 128-bit hashes. | * hash function FNV-1a for 128-bit hashes. | |||
| */ | */ | |||
| #include <stdio.h> | #include <stdio.h> | |||
| skipping to change at line 2902 ¶ | skipping to change at line 2902 ¶ | |||
| <CODE ENDS> | <CODE ENDS> | |||
| 8.2.4. FNV256 Code | 8.2.4. FNV256 Code | |||
| The following code is the header and C source for 256-bit FNV-1a | The following code is the header and C source for 256-bit FNV-1a | |||
| providing a byte vector hash. | providing a byte vector hash. | |||
| <CODE BEGINS> file "FNV256.h" | <CODE BEGINS> file "FNV256.h" | |||
| //************************* FNV256.h ***********************// | //************************* FNV256.h ***********************// | |||
| //************** See RFC 9923 for details. *****************// | //************** See RFC 9923 for details. *****************// | |||
| /* Copyright (c) 2016, 2024, 2025 IETF Trust and the persons | /* Copyright (c) 2016-2025 IETF Trust and the persons | |||
| * identified as authors of the code. All rights reserved. | * identified as authors of the code. All rights reserved. | |||
| * See fnv-private.h for terms of use and redistribution. | * See fnv-private.h for terms of use and redistribution. | |||
| */ | */ | |||
| #ifndef _FNV256_H_ | #ifndef _FNV256_H_ | |||
| #define _FNV256_H_ | #define _FNV256_H_ | |||
| /* | /* | |||
| * Description: | * Description: | |||
| * This file provides headers for the 256-bit version of | * This file provides headers for the 256-bit version of | |||
| skipping to change at line 3020 ¶ | skipping to change at line 3020 ¶ | |||
| #ifdef __cplusplus | #ifdef __cplusplus | |||
| } | } | |||
| #endif | #endif | |||
| #endif /* _FNV256_H_ */ | #endif /* _FNV256_H_ */ | |||
| <CODE ENDS> | <CODE ENDS> | |||
| <CODE BEGINS> file "FNV256.c" | <CODE BEGINS> file "FNV256.c" | |||
| //**************************** FNV256.c **************************// | //**************************** FNV256.c **************************// | |||
| //******************* See RFC 9923 for details. ******************// | //******************* See RFC 9923 for details. ******************// | |||
| /* Copyright (c) 2016, 2024, 2025 IETF Trust and the persons | /* Copyright (c) 2016-2025 IETF Trust and the persons | |||
| * identified as authors of the code. All rights reserved. | * identified as authors of the code. All rights reserved. | |||
| * See fnv-private.h for terms of use and redistribution. | * See fnv-private.h for terms of use and redistribution. | |||
| */ | */ | |||
| /* This file implements the FNV (Fowler/Noll/Vo) non-cryptographic | /* This file implements the FNV (Fowler/Noll/Vo) non-cryptographic | |||
| * hash function FNV-1a for 256-bit hashes. | * hash function FNV-1a for 256-bit hashes. | |||
| */ | */ | |||
| #include <stdio.h> | #include <stdio.h> | |||
| skipping to change at line 3483 ¶ | skipping to change at line 3483 ¶ | |||
| <CODE ENDS> | <CODE ENDS> | |||
| 8.2.5. FNV512 Code | 8.2.5. FNV512 Code | |||
| The following code is the header and C source for 512-bit FNV-1a | The following code is the header and C source for 512-bit FNV-1a | |||
| providing a byte vector hash. | providing a byte vector hash. | |||
| <CODE BEGINS> file "FNV512.h" | <CODE BEGINS> file "FNV512.h" | |||
| //************************* FNV512.h ***********************// | //************************* FNV512.h ***********************// | |||
| //************** See RFC 9923 for details. *****************// | //************** See RFC 9923 for details. *****************// | |||
| /* Copyright (c) 2016, 2024, 2025 IETF Trust and the persons | /* Copyright (c) 2016-2025 IETF Trust and the persons | |||
| * identified as authors of the code. All rights reserved. | * identified as authors of the code. All rights reserved. | |||
| * See fnv-private.h for terms of use and redistribution. | * See fnv-private.h for terms of use and redistribution. | |||
| */ | */ | |||
| #ifndef _FNV512_H_ | #ifndef _FNV512_H_ | |||
| #define _FNV512_H_ | #define _FNV512_H_ | |||
| /* | /* | |||
| * Description: | * Description: | |||
| * This file provides headers for the 512-bit version of | * This file provides headers for the 512-bit version of | |||
| skipping to change at line 3601 ¶ | skipping to change at line 3601 ¶ | |||
| #ifdef __cplusplus | #ifdef __cplusplus | |||
| } | } | |||
| #endif | #endif | |||
| #endif /* _FNV512_H_ */ | #endif /* _FNV512_H_ */ | |||
| <CODE ENDS> | <CODE ENDS> | |||
| <CODE BEGINS> file "FNV512.c" | <CODE BEGINS> file "FNV512.c" | |||
| //**************************** FNV512.c **************************// | //**************************** FNV512.c **************************// | |||
| //******************* See RFC 9923 for details. ******************// | //******************* See RFC 9923 for details. ******************// | |||
| /* Copyright (c) 2016, 2024, 2025 IETF Trust and the persons | /* Copyright (c) 2016-2025 IETF Trust and the persons | |||
| * identified as authors of the code. All rights reserved. | * identified as authors of the code. All rights reserved. | |||
| * See fnv-private.h for terms of use and redistribution. | * See fnv-private.h for terms of use and redistribution. | |||
| */ | */ | |||
| /* This file implements the FNV (Fowler/Noll/Vo) non-cryptographic | /* This file implements the FNV (Fowler/Noll/Vo) non-cryptographic | |||
| * hash function FNV-1a for 512-bit hashes. | * hash function FNV-1a for 512-bit hashes. | |||
| */ | */ | |||
| #include <stdio.h> | #include <stdio.h> | |||
| skipping to change at line 4071 ¶ | skipping to change at line 4071 ¶ | |||
| <CODE ENDS> | <CODE ENDS> | |||
| 8.2.6. FNV1024 Code | 8.2.6. FNV1024 Code | |||
| The following code is the header and C source for 1024-bit FNV-1a | The following code is the header and C source for 1024-bit FNV-1a | |||
| providing a byte vector hash. | providing a byte vector hash. | |||
| <CODE BEGINS> file "FNV1024.h" | <CODE BEGINS> file "FNV1024.h" | |||
| //*********************** FNV1024.h ***********************// | //*********************** FNV1024.h ***********************// | |||
| //************* See RFC 9923 for details. *****************// | //************* See RFC 9923 for details. *****************// | |||
| /* Copyright (c) 2016, 2024, 2025 IETF Trust and the persons | /* Copyright (c) 2016-2025 IETF Trust and the persons | |||
| * identified as authors of the code. All rights reserved. | * identified as authors of the code. All rights reserved. | |||
| * See fnv-private.h for terms of use and redistribution. | * See fnv-private.h for terms of use and redistribution. | |||
| */ | */ | |||
| #ifndef _FNV1024_H_ | #ifndef _FNV1024_H_ | |||
| #define _FNV1024_H_ | #define _FNV1024_H_ | |||
| /* | /* | |||
| * Description: | * Description: | |||
| * This file provides headers for the 1024-bit version of | * This file provides headers for the 1024-bit version of | |||
| skipping to change at line 4189 ¶ | skipping to change at line 4189 ¶ | |||
| #ifdef __cplusplus | #ifdef __cplusplus | |||
| } | } | |||
| #endif | #endif | |||
| #endif /* _FNV1024_H_ */ | #endif /* _FNV1024_H_ */ | |||
| <CODE ENDS> | <CODE ENDS> | |||
| <CODE BEGINS> file "FNV1024.c" | <CODE BEGINS> file "FNV1024.c" | |||
| //************************** FNV1024.c **************************// | //************************** FNV1024.c **************************// | |||
| //****************** See RFC 9923 for details. ******************// | //****************** See RFC 9923 for details. ******************// | |||
| /* Copyright (c) 2016, 2024, 2025 IETF Trust and the persons | /* Copyright (c) 2016-2025 IETF Trust and the persons | |||
| * identified as authors of the code. All rights reserved. | * identified as authors of the code. All rights reserved. | |||
| * See fnv-private.h for terms of use and redistribution. | * See fnv-private.h for terms of use and redistribution. | |||
| */ | */ | |||
| /* This file implements the FNV (Fowler/Noll/Vo) non-cryptographic | /* This file implements the FNV (Fowler/Noll/Vo) non-cryptographic | |||
| * hash function FNV-1a for 1024-bit hashes. | * hash function FNV-1a for 1024-bit hashes. | |||
| */ | */ | |||
| #include <stdio.h> | #include <stdio.h> | |||
| skipping to change at line 4677 ¶ | skipping to change at line 4677 ¶ | |||
| 8.3. FNV Test Code | 8.3. FNV Test Code | |||
| Below is source code for a test driver with a command line interface | Below is source code for a test driver with a command line interface | |||
| as documented in Section 8.1.3. By default, with no command line | as documented in Section 8.1.3. By default, with no command line | |||
| arguments, it runs tests of all FNV lengths. | arguments, it runs tests of all FNV lengths. | |||
| <CODE BEGINS> file "main.c" | <CODE BEGINS> file "main.c" | |||
| //************************* Main.c **************************// | //************************* Main.c **************************// | |||
| //*************** See RFC 9923 for details. *****************// | //*************** See RFC 9923 for details. *****************// | |||
| /* Copyright (c) 2016, 2024, 2025 IETF Trust and the persons | /* Copyright (c) 2016-2025 IETF Trust and the persons | |||
| * identified as authors of the code. All rights reserved. | * identified as authors of the code. All rights reserved. | |||
| * See fnv-private.h for terms of use and redistribution. | * See fnv-private.h for terms of use and redistribution. | |||
| */ | */ | |||
| #include <ctype.h> | #include <ctype.h> | |||
| #include <stdio.h> | #include <stdio.h> | |||
| #include <stdlib.h> | #include <stdlib.h> | |||
| #include <string.h> | #include <string.h> | |||
| #include <unistd.h> | #include <unistd.h> | |||
| #include <errno.h> | #include <errno.h> | |||
| End of changes. 16 change blocks. | ||||
| 16 lines changed or deleted | 16 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. | ||||