1ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen/* 2ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * crypto.h - public data structures and prototypes for the crypto library 3ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * 4ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * ***** BEGIN LICENSE BLOCK ***** 5ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * Version: MPL 1.1/GPL 2.0/LGPL 2.1 6ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * 7ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * The contents of this file are subject to the Mozilla Public License Version 8ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * 1.1 (the "License"); you may not use this file except in compliance with 9ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * the License. You may obtain a copy of the License at 10ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * http://www.mozilla.org/MPL/ 11ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * 12ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * Software distributed under the License is distributed on an "AS IS" basis, 13ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 14ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * for the specific language governing rights and limitations under the 15ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * License. 16ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * 17ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * The Original Code is the Netscape security libraries. 18ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * 19ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * The Initial Developer of the Original Code is 20ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * Netscape Communications Corporation. 21ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * Portions created by the Initial Developer are Copyright (C) 1994-2000 22ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * the Initial Developer. All Rights Reserved. 23ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * 24ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * Contributor(s): 25ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * Dr Vipul Gupta <vipul.gupta@sun.com>, Sun Microsystems Laboratories 26ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * 27ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * Alternatively, the contents of this file may be used under the terms of 28ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * either the GNU General Public License Version 2 or later (the "GPL"), or 29ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 30ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * in which case the provisions of the GPL or the LGPL are applicable instead 31ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * of those above. If you wish to allow use of your version of this file only 32ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * under the terms of either the GPL or the LGPL, and not to allow others to 33ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * use your version of this file under the terms of the MPL, indicate your 34ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * decision by deleting the provisions above and replace them with the notice 35ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * and other provisions required by the GPL or the LGPL. If you do not delete 36ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * the provisions above, a recipient may use your version of this file under 37ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * the terms of any one of the MPL, the GPL or the LGPL. 38ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * 39ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen * ***** END LICENSE BLOCK ***** */ 40ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen/* $Id: blapi.h,v 1.27 2007/11/09 18:49:32 wtc%google.com Exp $ */ 41ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen 42ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen#ifndef _BLAPI_H_ 43ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen#define _BLAPI_H_ 44ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen 45ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen#include "crypto/third_party/nss/blapit.h" 46ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen 47ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen/******************************************/ 48ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen 49ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern SHA256Context *SHA256_NewContext(void); 50ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA256_DestroyContext(SHA256Context *cx, PRBool freeit); 51ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA256_Begin(SHA256Context *cx); 52ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA256_Update(SHA256Context *cx, const unsigned char *input, 53ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen unsigned int inputLen); 54ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA256_End(SHA256Context *cx, unsigned char *digest, 55ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen unsigned int *digestLen, unsigned int maxDigestLen); 56ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern SECStatus SHA256_HashBuf(unsigned char *dest, const unsigned char *src, 57ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen unsigned int src_length); 58ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern SECStatus SHA256_Hash(unsigned char *dest, const char *src); 59ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA256_TraceState(SHA256Context *cx); 60ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern unsigned int SHA256_FlattenSize(SHA256Context *cx); 61ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern SECStatus SHA256_Flatten(SHA256Context *cx,unsigned char *space); 62ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern SHA256Context * SHA256_Resurrect(unsigned char *space, void *arg); 63ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA256_Clone(SHA256Context *dest, SHA256Context *src); 64ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen 65ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen/******************************************/ 66ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen 67ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern SHA512Context *SHA512_NewContext(void); 68ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA512_DestroyContext(SHA512Context *cx, PRBool freeit); 69ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA512_Begin(SHA512Context *cx); 70ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA512_Update(SHA512Context *cx, const unsigned char *input, 71ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen unsigned int inputLen); 72ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA512_End(SHA512Context *cx, unsigned char *digest, 73ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen unsigned int *digestLen, unsigned int maxDigestLen); 74ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern SECStatus SHA512_HashBuf(unsigned char *dest, const unsigned char *src, 75ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen unsigned int src_length); 76ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern SECStatus SHA512_Hash(unsigned char *dest, const char *src); 77ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA512_TraceState(SHA512Context *cx); 78ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern unsigned int SHA512_FlattenSize(SHA512Context *cx); 79ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern SECStatus SHA512_Flatten(SHA512Context *cx,unsigned char *space); 80ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern SHA512Context * SHA512_Resurrect(unsigned char *space, void *arg); 81ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA512_Clone(SHA512Context *dest, SHA512Context *src); 82ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen 83ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen/******************************************/ 84ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen 85ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern SHA384Context *SHA384_NewContext(void); 86ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA384_DestroyContext(SHA384Context *cx, PRBool freeit); 87ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA384_Begin(SHA384Context *cx); 88ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA384_Update(SHA384Context *cx, const unsigned char *input, 89ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen unsigned int inputLen); 90ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA384_End(SHA384Context *cx, unsigned char *digest, 91ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen unsigned int *digestLen, unsigned int maxDigestLen); 92ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern SECStatus SHA384_HashBuf(unsigned char *dest, const unsigned char *src, 93ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen unsigned int src_length); 94ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern SECStatus SHA384_Hash(unsigned char *dest, const char *src); 95ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA384_TraceState(SHA384Context *cx); 96ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern unsigned int SHA384_FlattenSize(SHA384Context *cx); 97ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern SECStatus SHA384_Flatten(SHA384Context *cx,unsigned char *space); 98ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern SHA384Context * SHA384_Resurrect(unsigned char *space, void *arg); 99ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsenextern void SHA384_Clone(SHA384Context *dest, SHA384Context *src); 100ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen 101ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen#endif /* _BLAPI_H_ */ 102