亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? sqhash.c

?? 一些加密解密的源代碼
?? C
字號:
/*
	The following scheme is described in Matyas, S.M., Meyer, C.H. and
	Oseas, J., "Generating Strong One-Way Functions with Cryptographic
	Algorithm", IBM Technical Disclosure Bulletin 27, 10A (1985),
	p. 5658-5659, and also in Schneier, B., "Applied Cryptography"
	(2nd ed), 1996.

	Let the symbol || represent string concatenation, and length(s)
	to be the length of string s.  Given a string m, let M = m || P,
	where P consists of a single "1" bit, followed by enough "0" bits
	to make	length(m || "1") mod 128 = 64, followed by the 64-bit
	representation of length(m), so that length(M) mod 128 = 0, i.e.
	length(M) = 128*n for some n.  Let M_1, M_2, ... M_n be the n
	128-bit blocks of M.  Define hash(m) recursively by:
		H_0 = <128-bit constant>
		H_i = encrypt(M_i, H_{i-1}) xor M_i
		hash (m) = H_n
	where encrypt(p, k) represents the Square ciphertext corresponding
	to the plaintext p under key k.
*/

#include <assert.h>
#include <stdlib.h>
#include <string.h>

#include "square.h"
#include "sqhash.h"


#define D(p) ((word32 *)(p))

#define squareHashStep(roundKeys, msgDigest, msgStream) \
{ \
	squareExpandKey (msgDigest, roundKeys); \
	D(msgDigest)[0]  = D(msgStream)[0]; \
	D(msgDigest)[1]  = D(msgStream)[1]; \
	D(msgDigest)[2]  = D(msgStream)[2]; \
	D(msgDigest)[3]  = D(msgStream)[3]; \
	squareEncrypt (D(msgDigest), roundKeys); \
	D(msgDigest)[0] ^= D(msgStream)[0]; \
	D(msgDigest)[1] ^= D(msgStream)[1]; \
	D(msgDigest)[2] ^= D(msgStream)[2]; \
	D(msgDigest)[3] ^= D(msgStream)[3]; \
} /* squareHashStep */


void squareHashInit (squareHashContext *ctxHash)
	/* Initialize a Square hashing context. */
{
	assert (ctxHash != NULL);
	memset (ctxHash, 0, sizeof (squareHashContext));
} /* squareHashInit */


void squareHashUpdate (squareHashContext *ctxHash, const byte *dataBuffer, unsigned dataLength)
	/* Updates a Square hashing context with a data buffer dataBuffer of length dataLength. */
{
	assert (ctxHash != NULL);
	assert (dataBuffer != NULL);
	assert (ctxHash->occupied < SQUARE_BLOCKSIZE); /* invariant */

	/* update byte count: */
	if ((word32)dataLength > 0xFFFFFFFFUL - ctxHash->byteCount[0]) {
		ctxHash->byteCount[1]++;
	}
	ctxHash->byteCount[0] += (word32)dataLength;
	
	/* if the data buffer is not enough to complete the context data block, just append it: */
	if (ctxHash->occupied + (word32)dataLength < SQUARE_BLOCKSIZE) { /* caveat: typecast avoids 16-bit overflow */
		memcpy (&ctxHash->block[ctxHash->occupied], dataBuffer, dataLength);
		ctxHash->occupied += dataLength;
		assert (ctxHash->occupied < SQUARE_BLOCKSIZE);
		return; /* delay processing */
	}

	/* complete the context data block: */
	memcpy (&ctxHash->block[ctxHash->occupied], dataBuffer, SQUARE_BLOCKSIZE - ctxHash->occupied);
	dataBuffer += SQUARE_BLOCKSIZE - ctxHash->occupied;
	dataLength -= SQUARE_BLOCKSIZE - ctxHash->occupied;

	/* process the completed context data block: */
	squareHashStep (ctxHash->roundKeys, ctxHash->digest, ctxHash->block);
	/* process data in chunks of SQUARE_BLOCKSIZE bytes: */
	while (dataLength >= SQUARE_BLOCKSIZE) {
		squareHashStep (ctxHash->roundKeys, ctxHash->digest, dataBuffer);
		dataBuffer += SQUARE_BLOCKSIZE;
		dataLength -= SQUARE_BLOCKSIZE;
	}

	/* delay processing of remaining data: */
	memcpy (ctxHash->block, dataBuffer, dataLength);
	ctxHash->occupied = dataLength; /* < SQUARE_BLOCKSIZE */
	
	assert (ctxHash->occupied < SQUARE_BLOCKSIZE);
} /* squarehashUpdate */


