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

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

?? queue.cpp

?? 加密函數(shù)庫:包括多種加密解密算法,數(shù)字簽名,散列算法
?? CPP
字號:
// queue.cpp - written and placed in the public domain by Wei Dai

#include "pch.h"
#include "queue.h"
#include "filters.h"

NAMESPACE_BEGIN(CryptoPP)

// this class for use by ByteQueue only
class ByteQueueNode
{
public:
	ByteQueueNode(unsigned int maxSize)
		: buf(maxSize)
	{
		m_head = m_tail = 0;
		next = 0;
	}

	inline unsigned int MaxSize() const {return buf.size();}

	inline unsigned int CurrentSize() const
	{
		return m_tail-m_head;
	}

	inline bool UsedUp() const
	{
		return (m_head==MaxSize());
	}

	inline void Clear()
	{
		m_head = m_tail = 0;
	}

/*	inline unsigned int Put(byte inByte)
	{
		if (MaxSize()==m_tail)
			return 0;

		buf[m_tail++]=inByte;
		return 1;
	}
*/
	inline unsigned int Put(const byte *begin, unsigned int length)
	{
		unsigned int l = STDMIN(length, MaxSize()-m_tail);
		memcpy(buf+m_tail, begin, l);
		m_tail += l;
		return l;
	}

	inline unsigned int Peek(byte &outByte) const
	{
		if (m_tail==m_head)
			return 0;

		outByte=buf[m_head];
		return 1;
	}

	inline unsigned int Peek(byte *target, unsigned int copyMax) const
	{
		unsigned int len = STDMIN(copyMax, m_tail-m_head);
		memcpy(target, buf+m_head, len);
		return len;
	}

	inline unsigned int CopyTo(BufferedTransformation &target, const std::string &channel=BufferedTransformation::NULL_CHANNEL) const
	{
		unsigned int len = m_tail-m_head;
		target.ChannelPut(channel, buf+m_head, len);
		return len;
	}

	inline unsigned int CopyTo(BufferedTransformation &target, unsigned int copyMax, const std::string &channel=BufferedTransformation::NULL_CHANNEL) const
	{
		unsigned int len = STDMIN(copyMax, m_tail-m_head);
		target.ChannelPut(channel, buf+m_head, len);
		return len;
	}

	inline unsigned int Get(byte &outByte)
	{
		unsigned int len = Peek(outByte);
		m_head += len;
		return len;
	}

	inline unsigned int Get(byte *outString, unsigned int getMax)
	{
		unsigned int len = Peek(outString, getMax);
		m_head += len;
		return len;
	}

	inline unsigned int TransferTo(BufferedTransformation &target, const std::string &channel=BufferedTransformation::NULL_CHANNEL)
	{
		unsigned int len = m_tail-m_head;
		target.ChannelPutModifiable(channel, buf+m_head, len);
		m_head = m_tail;
		return len;
	}

	inline unsigned int TransferTo(BufferedTransformation &target, unsigned int transferMax, const std::string &channel=BufferedTransformation::NULL_CHANNEL)
	{
		unsigned int len = STDMIN(transferMax, m_tail-m_head);
		target.ChannelPutModifiable(channel, buf+m_head, len);
		m_head += len;
		return len;
	}

	inline unsigned int Skip(unsigned int skipMax)
	{
		unsigned int len = STDMIN(skipMax, m_tail-m_head);
		m_head += len;
		return len;
	}

	inline byte operator[](unsigned int i) const
	{
		return buf[m_head+i];
	}

	ByteQueueNode *next;

	SecByteBlock buf;
	unsigned int m_head, m_tail;
};

// ********************************************************

ByteQueue::ByteQueue(unsigned int m_nodeSize)
	: m_nodeSize(m_nodeSize), m_lazyLength(0)
{
	m_head = m_tail = new ByteQueueNode(m_nodeSize);
}

ByteQueue::ByteQueue(const ByteQueue &copy)
{
	CopyFrom(copy);
}

