Back to index

lightning-sunbird  0.9+nobinonly
arcfive.c
Go to the documentation of this file.
00001 /*
00002  * arcfive.c - stubs for RC5 - NOT a working implementation!
00003  *
00004  * ***** BEGIN LICENSE BLOCK *****
00005  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00006  *
00007  * The contents of this file are subject to the Mozilla Public License Version
00008  * 1.1 (the "License"); you may not use this file except in compliance with
00009  * the License. You may obtain a copy of the License at
00010  * http://www.mozilla.org/MPL/
00011  *
00012  * Software distributed under the License is distributed on an "AS IS" basis,
00013  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00014  * for the specific language governing rights and limitations under the
00015  * License.
00016  *
00017  * The Original Code is the Netscape security libraries.
00018  *
00019  * The Initial Developer of the Original Code is
00020  * Netscape Communications Corporation.
00021  * Portions created by the Initial Developer are Copyright (C) 2000
00022  * the Initial Developer. All Rights Reserved.
00023  *
00024  * Contributor(s):
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either the GNU General Public License Version 2 or later (the "GPL"), or
00028  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 /* $Id: arcfive.c,v 1.5 2004/04/27 23:04:36 gerv%gerv.net Exp $ */
00040 
00041 #include "blapi.h"
00042 #include "prerror.h"
00043 
00044 /******************************************/
00045 /*
00046 ** RC5 symmetric block cypher -- 64-bit block size
00047 */
00048 
00049 /*
00050 ** Create a new RC5 context suitable for RC5 encryption/decryption.
00051 **      "key" raw key data
00052 **      "len" the number of bytes of key data
00053 **      "iv" is the CBC initialization vector (if mode is NSS_RC5_CBC)
00054 **      "mode" one of NSS_RC5 or NSS_RC5_CBC
00055 **
00056 ** When mode is set to NSS_RC5_CBC the RC5 cipher is run in "cipher block
00057 ** chaining" mode.
00058 */
00059 RC5Context *
00060 RC5_CreateContext(const SECItem *key, unsigned int rounds,
00061                   unsigned int wordSize, const unsigned char *iv, int mode)
00062 {
00063     PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
00064     return NULL;
00065 }
00066 
00067 /*
00068 ** Destroy an RC5 encryption/decryption context.
00069 **      "cx" the context
00070 **      "freeit" if PR_TRUE then free the object as well as its sub-objects
00071 */
00072 void 
00073 RC5_DestroyContext(RC5Context *cx, PRBool freeit) 
00074 {
00075     PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
00076 }
00077 
00078 /*
00079 ** Perform RC5 encryption.
00080 **      "cx" the context
00081 **      "output" the output buffer to store the encrypted data.
00082 **      "outputLen" how much data is stored in "output". Set by the routine
00083 **         after some data is stored in output.
00084 **      "maxOutputLen" the maximum amount of data that can ever be
00085 **         stored in "output"
00086 **      "input" the input data
00087 **      "inputLen" the amount of input data
00088 */
00089 SECStatus 
00090 RC5_Encrypt(RC5Context *cx, unsigned char *output, unsigned int *outputLen, 
00091            unsigned int maxOutputLen, 
00092            const unsigned char *input, unsigned int inputLen)
00093 {
00094     PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
00095     return SECFailure;
00096 }
00097 
00098 /*
00099 ** Perform RC5 decryption.
00100 **      "cx" the context
00101 **      "output" the output buffer to store the decrypted data.
00102 **      "outputLen" how much data is stored in "output". Set by the routine
00103 **         after some data is stored in output.
00104 **      "maxOutputLen" the maximum amount of data that can ever be
00105 **         stored in "output"
00106 **      "input" the input data
00107 **      "inputLen" the amount of input data
00108 */
00109 SECStatus 
00110 RC5_Decrypt(RC5Context *cx, unsigned char *output, unsigned int *outputLen, 
00111            unsigned int maxOutputLen,
00112             const unsigned char *input, unsigned int inputLen)
00113 {
00114     PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
00115     return SECFailure;
00116 }
00117