void squareHashFinal (squareHashContext *ctxHash, squareBlock digest)
	/* Finished evaluation of a Square digest, clearing the context. */
{
	assert (ctxHash != NULL);
	assert (ctxHash->occupied < SQUARE_BLOCKSIZE);
	assert (digest != NULL);
	/* append toggle to the message (there's always at least one byte left): */
	ctxHash->block[ctxHash->occupied++] = 0x80; /* big-endian convention */
	/* pad with null bytes to make the message 64 (mod 128) bits long: */
	if (ctxHash->occupied > SQUARE_BLOCKSIZE - 8) {
		/* no room for length field on the current block */
		memset (&ctxHash->block[ctxHash->occupied], 0, SQUARE_BLOCKSIZE - ctxHash->occupied);
		/* process the completed message chunk: */
		squareHashStep (ctxHash->roundKeys, ctxHash->digest, ctxHash->block);
		memset (ctxHash->block, 0, SQUARE_BLOCKSIZE - 8);
	} else {
		memset (&ctxHash->block[ctxHash->occupied], 0, SQUARE_BLOCKSIZE - 8 - ctxHash->occupied);
	}
	/* append length field (N.B. in bits, not bytes): */
	D(ctxHash->block)[2] = (ctxHash->byteCount[0] << 3);
	D(ctxHash->block)[3] = (ctxHash->byteCount[1] << 3) + (ctxHash->byteCount[0] >> 29);
	/* process the last padded message chunk: */
	squareHashStep (ctxHash->roundKeys, ctxHash->digest, ctxHash->block);
	memcpy (digest, ctxHash->digest, SQUARE_BLOCKSIZE);
	/* destroy potentially sensitive information: */
	memset (ctxHash, 0, sizeof (squareHashContext));
} /* squareHashFinal */


