OLD | NEW |
1 /* | 1 /* |
2 * crypto.h - public data structures and prototypes for the crypto library | 2 * crypto.h - public data structures and prototypes for the crypto library |
3 * | 3 * |
4 * This Source Code Form is subject to the terms of the Mozilla Public | 4 * This Source Code Form is subject to the terms of the Mozilla Public |
5 * License, v. 2.0. If a copy of the MPL was not distributed with this | 5 * License, v. 2.0. If a copy of the MPL was not distributed with this |
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
7 | 7 |
8 #ifndef _BLAPI_H_ | 8 #ifndef _BLAPI_H_ |
9 #define _BLAPI_H_ | 9 #define _BLAPI_H_ |
10 | 10 |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 ** "maxOutputLen" the maximum amount of data that can ever be | 811 ** "maxOutputLen" the maximum amount of data that can ever be |
812 ** stored in "output" | 812 ** stored in "output" |
813 ** "input" the input data | 813 ** "input" the input data |
814 ** "inputLen" the amount of input data | 814 ** "inputLen" the amount of input data |
815 */ | 815 */ |
816 extern SECStatus | 816 extern SECStatus |
817 Camellia_Decrypt(CamelliaContext *cx, unsigned char *output, | 817 Camellia_Decrypt(CamelliaContext *cx, unsigned char *output, |
818 unsigned int *outputLen, unsigned int maxOutputLen, | 818 unsigned int *outputLen, unsigned int maxOutputLen, |
819 const unsigned char *input, unsigned int inputLen); | 819 const unsigned char *input, unsigned int inputLen); |
820 | 820 |
| 821 /******************************************/ |
| 822 /* |
| 823 ** ChaCha20+Poly1305 AEAD |
| 824 */ |
| 825 |
| 826 extern SECStatus |
| 827 ChaCha20Poly1305_InitContext(ChaCha20Poly1305Context *ctx, |
| 828 const unsigned char *key, unsigned int keyLen, |
| 829 unsigned int tagLen); |
| 830 |
| 831 extern ChaCha20Poly1305Context * |
| 832 ChaCha20Poly1305_CreateContext(const unsigned char *key, unsigned int keyLen, |
| 833 unsigned int tagLen); |
| 834 |
| 835 extern void |
| 836 ChaCha20Poly1305_DestroyContext(ChaCha20Poly1305Context *ctx, PRBool freeit); |
| 837 |
| 838 extern SECStatus |
| 839 ChaCha20Poly1305_Seal(const ChaCha20Poly1305Context *ctx, |
| 840 unsigned char *output, unsigned int *outputLen, |
| 841 unsigned int maxOutputLen, |
| 842 const unsigned char *input, unsigned int inputLen, |
| 843 const unsigned char *nonce, unsigned int nonceLen, |
| 844 const unsigned char *ad, unsigned int adLen); |
| 845 |
| 846 extern SECStatus |
| 847 ChaCha20Poly1305_Open(const ChaCha20Poly1305Context *ctx, |
| 848 unsigned char *output, unsigned int *outputLen, |
| 849 unsigned int maxOutputLen, |
| 850 const unsigned char *input, unsigned int inputLen, |
| 851 const unsigned char *nonce, unsigned int nonceLen, |
| 852 const unsigned char *ad, unsigned int adLen); |
821 | 853 |
822 /******************************************/ | 854 /******************************************/ |
823 /* | 855 /* |
824 ** MD5 secure hash function | 856 ** MD5 secure hash function |
825 */ | 857 */ |
826 | 858 |
827 /* | 859 /* |
828 ** Hash a null terminated string "src" into "dest" using MD5 | 860 ** Hash a null terminated string "src" into "dest" using MD5 |
829 */ | 861 */ |
830 extern SECStatus MD5_Hash(unsigned char *dest, const char *src); | 862 extern SECStatus MD5_Hash(unsigned char *dest, const char *src); |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1404 PRBool BLAPI_VerifySelf(const char *name); | 1436 PRBool BLAPI_VerifySelf(const char *name); |
1405 | 1437 |
1406 /*********************************************************************/ | 1438 /*********************************************************************/ |
1407 extern const SECHashObject * HASH_GetRawHashObject(HASH_HashType hashType); | 1439 extern const SECHashObject * HASH_GetRawHashObject(HASH_HashType hashType); |
1408 | 1440 |
1409 extern void BL_SetForkState(PRBool forked); | 1441 extern void BL_SetForkState(PRBool forked); |
1410 | 1442 |
1411 SEC_END_PROTOS | 1443 SEC_END_PROTOS |
1412 | 1444 |
1413 #endif /* _BLAPI_H_ */ | 1445 #endif /* _BLAPI_H_ */ |
OLD | NEW |