15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * crypto.h - public data structures and prototypes for the crypto library 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * ***** BEGIN LICENSE BLOCK ***** 55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Version: MPL 1.1/GPL 2.0/LGPL 2.1 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * The contents of this file are subject to the Mozilla Public License Version 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 1.1 (the "License"); you may not use this file except in compliance with 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the License. You may obtain a copy of the License at 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * http://www.mozilla.org/MPL/ 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Software distributed under the License is distributed on an "AS IS" basis, 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * for the specific language governing rights and limitations under the 155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * License. 165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * The Original Code is the Netscape security libraries. 185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * The Initial Developer of the Original Code is 205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Netscape Communications Corporation. 215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Portions created by the Initial Developer are Copyright (C) 1994-2000 225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the Initial Developer. All Rights Reserved. 235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Contributor(s): 255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Dr Vipul Gupta <vipul.gupta@sun.com>, Sun Microsystems Laboratories 265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Alternatively, the contents of this file may be used under the terms of 285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * either the GNU General Public License Version 2 or later (the "GPL"), or 295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * in which case the provisions of the GPL or the LGPL are applicable instead 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * of those above. If you wish to allow use of your version of this file only 325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * under the terms of either the GPL or the LGPL, and not to allow others to 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * use your version of this file under the terms of the MPL, indicate your 345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * decision by deleting the provisions above and replace them with the notice 355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * and other provisions required by the GPL or the LGPL. If you do not delete 365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the provisions above, a recipient may use your version of this file under 375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the terms of any one of the MPL, the GPL or the LGPL. 385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * ***** END LICENSE BLOCK ***** */ 405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* $Id: blapi.h,v 1.27 2007/11/09 18:49:32 wtc%google.com Exp $ */ 415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef CRYPTO_THIRD_PARTY_NSS_CHROMIUM_BLAPI_H_ 435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define CRYPTO_THIRD_PARTY_NSS_CHROMIUM_BLAPI_H_ 445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "crypto/third_party/nss/chromium-blapit.h" 465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/******************************************/ 485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern SHA256Context *SHA256_NewContext(void); 505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA256_DestroyContext(SHA256Context *cx, PRBool freeit); 515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA256_Begin(SHA256Context *cx); 525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA256_Update(SHA256Context *cx, const unsigned char *input, 535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned int inputLen); 545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA256_End(SHA256Context *cx, unsigned char *digest, 555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned int *digestLen, unsigned int maxDigestLen); 565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern SECStatus SHA256_HashBuf(unsigned char *dest, const unsigned char *src, 575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned int src_length); 585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern SECStatus SHA256_Hash(unsigned char *dest, const char *src); 595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA256_TraceState(SHA256Context *cx); 605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern unsigned int SHA256_FlattenSize(SHA256Context *cx); 615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern SECStatus SHA256_Flatten(SHA256Context *cx,unsigned char *space); 625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern SHA256Context * SHA256_Resurrect(unsigned char *space, void *arg); 635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA256_Clone(SHA256Context *dest, SHA256Context *src); 645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/******************************************/ 665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern SHA512Context *SHA512_NewContext(void); 685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA512_DestroyContext(SHA512Context *cx, PRBool freeit); 695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA512_Begin(SHA512Context *cx); 705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA512_Update(SHA512Context *cx, const unsigned char *input, 715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned int inputLen); 725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA512_End(SHA512Context *cx, unsigned char *digest, 735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned int *digestLen, unsigned int maxDigestLen); 745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern SECStatus SHA512_HashBuf(unsigned char *dest, const unsigned char *src, 755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned int src_length); 765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern SECStatus SHA512_Hash(unsigned char *dest, const char *src); 775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA512_TraceState(SHA512Context *cx); 785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern unsigned int SHA512_FlattenSize(SHA512Context *cx); 795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern SECStatus SHA512_Flatten(SHA512Context *cx,unsigned char *space); 805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern SHA512Context * SHA512_Resurrect(unsigned char *space, void *arg); 815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA512_Clone(SHA512Context *dest, SHA512Context *src); 825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/******************************************/ 845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern SHA384Context *SHA384_NewContext(void); 865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA384_DestroyContext(SHA384Context *cx, PRBool freeit); 875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA384_Begin(SHA384Context *cx); 885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA384_Update(SHA384Context *cx, const unsigned char *input, 895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned int inputLen); 905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA384_End(SHA384Context *cx, unsigned char *digest, 915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned int *digestLen, unsigned int maxDigestLen); 925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern SECStatus SHA384_HashBuf(unsigned char *dest, const unsigned char *src, 935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned int src_length); 945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern SECStatus SHA384_Hash(unsigned char *dest, const char *src); 955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA384_TraceState(SHA384Context *cx); 965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern unsigned int SHA384_FlattenSize(SHA384Context *cx); 975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern SECStatus SHA384_Flatten(SHA384Context *cx,unsigned char *space); 985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern SHA384Context * SHA384_Resurrect(unsigned char *space, void *arg); 995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)extern void SHA384_Clone(SHA384Context *dest, SHA384Context *src); 1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif /* CRYPTO_THIRD_PARTY_NSS_CHROMIUM_BLAPI_H_ */ 102