void ByteQueue::CopyFrom(const ByteQueue &copy)
{
	m_lazyLength = 0;
	m_nodeSize = copy.m_nodeSize;
	m_head = m_tail = new ByteQueueNode(*copy.m_head);

	for (ByteQueueNode *current=copy.m_head->next; current; current=current->next)
	{
		m_tail->next = new ByteQueueNode(*current);
		m_tail = m_tail->next;
	}

	m_tail->next = NULL;

	Put(copy.m_lazyString, copy.m_lazyLength);
}

ByteQueue::~ByteQueue()
{
	Destroy();
}

void ByteQueue::Destroy()
{
	ByteQueueNode *next;

	for (ByteQueueNode *current=m_head; current; current=next)
	{
		next=current->next;
		delete current;
	}
}

void ByteQueue::IsolatedInitialize(const NameValuePairs &parameters)
{
	m_nodeSize = parameters.GetIntValueWithDefault("NodeSize", 256);
	Clear();
}

unsigned long ByteQueue::CurrentSize() const
{
	unsigned long size=0;

	for (ByteQueueNode *current=m_head; current; current=current->next)
		size += current->CurrentSize();

	return size + m_lazyLength;
}

bool ByteQueue::IsEmpty() const
{
	return m_head==m_tail && m_head->CurrentSize()==0 && m_lazyLength==0;
}

void ByteQueue::Clear()
{
	Destroy();
	m_head = m_tail = new ByteQueueNode(m_nodeSize);
	m_lazyLength = 0;
}

unsigned int ByteQueue::Put2(const byte *inString, unsigned int length, int messageEnd, bool blocking)
{
	if (m_lazyLength > 0)
		FinalizeLazyPut();

	unsigned int len;
	while ((len=m_tail->Put(inString, length)) < length)
	{
		m_tail->next = new ByteQueueNode(m_nodeSize);
		m_tail = m_tail->next;
		inString += len;
		length -= len;
	}

	return 0;
}

void ByteQueue::CleanupUsedNodes()
{
	while (m_head != m_tail && m_head->UsedUp())
	{
		ByteQueueNode *temp=m_head;
		m_head=m_head->next;
		delete temp;
	}

	if (m_head->CurrentSize() == 0)
		m_head->Clear();
}

void ByteQueue::LazyPut(const byte *inString, unsigned int size)
{
	if (m_lazyLength > 0)
		FinalizeLazyPut();
	m_lazyString = inString;
	m_lazyLength = size;
}

void ByteQueue::UndoLazyPut(unsigned int size)
{
	if (m_lazyLength < size)
		throw InvalidArgument("ByteQueue: size specified for UndoLazyPut is too large");

	m_lazyLength -= size;
}

void ByteQueue::FinalizeLazyPut()
{
	unsigned int len = m_lazyLength;
	m_lazyLength = 0;
	if (len)
		Put(m_lazyString, len);
}

unsigned int ByteQueue::Get(byte &outByte)
{
	if (m_head->Get(outByte))
	{
		if (m_head->UsedUp())
			CleanupUsedNodes();
		return 1;
	}
	else if (m_lazyLength > 0)
	{
		outByte = *m_lazyString++;
		m_lazyLength--;
		return 1;
	}
	else
		return 0;
}

unsigned int ByteQueue::Get(byte *outString, unsigned int getMax)
{
	ArraySink sink(outString, getMax);
	return TransferTo(sink, getMax);
}

unsigned int ByteQueue::Peek(byte &outByte) const
{
	if (m_head->Peek(outByte))
		return 1;
	else if (m_lazyLength > 0)
	{
		outByte = *m_lazyString;
		return 1;
	}
	else
		return 0;
}

unsigned int ByteQueue::Peek(byte *outString, unsigned int peekMax) const
{
	ArraySink sink(outString, peekMax);
	return CopyTo(sink, peekMax);
}

unsigned int ByteQueue::TransferTo2(BufferedTransformation &target, unsigned long &transferBytes, const std::string &channel, bool blocking)
{
	if (blocking)
	{
		unsigned long bytesLeft = transferBytes;
		for (ByteQueueNode *current=m_head; bytesLeft && current; current=current->next)
			bytesLeft -= current->TransferTo(target, bytesLeft, channel);
		CleanupUsedNodes();

		unsigned int len = (unsigned int)STDMIN(bytesLeft, (unsigned long)m_lazyLength);
		if (len)
		{
			target.ChannelPut(channel, m_lazyString, len);
			m_lazyString += len;
			m_lazyLength -= len;
			bytesLeft -= len;
		}
		transferBytes -= bytesLeft;
		return 0;
	}
	else
	{
		Walker walker(*this);
		unsigned int blockedBytes = walker.TransferTo2(target, transferBytes, channel, blocking);
		Skip(transferBytes);
		return blockedBytes;
	}
}

