security/nss/lib/freebl/arcfive.c

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/lib/freebl/arcfive.c	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,88 @@
     1.4 +/*
     1.5 + * arcfive.c - stubs for RC5 - NOT a working implementation!
     1.6 + *
     1.7 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    1.10 +
    1.11 +#ifdef FREEBL_NO_DEPEND
    1.12 +#include "stubs.h"
    1.13 +#endif
    1.14 +
    1.15 +#include "blapi.h"
    1.16 +#include "prerror.h"
    1.17 +
    1.18 +/******************************************/
    1.19 +/*
    1.20 +** RC5 symmetric block cypher -- 64-bit block size
    1.21 +*/
    1.22 +
    1.23 +/*
    1.24 +** Create a new RC5 context suitable for RC5 encryption/decryption.
    1.25 +**      "key" raw key data
    1.26 +**      "len" the number of bytes of key data
    1.27 +**      "iv" is the CBC initialization vector (if mode is NSS_RC5_CBC)
    1.28 +**      "mode" one of NSS_RC5 or NSS_RC5_CBC
    1.29 +**
    1.30 +** When mode is set to NSS_RC5_CBC the RC5 cipher is run in "cipher block
    1.31 +** chaining" mode.
    1.32 +*/
    1.33 +RC5Context *
    1.34 +RC5_CreateContext(const SECItem *key, unsigned int rounds,
    1.35 +                  unsigned int wordSize, const unsigned char *iv, int mode)
    1.36 +{
    1.37 +    PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
    1.38 +    return NULL;
    1.39 +}
    1.40 +
    1.41 +/*
    1.42 +** Destroy an RC5 encryption/decryption context.
    1.43 +**      "cx" the context
    1.44 +**      "freeit" if PR_TRUE then free the object as well as its sub-objects
    1.45 +*/
    1.46 +void 
    1.47 +RC5_DestroyContext(RC5Context *cx, PRBool freeit) 
    1.48 +{
    1.49 +    PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
    1.50 +}
    1.51 +
    1.52 +/*
    1.53 +** Perform RC5 encryption.
    1.54 +**      "cx" the context
    1.55 +**      "output" the output buffer to store the encrypted data.
    1.56 +**      "outputLen" how much data is stored in "output". Set by the routine
    1.57 +**         after some data is stored in output.
    1.58 +**      "maxOutputLen" the maximum amount of data that can ever be
    1.59 +**         stored in "output"
    1.60 +**      "input" the input data
    1.61 +**      "inputLen" the amount of input data
    1.62 +*/
    1.63 +SECStatus 
    1.64 +RC5_Encrypt(RC5Context *cx, unsigned char *output, unsigned int *outputLen, 
    1.65 +	    unsigned int maxOutputLen, 
    1.66 +	    const unsigned char *input, unsigned int inputLen)
    1.67 +{
    1.68 +    PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
    1.69 +    return SECFailure;
    1.70 +}
    1.71 +
    1.72 +/*
    1.73 +** Perform RC5 decryption.
    1.74 +**      "cx" the context
    1.75 +**      "output" the output buffer to store the decrypted data.
    1.76 +**      "outputLen" how much data is stored in "output". Set by the routine
    1.77 +**         after some data is stored in output.
    1.78 +**      "maxOutputLen" the maximum amount of data that can ever be
    1.79 +**         stored in "output"
    1.80 +**      "input" the input data
    1.81 +**      "inputLen" the amount of input data
    1.82 +*/
    1.83 +SECStatus 
    1.84 +RC5_Decrypt(RC5Context *cx, unsigned char *output, unsigned int *outputLen, 
    1.85 +	    unsigned int maxOutputLen,
    1.86 +            const unsigned char *input, unsigned int inputLen)
    1.87 +{
    1.88 +    PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
    1.89 +    return SECFailure;
    1.90 +}
    1.91 +

mercurial