Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/bind9/isc
File: sha2.h
/*
[0] Fix | Delete
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
[1] Fix | Delete
*
[2] Fix | Delete
* This Source Code Form is subject to the terms of the Mozilla Public
[3] Fix | Delete
* License, v. 2.0. If a copy of the MPL was not distributed with this
[4] Fix | Delete
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
[5] Fix | Delete
*
[6] Fix | Delete
* See the COPYRIGHT file distributed with this work for additional
[7] Fix | Delete
* information regarding copyright ownership.
[8] Fix | Delete
*/
[9] Fix | Delete
[10] Fix | Delete
[11] Fix | Delete
/* $FreeBSD: src/sys/crypto/sha2/sha2.h,v 1.1.2.1 2001/07/03 11:01:36 ume Exp $ */
[12] Fix | Delete
/* $KAME: sha2.h,v 1.3 2001/03/12 08:27:48 itojun Exp $ */
[13] Fix | Delete
[14] Fix | Delete
/*
[15] Fix | Delete
* sha2.h
[16] Fix | Delete
*
[17] Fix | Delete
* Version 1.0.0beta1
[18] Fix | Delete
*
[19] Fix | Delete
* Written by Aaron D. Gifford <me@aarongifford.com>
[20] Fix | Delete
*
[21] Fix | Delete
* Copyright 2000 Aaron D. Gifford. All rights reserved.
[22] Fix | Delete
*
[23] Fix | Delete
* Redistribution and use in source and binary forms, with or without
[24] Fix | Delete
* modification, are permitted provided that the following conditions
[25] Fix | Delete
* are met:
[26] Fix | Delete
* 1. Redistributions of source code must retain the above copyright
[27] Fix | Delete
* notice, this list of conditions and the following disclaimer.
[28] Fix | Delete
* 2. Redistributions in binary form must reproduce the above copyright
[29] Fix | Delete
* notice, this list of conditions and the following disclaimer in the
[30] Fix | Delete
* documentation and/or other materials provided with the distribution.
[31] Fix | Delete
* 3. Neither the name of the copyright holder nor the names of contributors
[32] Fix | Delete
* may be used to endorse or promote products derived from this software
[33] Fix | Delete
* without specific prior written permission.
[34] Fix | Delete
*
[35] Fix | Delete
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTOR(S) ``AS IS'' AND
[36] Fix | Delete
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
[37] Fix | Delete
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
[38] Fix | Delete
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTOR(S) BE LIABLE
[39] Fix | Delete
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
[40] Fix | Delete
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
[41] Fix | Delete
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
[42] Fix | Delete
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
[43] Fix | Delete
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
[44] Fix | Delete
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
[45] Fix | Delete
* SUCH DAMAGE.
[46] Fix | Delete
*
[47] Fix | Delete
*/
[48] Fix | Delete
[49] Fix | Delete
#ifndef ISC_SHA2_H
[50] Fix | Delete
#define ISC_SHA2_H
[51] Fix | Delete
[52] Fix | Delete
#include <inttypes.h>
[53] Fix | Delete
[54] Fix | Delete
#include <isc/lang.h>
[55] Fix | Delete
#include <isc/platform.h>
[56] Fix | Delete
#include <isc/types.h>
[57] Fix | Delete
[58] Fix | Delete
/*** SHA-224/256/384/512 Various Length Definitions ***********************/
[59] Fix | Delete
[60] Fix | Delete
#define ISC_SHA224_BLOCK_LENGTH 64U
[61] Fix | Delete
#define ISC_SHA224_DIGESTLENGTH 28U
[62] Fix | Delete
#define ISC_SHA224_DIGESTSTRINGLENGTH (ISC_SHA224_DIGESTLENGTH * 2 + 1)
[63] Fix | Delete
#define ISC_SHA256_BLOCK_LENGTH 64U
[64] Fix | Delete
#define ISC_SHA256_DIGESTLENGTH 32U
[65] Fix | Delete
#define ISC_SHA256_DIGESTSTRINGLENGTH (ISC_SHA256_DIGESTLENGTH * 2 + 1)
[66] Fix | Delete
#define ISC_SHA384_BLOCK_LENGTH 128
[67] Fix | Delete
#define ISC_SHA384_DIGESTLENGTH 48U
[68] Fix | Delete
#define ISC_SHA384_DIGESTSTRINGLENGTH (ISC_SHA384_DIGESTLENGTH * 2 + 1)
[69] Fix | Delete
#define ISC_SHA512_BLOCK_LENGTH 128U
[70] Fix | Delete
#define ISC_SHA512_DIGESTLENGTH 64U
[71] Fix | Delete
#define ISC_SHA512_DIGESTSTRINGLENGTH (ISC_SHA512_DIGESTLENGTH * 2 + 1)
[72] Fix | Delete
[73] Fix | Delete
/*** SHA-256/384/512 Context Structures *******************************/
[74] Fix | Delete
[75] Fix | Delete
#if defined(ISC_PLATFORM_OPENSSLHASH)
[76] Fix | Delete
#include <openssl/opensslv.h>
[77] Fix | Delete
#include <openssl/evp.h>
[78] Fix | Delete
#endif
[79] Fix | Delete
[80] Fix | Delete
#if defined(ISC_PLATFORM_OPENSSLHASH) && !defined(LIBRESSL_VERSION_NUMBER)
[81] Fix | Delete
[82] Fix | Delete
[83] Fix | Delete
typedef struct {
[84] Fix | Delete
EVP_MD_CTX *ctx;
[85] Fix | Delete
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
[86] Fix | Delete
EVP_MD_CTX _ctx;
[87] Fix | Delete
#endif
[88] Fix | Delete
} isc_sha2_t;
[89] Fix | Delete
[90] Fix | Delete
typedef isc_sha2_t isc_sha256_t;
[91] Fix | Delete
typedef isc_sha2_t isc_sha512_t;
[92] Fix | Delete
[93] Fix | Delete
#elif PKCS11CRYPTO
[94] Fix | Delete
#include <pk11/pk11.h>
[95] Fix | Delete
[96] Fix | Delete
typedef pk11_context_t isc_sha256_t;
[97] Fix | Delete
typedef pk11_context_t isc_sha512_t;
[98] Fix | Delete
[99] Fix | Delete
#else
[100] Fix | Delete
[101] Fix | Delete
/*
[102] Fix | Delete
* Keep buffer immediately after bitcount to preserve alignment.
[103] Fix | Delete
*/
[104] Fix | Delete
typedef struct {
[105] Fix | Delete
uint32_t state[8];
[106] Fix | Delete
uint64_t bitcount;
[107] Fix | Delete
uint8_t buffer[ISC_SHA256_BLOCK_LENGTH];
[108] Fix | Delete
} isc_sha256_t;
[109] Fix | Delete
[110] Fix | Delete
/*
[111] Fix | Delete
* Keep buffer immediately after bitcount to preserve alignment.
[112] Fix | Delete
*/
[113] Fix | Delete
typedef struct {
[114] Fix | Delete
uint64_t state[8];
[115] Fix | Delete
uint64_t bitcount[2];
[116] Fix | Delete
uint8_t buffer[ISC_SHA512_BLOCK_LENGTH];
[117] Fix | Delete
} isc_sha512_t;
[118] Fix | Delete
#endif
[119] Fix | Delete
[120] Fix | Delete
typedef isc_sha256_t isc_sha224_t;
[121] Fix | Delete
typedef isc_sha512_t isc_sha384_t;
[122] Fix | Delete
[123] Fix | Delete
ISC_LANG_BEGINDECLS
[124] Fix | Delete
[125] Fix | Delete
/*** SHA-224/256/384/512 Function Prototypes ******************************/
[126] Fix | Delete
[127] Fix | Delete
void isc_sha224_init (isc_sha224_t *);
[128] Fix | Delete
void isc_sha224_invalidate (isc_sha224_t *);
[129] Fix | Delete
void isc_sha224_update (isc_sha224_t *, const uint8_t *, size_t);
[130] Fix | Delete
void isc_sha224_final (uint8_t[ISC_SHA224_DIGESTLENGTH], isc_sha224_t *);
[131] Fix | Delete
char *isc_sha224_end (isc_sha224_t *, char[ISC_SHA224_DIGESTSTRINGLENGTH]);
[132] Fix | Delete
char *isc_sha224_data (const uint8_t *, size_t, char[ISC_SHA224_DIGESTSTRINGLENGTH]);
[133] Fix | Delete
[134] Fix | Delete
void isc_sha256_init (isc_sha256_t *);
[135] Fix | Delete
void isc_sha256_invalidate (isc_sha256_t *);
[136] Fix | Delete
void isc_sha256_update (isc_sha256_t *, const uint8_t *, size_t);
[137] Fix | Delete
void isc_sha256_final (uint8_t[ISC_SHA256_DIGESTLENGTH], isc_sha256_t *);
[138] Fix | Delete
char *isc_sha256_end (isc_sha256_t *, char[ISC_SHA256_DIGESTSTRINGLENGTH]);
[139] Fix | Delete
char *isc_sha256_data (const uint8_t *, size_t, char[ISC_SHA256_DIGESTSTRINGLENGTH]);
[140] Fix | Delete
[141] Fix | Delete
void isc_sha384_init (isc_sha384_t *);
[142] Fix | Delete
void isc_sha384_invalidate (isc_sha384_t *);
[143] Fix | Delete
void isc_sha384_update (isc_sha384_t *, const uint8_t *, size_t);
[144] Fix | Delete
void isc_sha384_final (uint8_t[ISC_SHA384_DIGESTLENGTH], isc_sha384_t *);
[145] Fix | Delete
char *isc_sha384_end (isc_sha384_t *, char[ISC_SHA384_DIGESTSTRINGLENGTH]);
[146] Fix | Delete
char *isc_sha384_data (const uint8_t *, size_t, char[ISC_SHA384_DIGESTSTRINGLENGTH]);
[147] Fix | Delete
[148] Fix | Delete
void isc_sha512_init (isc_sha512_t *);
[149] Fix | Delete
void isc_sha512_invalidate (isc_sha512_t *);
[150] Fix | Delete
void isc_sha512_update (isc_sha512_t *, const uint8_t *, size_t);
[151] Fix | Delete
void isc_sha512_final (uint8_t[ISC_SHA512_DIGESTLENGTH], isc_sha512_t *);
[152] Fix | Delete
char *isc_sha512_end (isc_sha512_t *, char[ISC_SHA512_DIGESTSTRINGLENGTH]);
[153] Fix | Delete
char *isc_sha512_data (const uint8_t *, size_t, char[ISC_SHA512_DIGESTSTRINGLENGTH]);
[154] Fix | Delete
[155] Fix | Delete
ISC_LANG_ENDDECLS
[156] Fix | Delete
[157] Fix | Delete
#endif /* ISC_SHA2_H */
[158] Fix | Delete
[159] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function