unsigned int ByteQueue::CopyRangeTo2(BufferedTransformation &target, unsigned long &begin, unsigned long end, const std::string &channel, bool blocking) const
{
	Walker walker(*this);
	walker.Skip(begin);
	unsigned long transferBytes = end-begin;
	unsigned int blockedBytes = walker.TransferTo2(target, transferBytes, channel, blocking);
	begin += transferBytes;
	return blockedBytes;
}

void ByteQueue::Unget(byte inByte)
{
	Unget(&inByte, 1);
}

void ByteQueue::Unget(const byte *inString, unsigned int length)
{
	// TODO: make this more efficient
	ByteQueueNode *newHead = new ByteQueueNode(length);
	newHead->next = m_head;
	m_head = newHead;
	m_head->Put(inString, length);
}

const byte * ByteQueue::Spy(unsigned int &contiguousSize) const
{
	contiguousSize = m_head->m_tail - m_head->m_head;
	if (contiguousSize == 0 && m_lazyLength > 0)
	{
		contiguousSize = m_lazyLength;
		return m_lazyString;
	}
	else
		return m_head->buf + m_head->m_head;
}

byte * ByteQueue::CreatePutSpace(unsigned int &size)
{
	if (m_lazyLength > 0)
		FinalizeLazyPut();

	if (m_tail->m_tail == m_tail->MaxSize())
	{
		m_tail->next = new ByteQueueNode(size < m_nodeSize ? m_nodeSize : STDMAX(m_nodeSize, 1024U));
		m_tail = m_tail->next;
	}

	size = m_tail->MaxSize() - m_tail->m_tail;
	return m_tail->buf + m_tail->m_tail;
}

ByteQueue & ByteQueue::operator=(const ByteQueue &rhs)
{
	Destroy();
	CopyFrom(rhs);
	return *this;
}

bool ByteQueue::operator==(const ByteQueue &rhs) const
{
	const unsigned long currentSize = CurrentSize();

	if (currentSize != rhs.CurrentSize())
		return false;

	Walker walker1(*this), walker2(rhs);
	byte b1, b2;

	while (walker1.Get(b1) && walker2.Get(b2))
		if (b1 != b2)
			return false;

	return true;
}

byte ByteQueue::operator[](unsigned long i) const
{
	for (ByteQueueNode *current=m_head; current; current=current->next)
	{
		if (i < current->CurrentSize())
			return (*current)[i];
		
		i -= current->CurrentSize();
	}

	assert(i < m_lazyLength);
	return m_lazyString[i];
}

void ByteQueue::swap(ByteQueue &rhs)
{
	std::swap(m_nodeSize, rhs.m_nodeSize);
	std::swap(m_head, rhs.m_head);
	std::swap(m_tail, rhs.m_tail);
	std::swap(m_lazyString, rhs.m_lazyString);
	std::swap(m_lazyLength, rhs.m_lazyLength);
}

// ********************************************************

void ByteQueue::Walker::IsolatedInitialize(const NameValuePairs &parameters)
{
	m_node = m_queue.m_head;
	m_position = 0;
	m_offset = 0;
	m_lazyString = m_queue.m_lazyString;
	m_lazyLength = m_queue.m_lazyLength;
}

unsigned int ByteQueue::Walker::Get(byte &outByte)
{
	ArraySink sink(&outByte, 1);
	return TransferTo(sink, 1);
}

unsigned int ByteQueue::Walker::Get(byte *outString, unsigned int getMax)
{
	ArraySink sink(outString, getMax);
	return TransferTo(sink, getMax);
}

unsigned int ByteQueue::Walker::Peek(byte &outByte) const
{
	ArraySink sink(&outByte, 1);
	return CopyTo(sink, 1);
}

unsigned int ByteQueue::Walker::Peek(byte *outString, unsigned int peekMax) const
{
	ArraySink sink(outString, peekMax);
	return CopyTo(sink, peekMax);
}

