/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifdef FREEBL_NO_DEPEND #include"stubs.h" #endif
#include"prerr.h" #include"secerr.h"
#include"prtypes.h"
#include"blapi.h"
#define MD2_DIGEST_LEN 16 #define MD2_BUFSIZE 16 #define MD2_X_SIZE 48/* The X array, [CV | INPUT | TMP VARS] */ #define MD2_CV 0/* index into X for chaining variables */ #define MD2_INPUT 16/* index into X for input */ #define MD2_TMPVARS 32/* index into X for temporary variables */ #define MD2_CHECKSUM_SIZE 16
/* Fill the remaining input buffer. */ if (cx->unusedBuffer != MD2_BUFSIZE) {
bytesToConsume = PR_MIN(inputLen, cx->unusedBuffer);
memcpy(&cx->X[MD2_INPUT + (MD2_BUFSIZE - cx->unusedBuffer)],
input, bytesToConsume); if (cx->unusedBuffer + bytesToConsume >= MD2_BUFSIZE)
md2_compress(cx);
inputLen -= bytesToConsume;
input += bytesToConsume;
}
/* Iterate over 16-byte chunks of the input. */ while (inputLen >= MD2_BUFSIZE) {
memcpy(&cx->X[MD2_INPUT], input, MD2_BUFSIZE);
md2_compress(cx);
inputLen -= MD2_BUFSIZE;
input += MD2_BUFSIZE;
}
/* Copy any input that remains into the buffer. */ if (inputLen)
memcpy(&cx->X[MD2_INPUT], input, inputLen);
cx->unusedBuffer = MD2_BUFSIZE - inputLen;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.