1*4afad4b7Schristos /* $NetBSD: crc64.h,v 1.1 2024/02/18 20:57:52 christos Exp $ */ 2*4afad4b7Schristos 3*4afad4b7Schristos /* 4*4afad4b7Schristos * Copyright (C) Internet Systems Consortium, Inc. ("ISC") 5*4afad4b7Schristos * 6*4afad4b7Schristos * SPDX-License-Identifier: MPL-2.0 7*4afad4b7Schristos * 8*4afad4b7Schristos * This Source Code Form is subject to the terms of the Mozilla Public 9*4afad4b7Schristos * License, v. 2.0. If a copy of the MPL was not distributed with this 10*4afad4b7Schristos * file, you can obtain one at https://mozilla.org/MPL/2.0/. 11*4afad4b7Schristos * 12*4afad4b7Schristos * See the COPYRIGHT file distributed with this work for additional 13*4afad4b7Schristos * information regarding copyright ownership. 14*4afad4b7Schristos */ 15*4afad4b7Schristos 16*4afad4b7Schristos #ifndef ISC_CRC64_H 17*4afad4b7Schristos #define ISC_CRC64_H 1 18*4afad4b7Schristos 19*4afad4b7Schristos /*! \file isc/crc64.h 20*4afad4b7Schristos * \brief CRC64 in C 21*4afad4b7Schristos */ 22*4afad4b7Schristos 23*4afad4b7Schristos #include <inttypes.h> 24*4afad4b7Schristos 25*4afad4b7Schristos #include <isc/lang.h> 26*4afad4b7Schristos #include <isc/types.h> 27*4afad4b7Schristos 28*4afad4b7Schristos ISC_LANG_BEGINDECLS 29*4afad4b7Schristos 30*4afad4b7Schristos void 31*4afad4b7Schristos isc_crc64_init(uint64_t *crc); 32*4afad4b7Schristos /*% 33*4afad4b7Schristos * Initialize a new CRC. 34*4afad4b7Schristos * 35*4afad4b7Schristos * Requires: 36*4afad4b7Schristos * * 'crc' is not NULL. 37*4afad4b7Schristos */ 38*4afad4b7Schristos 39*4afad4b7Schristos void 40*4afad4b7Schristos isc_crc64_update(uint64_t *crc, const void *data, size_t len); 41*4afad4b7Schristos /*% 42*4afad4b7Schristos * Add data to the CRC. 43*4afad4b7Schristos * 44*4afad4b7Schristos * Requires: 45*4afad4b7Schristos * * 'crc' is not NULL. 46*4afad4b7Schristos * * 'data' is not NULL. 47*4afad4b7Schristos */ 48*4afad4b7Schristos 49*4afad4b7Schristos void 50*4afad4b7Schristos isc_crc64_final(uint64_t *crc); 51*4afad4b7Schristos /*% 52*4afad4b7Schristos * Finalize the CRC. 53*4afad4b7Schristos * 54*4afad4b7Schristos * Requires: 55*4afad4b7Schristos * * 'crc' is not NULL. 56*4afad4b7Schristos */ 57*4afad4b7Schristos 58*4afad4b7Schristos ISC_LANG_ENDDECLS 59*4afad4b7Schristos 60*4afad4b7Schristos #endif /* ISC_CRC64_H */ 61