unsigned int ByteQueue::Walker::TransferTo2(BufferedTransformation &target, unsigned long &transferBytes, const std::string &channel, bool blocking)
{
	unsigned long bytesLeft = transferBytes;
	unsigned int blockedBytes = 0;

	while (m_node)
	{
		unsigned int len = STDMIN(bytesLeft, (unsigned long)m_node->CurrentSize()-m_offset);
		blockedBytes = target.ChannelPut2(channel, m_node->buf+m_node->m_head+m_offset, len, 0, blocking);

		if (blockedBytes)
			goto done;

		m_position += len;
		bytesLeft -= len;

		if (!bytesLeft)
		{
			m_offset += len;
			goto done;
		}

		m_node = m_node->next;
		m_offset = 0;
	}

	if (bytesLeft && m_lazyLength)
	{
		unsigned int len = (unsigned int)STDMIN(bytesLeft, (unsigned long)m_lazyLength);
		unsigned int blockedBytes = target.ChannelPut2(channel, m_lazyString, len, 0, blocking);
		if (blockedBytes)
			goto done;

		m_lazyString += len;
		m_lazyLength -= len;
		bytesLeft -= len;
	}

done:
	transferBytes -= bytesLeft;
	return blockedBytes;
}

unsigned int ByteQueue::Walker::CopyRangeTo2(BufferedTransformation &target, unsigned long &begin, unsigned long end, const std::string &channel, bool blocking) const
{
	Walker walker(*this);
	walker.Skip(begin);
	unsigned long transferBytes = end-begin;
	unsigned int blockedBytes = walker.TransferTo2(target, transferBytes, channel, blocking);
	begin += transferBytes;
	return blockedBytes;
}

