PageRenderTime 20ms CodeModel.GetById 8ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/security/nss/lib/freebl/arcfive.c

http://github.com/zpao/v8monkey
C | 121 lines | 33 code | 8 blank | 80 comment | 0 complexity | 1ac5e0c4c63dd486442d744fe50f8f35 MD5 | raw file
  1/*
  2 * arcfive.c - stubs for RC5 - NOT a working implementation!
  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) 2000
 22 * the Initial Developer. All Rights Reserved.
 23 *
 24 * Contributor(s):
 25 *
 26 * Alternatively, the contents of this file may be used under the terms of
 27 * either the GNU General Public License Version 2 or later (the "GPL"), or
 28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 29 * in which case the provisions of the GPL or the LGPL are applicable instead
 30 * of those above. If you wish to allow use of your version of this file only
 31 * under the terms of either the GPL or the LGPL, and not to allow others to
 32 * use your version of this file under the terms of the MPL, indicate your
 33 * decision by deleting the provisions above and replace them with the notice
 34 * and other provisions required by the GPL or the LGPL. If you do not delete
 35 * the provisions above, a recipient may use your version of this file under
 36 * the terms of any one of the MPL, the GPL or the LGPL.
 37 *
 38 * ***** END LICENSE BLOCK ***** */
 39/* $Id: arcfive.c,v 1.6 2008/11/18 19:48:21 rrelyea%redhat.com Exp $ */
 40
 41#ifdef FREEBL_NO_DEPEND
 42#include "stubs.h"
 43#endif
 44
 45#include "blapi.h"
 46#include "prerror.h"
 47
 48/******************************************/
 49/*
 50** RC5 symmetric block cypher -- 64-bit block size
 51*/
 52
 53/*
 54** Create a new RC5 context suitable for RC5 encryption/decryption.
 55**      "key" raw key data
 56**      "len" the number of bytes of key data
 57**      "iv" is the CBC initialization vector (if mode is NSS_RC5_CBC)
 58**      "mode" one of NSS_RC5 or NSS_RC5_CBC
 59**
 60** When mode is set to NSS_RC5_CBC the RC5 cipher is run in "cipher block
 61** chaining" mode.
 62*/
 63RC5Context *
 64RC5_CreateContext(const SECItem *key, unsigned int rounds,
 65                  unsigned int wordSize, const unsigned char *iv, int mode)
 66{
 67    PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
 68    return NULL;
 69}
 70
 71/*
 72** Destroy an RC5 encryption/decryption context.
 73**      "cx" the context
 74**      "freeit" if PR_TRUE then free the object as well as its sub-objects
 75*/
 76void 
 77RC5_DestroyContext(RC5Context *cx, PRBool freeit) 
 78{
 79    PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
 80}
 81
 82/*
 83** Perform RC5 encryption.
 84**      "cx" the context
 85**      "output" the output buffer to store the encrypted data.
 86**      "outputLen" how much data is stored in "output". Set by the routine
 87**         after some data is stored in output.
 88**      "maxOutputLen" the maximum amount of data that can ever be
 89**         stored in "output"
 90**      "input" the input data
 91**      "inputLen" the amount of input data
 92*/
 93SECStatus 
 94RC5_Encrypt(RC5Context *cx, unsigned char *output, unsigned int *outputLen, 
 95	    unsigned int maxOutputLen, 
 96	    const unsigned char *input, unsigned int inputLen)
 97{
 98    PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
 99    return SECFailure;
100}
101
102/*
103** Perform RC5 decryption.
104**      "cx" the context
105**      "output" the output buffer to store the decrypted data.
106**      "outputLen" how much data is stored in "output". Set by the routine
107**         after some data is stored in output.
108**      "maxOutputLen" the maximum amount of data that can ever be
109**         stored in "output"
110**      "input" the input data
111**      "inputLen" the amount of input data
112*/
113SECStatus 
114RC5_Decrypt(RC5Context *cx, unsigned char *output, unsigned int *outputLen, 
115	    unsigned int maxOutputLen,
116            const unsigned char *input, unsigned int inputLen)
117{
118    PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
119    return SECFailure;
120}
121