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