NAMESPACE_END

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美综合一区二区| 国产精品一区在线观看乱码 | 日本久久一区二区| 中文字幕佐山爱一区二区免费| 91蜜桃婷婷狠狠久久综合9色| 亚洲视频在线观看三级| 欧美在线一二三| 奇米色777欧美一区二区| 精品欧美黑人一区二区三区| 国产精品一级二级三级| 国产精品免费视频网站| 欧美性色黄大片手机版| 日韩有码一区二区三区| 久久综合久久99| a亚洲天堂av| 亚洲高清视频的网址| 精品国产电影一区二区| 北条麻妃一区二区三区| 亚洲国产cao| 欧美精品一区二区三区蜜臀| 91一区二区在线| 日韩中文欧美在线| 国产精品久久久久毛片软件| 欧美日韩美少妇| 国产成人8x视频一区二区| 一区二区理论电影在线观看| 欧美va亚洲va在线观看蝴蝶网| av亚洲精华国产精华| 青草av.久久免费一区| 国产精品美女一区二区| 日韩一卡二卡三卡| 色综合久久中文综合久久牛| 麻豆精品视频在线观看视频| 亚洲精品国产第一综合99久久| 欧美一区二区三区在线视频| 91麻豆国产精品久久| 国产自产高清不卡| 亚洲mv大片欧洲mv大片精品| 中文字幕第一区二区| 日韩情涩欧美日韩视频| 日本久久一区二区三区| 国产成人精品综合在线观看| 天堂精品中文字幕在线| 亚洲免费在线观看| 国产欧美一区二区精品仙草咪| 欧美一级电影网站| 欧美艳星brazzers| 91丝袜国产在线播放| 韩日精品视频一区| 日韩精品欧美成人高清一区二区| 成人免费小视频| 国产免费久久精品| 精品久久久久久久久久久久包黑料| 精品视频免费看| 91麻豆国产香蕉久久精品| 国产ts人妖一区二区| 国内不卡的二区三区中文字幕 | 亚洲欧洲另类国产综合| 久久综合九色综合97婷婷女人| 91精品国产综合久久久蜜臀粉嫩 | 欧美日韩一区二区三区免费看| av激情成人网| 高清beeg欧美| 国产成人丝袜美腿| 九一久久久久久| 免费成人深夜小野草| 免费看黄色91| 蜜桃一区二区三区在线观看| 日韩av一级片| 免费观看在线综合色| 日本中文字幕不卡| 视频一区在线视频| 天天综合网 天天综合色| 亚洲成国产人片在线观看| 亚洲国产成人91porn| 亚洲444eee在线观看| 五月天丁香久久| 蜜臀av在线播放一区二区三区| 视频在线观看一区二区三区| 天天综合网天天综合色| 日本欧美肥老太交大片| 另类人妖一区二区av| 久久99精品国产91久久来源| 国产一区视频导航| 成人涩涩免费视频| 色综合久久天天| 欧美日韩国产美女| 日韩一区二区中文字幕| 2023国产精华国产精品| 国产精品萝li| 亚洲精品国产视频| 天天综合网天天综合色| 久久99国内精品| 成人黄色av电影| 欧美亚洲图片小说| 欧美一级二级三级蜜桃| 国产日产精品一区| 一区二区三区在线观看动漫| 视频在线观看国产精品| 国产在线看一区| 国产成人精品亚洲777人妖| 91色婷婷久久久久合中文| 欧美日韩高清在线播放| 2020国产成人综合网| 成人免费在线视频观看| 日本中文字幕一区| 国产成人av电影| 欧美日韩成人一区二区| 精品久久久久一区| 亚洲精品菠萝久久久久久久| 日韩电影免费一区| 不卡一区二区在线| 欧美一区永久视频免费观看| 国产精品久久久久久久久久免费看| 亚洲五码中文字幕| 国产一区视频网站| 欧美午夜电影网| 久久嫩草精品久久久精品| 最新热久久免费视频| 美女网站色91| 在线视频一区二区三| 久久久亚洲高清| 午夜不卡在线视频| zzijzzij亚洲日本少妇熟睡| 欧美高清激情brazzers| 中文字幕在线一区二区三区| 麻豆久久久久久| 欧美日韩你懂的| 日韩美女视频一区二区| 国产乱妇无码大片在线观看| 欧美三级资源在线| 国产精品伦一区| 韩日精品视频一区| 欧美精品自拍偷拍动漫精品| 亚洲欧美日韩系列| 国产精品一二一区| 欧美成人猛片aaaaaaa| 樱花草国产18久久久久| 国产91精品露脸国语对白| 日韩欧美区一区二| 天天爽夜夜爽夜夜爽精品视频| 99热在这里有精品免费| 国产日韩欧美在线一区| 蓝色福利精品导航| 91精品国产欧美一区二区成人 | 蜜桃一区二区三区四区| 在线视频国内一区二区| 国产精品久久三| 国产大陆精品国产| 精品粉嫩aⅴ一区二区三区四区| 午夜天堂影视香蕉久久| 在线观看一区日韩| 亚洲日本乱码在线观看| 波波电影院一区二区三区| 国产欧美日韩在线观看| 欧美午夜一区二区三区免费大片| 久久精品水蜜桃av综合天堂| 久久成人免费网| 精品国产一二三| 国内精品伊人久久久久av影院| 日韩免费成人网| 免费在线欧美视频| 日韩欧美一二三| 久久激情五月婷婷| 日韩欧美专区在线| 精品一二三四区| 久久女同互慰一区二区三区| 国产精品1区2区| 国产午夜精品久久久久久久| 国产成人欧美日韩在线电影| 日本一区二区视频在线观看| 国产成人一级电影| 国产精品久久久久一区| 91浏览器在线视频| 亚洲高清一区二区三区| 91精品国产麻豆国产自产在线| 日本成人超碰在线观看| 欧美成人乱码一区二区三区| 国产一区二区三区久久久| 国产精品人成在线观看免费| 91亚洲精品久久久蜜桃| 亚洲综合区在线| 91麻豆精品久久久久蜜臀| 免费观看成人av| 国产精品色在线| 欧美日韩一区不卡| 久久超碰97人人做人人爱| 欧美经典三级视频一区二区三区| 9久草视频在线视频精品| 亚洲一区二区三区精品在线| 日韩一级视频免费观看在线| 国产成人综合在线观看| 一区二区三区在线视频免费观看| 欧美精品日日鲁夜夜添| 国产一区免费电影| 亚洲天堂精品视频| 日韩视频不卡中文| www.综合网.com| 秋霞午夜av一区二区三区| 国产精品美女久久久久久久久久久|