void squareHash (const byte *msgStream, unsigned msgLength, squareBlock msgDigest)
	/* Hash a single message msgStream of length msgLength into the 128-bit msgDigest */
{
	unsigned bytes = msgLength;
	word32 roundKeys[R+1][4];
	squareBlock msgToggle;

	memset (msgDigest, 0, SQUARE_BLOCKSIZE);
	while (msgLength >= SQUARE_BLOCKSIZE) {
		squareHashStep (roundKeys, msgDigest, msgStream);
		msgStream += SQUARE_BLOCKSIZE;
		msgLength -= SQUARE_BLOCKSIZE;
	}
	/* handle the last 0 <= msgLength < SQUARE_BLOCKSIZE bytes: */
	memcpy (msgToggle, msgStream, msgLength);
	/* append toggle to the message (there's always at least one byte left): */
	msgToggle[msgLength++] = 0x80; /* big-endian convention */
	/* pad with null bytes to make the message 64 (mod 128) bits long: */
	if (msgLength > SQUARE_BLOCKSIZE - 8) {
		/* no room for length field on the current block */
		memset (&msgToggle[msgLength], 0, SQUARE_BLOCKSIZE - msgLength);
		/* process the completed message chunk: */
		squareHashStep (roundKeys, msgDigest, msgToggle);
		memset (msgToggle, 0, SQUARE_BLOCKSIZE - 8);
	} else {
		memset (&msgToggle[msgLength], 0, SQUARE_BLOCKSIZE - 8 - msgLength);
	}
	/* append length field (N.B. in bits, not bytes): */
	D(msgToggle)[2] = (word32)bytes <<  3;
	D(msgToggle)[3] = (word32)bytes >> 29;
	/* process the last padded message chunk: */
	squareHashStep (roundKeys, msgDigest, msgToggle);
#ifdef DESTROY_TEMPORARIES
	/* destroy potentially sensitive information: */
	bytes = 0;
	memset (roundKeys, 0, sizeof (roundKeys));
	memset (msgToggle, 0, sizeof (msgToggle));
#endif /* ?DESTROY_TEMPORARIES */
} /* squareHash */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品少妇一区二区三区免费观看| 成+人+亚洲+综合天堂| 国产精品国产三级国产有无不卡| 亚洲美女免费在线| 国内外成人在线视频| 91福利精品视频| 欧美激情一区在线观看| 人人精品人人爱| 在线亚洲一区二区| 国产精品午夜久久| 国产一区激情在线| 欧美一区二区三区在线观看视频 | 国产欧美一区二区在线| 亚洲成a人在线观看| 成人av在线播放网址| 久久亚洲影视婷婷| 麻豆一区二区三| 在线成人高清不卡| 亚洲国产三级在线| 欧美午夜精品久久久久久孕妇| 国产精品视频免费看| 国产一区二区调教| 欧美xxxxxxxx| 国产综合成人久久大片91| 欧美一区二区三区影视| 午夜国产精品一区| 欧美丰满高潮xxxx喷水动漫| 亚洲高清免费在线| 欧美日韩日日夜夜| 肉色丝袜一区二区| 欧美丰满少妇xxxxx高潮对白 | 久久色.com| 久久精品二区亚洲w码| 欧美一区二区视频在线观看2020 | 欧美日韩国产成人在线免费| 伊人色综合久久天天人手人婷| 99精品国产一区二区三区不卡| 国产无人区一区二区三区| 国产剧情一区二区三区| 精品少妇一区二区三区| 国产在线播放一区| 国产亚洲va综合人人澡精品| 国产成人免费视频网站| 国产欧美综合在线观看第十页| 高清视频一区二区| 国产精品九色蝌蚪自拍| 色伊人久久综合中文字幕| 一区二区三区四区在线播放| 欧美日韩精品高清| 男人的j进女人的j一区| 欧美精品一区二区三区在线 | 亚洲国产精品自拍| 91精品国产欧美一区二区| 久久99国产精品免费网站| 久久亚区不卡日本| 99久久免费视频.com| 夜夜嗨av一区二区三区中文字幕| 91福利在线观看| 美女国产一区二区| 国产精品免费免费| 欧美日韩国产不卡| 国产精品99久久久久久宅男| 亚洲欧美综合色| 欧美日韩国产乱码电影| 国产中文字幕一区| 亚洲欧美视频在线观看| 日韩欧美另类在线| 99国产精品视频免费观看| 亚洲国产欧美在线| 久久精品欧美一区二区三区不卡| 91小视频在线免费看| 美女脱光内衣内裤视频久久影院| 国产欧美日韩在线视频| 亚洲国产精品高清| 欧美日韩中文字幕精品| 国产成人一区在线| 香蕉久久一区二区不卡无毒影院 | 色综合欧美在线| 日韩国产一区二| 亚洲欧美怡红院| 日韩欧美国产三级| 欧洲亚洲国产日韩| 国产电影精品久久禁18| 偷拍自拍另类欧美| 中文字幕在线观看一区二区| 日韩一区二区中文字幕| 91女人视频在线观看| 国产一区999| 奇米综合一区二区三区精品视频| 国产精品久久午夜夜伦鲁鲁| 欧美成人精品高清在线播放| 91精品91久久久中77777| 国产69精品久久99不卡| 麻豆freexxxx性91精品| 五月婷婷激情综合| 亚洲精品成人a在线观看| 国产精品久线观看视频| 欧美精品一区二区在线观看| 欧美一区二区在线不卡| 欧美丝袜丝交足nylons| 色一情一伦一子一伦一区| 国产成人在线色| 狠狠色伊人亚洲综合成人| 日韩高清不卡一区| 天天色天天操综合| 亚洲bt欧美bt精品| 亚洲一区二区三区不卡国产欧美| 中文字幕亚洲视频| 国产精品护士白丝一区av| 久久精品夜夜夜夜久久| 久久午夜色播影院免费高清| 欧美sm极限捆绑bd| 精品国产sm最大网站免费看| 欧美大胆人体bbbb| 日韩视频在线观看一区二区| 91精品国产综合久久国产大片 | www.欧美色图| 成人激情动漫在线观看| 成人美女视频在线观看18| 国产成人精品亚洲日本在线桃色| 国产在线观看一区二区| 国产乱子伦视频一区二区三区| 激情综合网av| 国产高清亚洲一区| 懂色一区二区三区免费观看| 国产成人av一区| 粉嫩av一区二区三区| 99久久99久久免费精品蜜臀| 色偷偷久久人人79超碰人人澡| 91麻豆免费视频| 欧美三级午夜理伦三级中视频| 538prom精品视频线放| 日韩一级完整毛片| 国产免费成人在线视频| 亚洲天天做日日做天天谢日日欢| 亚洲激情网站免费观看| 亚洲地区一二三色| 久久91精品国产91久久小草| 国产成人自拍网| 99久久婷婷国产综合精品电影| 91久久精品一区二区三区| 欧美日韩在线播放三区四区| 3atv一区二区三区| 国产视频911| 亚洲精品大片www| 另类中文字幕网| 国产成人超碰人人澡人人澡| 91成人网在线| 日韩欧美中文一区二区| 国产精品久久久久久久久图文区| 亚洲一区免费视频| 精品一区二区国语对白| 91丨九色丨尤物| 欧美一区二区三级| 国产精品免费看片| 丝袜a∨在线一区二区三区不卡 | 五月激情综合网| 国产成人av网站| 欧美色成人综合| 欧美激情综合网| 男人的j进女人的j一区| 99精品视频在线免费观看| 日韩欧美国产wwwww| 亚洲欧洲三级电影| 久久精品国产成人一区二区三区 | 一本大道av伊人久久综合| 日韩免费一区二区三区在线播放| 日韩理论片网站| 国产乱码一区二区三区| 欧美日韩国产高清一区| 亚洲欧美日韩国产成人精品影院 | 成人久久18免费网站麻豆| 欧美色网一区二区| 中文字幕在线一区二区三区| 日本成人在线看| 在线观看视频一区二区 | 日韩精品一区二区三区视频| 亚洲欧美激情视频在线观看一区二区三区| 奇米精品一区二区三区在线观看一| 不卡视频一二三| 国产欧美日韩视频一区二区| 奇米777欧美一区二区| 欧美日韩一本到| 亚洲人成网站精品片在线观看| 国产乱码精品1区2区3区| 91精品国产综合久久精品| 亚洲综合视频网| 91久久精品午夜一区二区| 成人免费在线播放视频| 国产v综合v亚洲欧| 久久香蕉国产线看观看99| 久久草av在线| 精品国产一区二区三区久久影院| 日韩精品成人一区二区三区| 欧美色爱综合网| 五月激情六月综合| 91精品欧美综合在线观看最新| 婷婷六月综合亚洲| 欧美久久久久久蜜桃| 日日夜夜一区二区|