OLD | NEW |
| (Empty) |
1 /* | |
2 * arcfive.c - stubs for RC5 - NOT a working implementation! | |
3 * | |
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 | |
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
7 /* $Id: arcfive.c,v 1.7 2012/04/25 14:49:43 gerv%gerv.net Exp $ */ | |
8 | |
9 #ifdef FREEBL_NO_DEPEND | |
10 #include "stubs.h" | |
11 #endif | |
12 | |
13 #include "blapi.h" | |
14 #include "prerror.h" | |
15 | |
16 /******************************************/ | |
17 /* | |
18 ** RC5 symmetric block cypher -- 64-bit block size | |
19 */ | |
20 | |
21 /* | |
22 ** Create a new RC5 context suitable for RC5 encryption/decryption. | |
23 ** "key" raw key data | |
24 ** "len" the number of bytes of key data | |
25 ** "iv" is the CBC initialization vector (if mode is NSS_RC5_CBC) | |
26 ** "mode" one of NSS_RC5 or NSS_RC5_CBC | |
27 ** | |
28 ** When mode is set to NSS_RC5_CBC the RC5 cipher is run in "cipher block | |
29 ** chaining" mode. | |
30 */ | |
31 RC5Context * | |
32 RC5_CreateContext(const SECItem *key, unsigned int rounds, | |
33 unsigned int wordSize, const unsigned char *iv, int mode) | |
34 { | |
35 PORT_SetError(PR_NOT_IMPLEMENTED_ERROR); | |
36 return NULL; | |
37 } | |
38 | |
39 /* | |
40 ** Destroy an RC5 encryption/decryption context. | |
41 ** "cx" the context | |
42 ** "freeit" if PR_TRUE then free the object as well as its sub-objects | |
43 */ | |
44 void | |
45 RC5_DestroyContext(RC5Context *cx, PRBool freeit) | |
46 { | |
47 PORT_SetError(PR_NOT_IMPLEMENTED_ERROR); | |
48 } | |
49 | |
50 /* | |
51 ** Perform RC5 encryption. | |
52 ** "cx" the context | |
53 ** "output" the output buffer to store the encrypted data. | |
54 ** "outputLen" how much data is stored in "output". Set by the routine | |
55 ** after some data is stored in output. | |
56 ** "maxOutputLen" the maximum amount of data that can ever be | |
57 ** stored in "output" | |
58 ** "input" the input data | |
59 ** "inputLen" the amount of input data | |
60 */ | |
61 SECStatus | |
62 RC5_Encrypt(RC5Context *cx, unsigned char *output, unsigned int *outputLen, | |
63 unsigned int maxOutputLen, | |
64 const unsigned char *input, unsigned int inputLen) | |
65 { | |
66 PORT_SetError(PR_NOT_IMPLEMENTED_ERROR); | |
67 return SECFailure; | |
68 } | |
69 | |
70 /* | |
71 ** Perform RC5 decryption. | |
72 ** "cx" the context | |
73 ** "output" the output buffer to store the decrypted data. | |
74 ** "outputLen" how much data is stored in "output". Set by the routine | |
75 ** after some data is stored in output. | |
76 ** "maxOutputLen" the maximum amount of data that can ever be | |
77 ** stored in "output" | |
78 ** "input" the input data | |
79 ** "inputLen" the amount of input data | |
80 */ | |
81 SECStatus | |
82 RC5_Decrypt(RC5Context *cx, unsigned char *output, unsigned int *outputLen, | |
83 unsigned int maxOutputLen, | |
84 const unsigned char *input, unsigned int inputLen) | |
85 { | |
86 PORT_SetError(PR_NOT_IMPLEMENTED_ERROR); | |
87 return SECFailure; | |
88 } | |
89 | |
OLD | NEW |