|
Packit |
40b132 |
/*
|
|
Packit |
40b132 |
* arcfive.c - stubs for RC5 - NOT a working implementation!
|
|
Packit |
40b132 |
*
|
|
Packit |
40b132 |
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
Packit |
40b132 |
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
Packit |
40b132 |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
Packit |
40b132 |
|
|
Packit |
40b132 |
#ifdef FREEBL_NO_DEPEND
|
|
Packit |
40b132 |
#include "stubs.h"
|
|
Packit |
40b132 |
#endif
|
|
Packit |
40b132 |
|
|
Packit |
40b132 |
#include "blapi.h"
|
|
Packit |
40b132 |
#include "prerror.h"
|
|
Packit |
40b132 |
|
|
Packit |
40b132 |
/******************************************/
|
|
Packit |
40b132 |
/*
|
|
Packit |
40b132 |
** RC5 symmetric block cypher -- 64-bit block size
|
|
Packit |
40b132 |
*/
|
|
Packit |
40b132 |
|
|
Packit |
40b132 |
/*
|
|
Packit |
40b132 |
** Create a new RC5 context suitable for RC5 encryption/decryption.
|
|
Packit |
40b132 |
** "key" raw key data
|
|
Packit |
40b132 |
** "len" the number of bytes of key data
|
|
Packit |
40b132 |
** "iv" is the CBC initialization vector (if mode is NSS_RC5_CBC)
|
|
Packit |
40b132 |
** "mode" one of NSS_RC5 or NSS_RC5_CBC
|
|
Packit |
40b132 |
**
|
|
Packit |
40b132 |
** When mode is set to NSS_RC5_CBC the RC5 cipher is run in "cipher block
|
|
Packit |
40b132 |
** chaining" mode.
|
|
Packit |
40b132 |
*/
|
|
Packit |
40b132 |
RC5Context *
|
|
Packit |
40b132 |
RC5_CreateContext(const SECItem *key, unsigned int rounds,
|
|
Packit |
40b132 |
unsigned int wordSize, const unsigned char *iv, int mode)
|
|
Packit |
40b132 |
{
|
|
Packit |
40b132 |
PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
|
|
Packit |
40b132 |
return NULL;
|
|
Packit |
40b132 |
}
|
|
Packit |
40b132 |
|
|
Packit |
40b132 |
/*
|
|
Packit |
40b132 |
** Destroy an RC5 encryption/decryption context.
|
|
Packit |
40b132 |
** "cx" the context
|
|
Packit |
40b132 |
** "freeit" if PR_TRUE then free the object as well as its sub-objects
|
|
Packit |
40b132 |
*/
|
|
Packit |
40b132 |
void
|
|
Packit |
40b132 |
RC5_DestroyContext(RC5Context *cx, PRBool freeit)
|
|
Packit |
40b132 |
{
|
|
Packit |
40b132 |
PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
|
|
Packit |
40b132 |
}
|
|
Packit |
40b132 |
|
|
Packit |
40b132 |
/*
|
|
Packit |
40b132 |
** Perform RC5 encryption.
|
|
Packit |
40b132 |
** "cx" the context
|
|
Packit |
40b132 |
** "output" the output buffer to store the encrypted data.
|
|
Packit |
40b132 |
** "outputLen" how much data is stored in "output". Set by the routine
|
|
Packit |
40b132 |
** after some data is stored in output.
|
|
Packit |
40b132 |
** "maxOutputLen" the maximum amount of data that can ever be
|
|
Packit |
40b132 |
** stored in "output"
|
|
Packit |
40b132 |
** "input" the input data
|
|
Packit |
40b132 |
** "inputLen" the amount of input data
|
|
Packit |
40b132 |
*/
|
|
Packit |
40b132 |
SECStatus
|
|
Packit |
40b132 |
RC5_Encrypt(RC5Context *cx, unsigned char *output, unsigned int *outputLen,
|
|
Packit |
40b132 |
unsigned int maxOutputLen,
|
|
Packit |
40b132 |
const unsigned char *input, unsigned int inputLen)
|
|
Packit |
40b132 |
{
|
|
Packit |
40b132 |
PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
|
|
Packit |
40b132 |
return SECFailure;
|
|
Packit |
40b132 |
}
|
|
Packit |
40b132 |
|
|
Packit |
40b132 |
/*
|
|
Packit |
40b132 |
** Perform RC5 decryption.
|
|
Packit |
40b132 |
** "cx" the context
|
|
Packit |
40b132 |
** "output" the output buffer to store the decrypted data.
|
|
Packit |
40b132 |
** "outputLen" how much data is stored in "output". Set by the routine
|
|
Packit |
40b132 |
** after some data is stored in output.
|
|
Packit |
40b132 |
** "maxOutputLen" the maximum amount of data that can ever be
|
|
Packit |
40b132 |
** stored in "output"
|
|
Packit |
40b132 |
** "input" the input data
|
|
Packit |
40b132 |
** "inputLen" the amount of input data
|
|
Packit |
40b132 |
*/
|
|
Packit |
40b132 |
SECStatus
|
|
Packit |
40b132 |
RC5_Decrypt(RC5Context *cx, unsigned char *output, unsigned int *outputLen,
|
|
Packit |
40b132 |
unsigned int maxOutputLen,
|
|
Packit |
40b132 |
const unsigned char *input, unsigned int inputLen)
|
|
Packit |
40b132 |
{
|
|
Packit |
40b132 |
PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
|
|
Packit |
40b132 |
return SECFailure;
|
|
Packit |
40b132 |
}
|
|
Packit |
40b132 |
|