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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? aka.cpp

?? agsm a gsm sim manager for browsing, managing, and manipulating the phonebook,SMS on the SIM card. I
?? CPP
字號:
/* aka.c:  sha based function for aka */
#include "stdafx.h"
#include <string.h>
#include "aka.h"

static uchar counter[8]={0};

static uchar G[20] = {  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
						0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
						0x00, 0x00, 0x00, 0x2d};
static uchar A[20] = {  0x9d, 0xe9, 0xc9, 0xc8, 0xef, 0xd5, 0x78, 0x11,
						0x48, 0x23, 0x14, 0x01, 0x90, 0x1f, 0x2d, 0x49,
						0x3f, 0x4c, 0x63, 0x65};
static uchar B[20] = {  0x75, 0xef, 0xd1, 0x5c, 0x4b, 0x8f, 0x8f, 0x51,
						0x4e, 0xf3, 0xbc, 0xc3, 0x79, 0x4a, 0x76, 0x5e,
						0x7e, 0xec, 0x45, 0xe0};
static
void modred(uchar *z,int shift,uchar *base);

/* This function performs the operation of (A*X+B) mod 2^160+2^5+2^3+2^2+1
 *
 *
*/

void whiten(uchar xx[])
{
	uchar z[40];
	int i, j;

	/* calculate A * X in polynomial form */
	for (i=0;i<40;i++)
		z[i]=0;

	for (i=0;i<20;i++)
	{
		for (j=0;j<8;j++)
		{
			if ((xx[i]<<j) & 0x80)
				modred(z,159-(i*8+j),A); /* z^=A<<(159-(i*8+j)) */
		}
	}


	/* AX MOD G done as modular reduction for bit 160 to 319 */
	for (i=0;i<20;i++)
	{
		for (j=0;j<8;j++)
		{
			if ((z[i]<<j)&0x80)
				modred(z,159-(i*8+j),G);
		}
	}

	/* add B and copy back result */
	for (i = 0; i < 20; i++)
		xx[i] = z[i+20] ^ B[i];
}

/* This function perform the operation of shifting 320 bits and XOR.
 *
 *
*/

static
void modred(uchar *z,int shift,uchar *base)
{
	int byteshift, bitshift,i;
	uchar q[21],yn,yn1;

	for (i=0;i<20;i++)
		q[i] = base[i];
	q[20] = 0;

	/* we divide into byte shifting and bit shifting */
	byteshift = shift / 8;
	bitshift = shift % 8;

	/* do bit shifting */
	if (bitshift != 0)
	{
		yn = 0;
		for (i = 0; i <= 20; i++)
		{
			yn1 = yn;
			yn = q[i];
			q[i] >>= 8-bitshift;
			q[i] |= yn1 << bitshift;
		}
		/* shift one more byte, since bits have effectively been
		   shifted into the next byte upward */
		byteshift++;
	}

	/* z ^= q and send back result in z */
	for (i = 0; i < 20; i++)
		z[i+20-byteshift] ^= q[i];
	if (bitshift != 0)
		z[40-byteshift] ^= q[20];
}

/* This function performs generation of 64-bit pseudo random number RAND.
 *
 *
*/

void
f0(uchar seed[],uchar fi,uchar Fmk[],uchar buff[])
{
	SHA_INFO sha_info;
	uchar buf[64];
	uchar t;
	int i;

	shaInitial(&sha_info);
	for (i = 0; i < L_KEY; i++)
		sha_info.digest[i] ^= seed[i];

	for (i = 0; i < 64; i++)
		buf[i] = 0x5c;

	for (i = 0; i < 8; i++)
	{
		buf[i] ^= counter[i];
		buf[i+16] ^= counter[i];
		buf[i+32] ^= counter[i];
		buf[i+48] ^= counter[i];
	}

	buf[11] ^= fi;

	for (i = 0; i < 4; i++)
		buf[i+12] ^= Fmk[i];
	shaUpdate(&sha_info,buf,0,512);
	/* perform (AX+B)mod G */
	whiten(sha_info.digest);

	/* get 8 bytes or 64 bits */
	for (i=0;i<8;i++)
		buff[i] = sha_info.digest[i];

	/* increment counter */
	for (i = 7; i >= 0; i--)
	{
		t = counter[i];
		counter[i]++;
		if (counter[i] > t)
			break;
	}
}

/* This function performs generation of authentication signature MACA.
 *
 *
*/

void
f1(uchar K[],uchar fi,uchar *RAND,uchar Fmk[],uchar SQN[],uchar AMF[],uchar MACA[])
{
	SHA_INFO sha_info;
	uchar buf[64];
	int i;

	/* NOTE: the following initialization of the sha_info struct can be performed
	   once when K is provisioned, and the results copied into sha_info at the
	   start of this function. */
	shaInitial(&sha_info);
	for (i = 0; i < L_KEY; i++)
		sha_info.digest[i] ^= K[i];

	for (i = 0; i < 64; i++)
		buf[i] = 0x5c;

	for (i = 0; i < 4; i++)
		buf[i+12] ^= Fmk[i];
	for (i = 0; i < 16; i++)
		buf[i+16] ^= RAND[i];
	for (i = 0; i < 6; i++)
		buf[i+34] ^= SQN[i];
	for (i = 0; i < 2; i++)
		buf[i+42] ^= AMF[i];

	buf[11] ^= fi;

	shaUpdate(&sha_info,buf,0,512);

	/* perform (AX+B)mod G */
	whiten(sha_info.digest);

	for (i=0;i<L_MACA;i++)
		MACA[i] = sha_info.digest[i];
}

/* This function performs generation of resync authentication signature MACS.
 *
 *
*/

void
f1star(uchar K[],uchar fi,uchar *RAND,uchar Fmk[],uchar SQN[],uchar AMF[],uchar MACS[])
{
	SHA_INFO sha_info;
	uchar buf[64];
	int i;

	/* NOTE: the following initialization of the sha_info struct can be performed
	   once when K is provisioned, and the results copied into sha_info at the
	   start of this function. */
	shaInitial(&sha_info);
	for (i = 0; i < L_KEY; i++)
		sha_info.digest[i] ^= K[i];

	for (i = 0; i < 64; i++)
		buf[i] = 0x5c;

	for (i = 0; i < 4; i++)
		buf[i+12] ^= Fmk[i];
	for (i = 0; i < 16; i++)
		buf[i+16] ^= RAND[i];
	for (i = 0; i < 6; i++)
		buf[i+34] ^= SQN[i];
	for (i = 0; i < 2; i++)
		buf[i+42] ^= AMF[i];

	buf[11] ^= fi;

	shaUpdate(&sha_info,buf,0,512);

	/* perform (AX+B)mod G */
	whiten(sha_info.digest);

	for (i=0;i<L_MACS;i++)
		MACS[i] = sha_info.digest[i];
}

/* This function performs generation of user response RES.
 *
 *
*/

void
f2(uchar K[],uchar fi,uchar *RAND,uchar Fmk[],uchar RES[],int l_res)
{
	SHA_INFO sha_info;
	uchar j,buf[64];
	int i;

	if (l_res < 1)
		return;
	if (l_res > 16)
		l_res = 16;

	for (j = 0; j < 2; j++)
	{
		/* NOTE: the following initialization of the sha_info struct can be performed
		   once when K is provisioned, and the results copied into sha_info at the
		   start of this loop. */
		shaInitial(&sha_info);
		for (i = 0; i < L_KEY; i++)
			sha_info.digest[i] ^= K[i];

		for (i = 0; i < 64; i++)
			buf[i] = 0x5c;

		for (i = 0; i < 4; i++)
			buf[i+12] ^= Fmk[i];
		for (i = 0; i < 16; i++)
			buf[i+24] ^= RAND[i];

		buf[3] ^= j;
		buf[11] ^= fi;
		buf[19] ^= j;
		buf[35] ^= j;
		buf[51] ^= j;

		shaUpdate(&sha_info,buf,0,512);

		whiten(sha_info.digest);
		for (i=0;i<8;i++)
		{
			RES[8*j+i] = sha_info.digest[i];
			if (--l_res == 0)
				return;
		}
	}
}

/* This function performs generation of cipher key CK.
 *
 *
*/

void
f3(uchar K[],uchar fi,uchar *RAND,uchar Fmk[],uchar *CK)
{
	SHA_INFO sha_info;
	uchar j,buf[64];
	int i;

	for (j = 0; j < 2; j++)
	{
		/* NOTE: the following initialization of the sha_info struct can be performed
		   once when K is provisioned, and the results copied into sha_info at the
		   start of this loop. */
		shaInitial(&sha_info);
		for (i = 0; i < L_KEY; i++)
			sha_info.digest[i] ^= K[i];

		for (i = 0; i < 64; i++)
			buf[i] = 0x5c;

		for (i = 0; i < 4; i++)
			buf[i+12] ^= Fmk[i];
		for (i = 0; i < 16; i++)
			buf[i+24] ^= RAND[i];

		buf[3] ^= j;
		buf[11] ^= fi;
		buf[19] ^= j;
		buf[35] ^= j;
		buf[51] ^= j;

		shaUpdate(&sha_info,buf,0,512);

		whiten(sha_info.digest);
		for (i=0;i<8;i++)
			CK[8*j+i] = sha_info.digest[i];
	}
}

/* This function performs generation of integrity key IK.
 *
 *
*/

void
f4(uchar K[],uchar fi,uchar *RAND,uchar Fmk[],uchar *IK)
{
	SHA_INFO sha_info;
	uchar j,buf[64];
	int i;

	for (j = 0; j < 2; j++)
	{
		/* NOTE: the following initialization of the sha_info struct can be performed
		   once when K is provisioned, and the results copied into sha_info at the
		   start of this loop. */
		shaInitial(&sha_info);
		for (i = 0; i < L_KEY; i++)
			sha_info.digest[i] ^= K[i];

		for (i = 0; i < 64; i++)
			buf[i] = 0x5c;

		for (i = 0; i < 4; i++)
			buf[i+12] ^= Fmk[i];
		for (i = 0; i < 16; i++)
			buf[i+24] ^= RAND[i];

		buf[3] ^= j;
		buf[11] ^= fi;
		buf[19] ^= j;
		buf[35] ^= j;
		buf[51] ^= j;

		shaUpdate(&sha_info,buf,0,512);

		whiten(sha_info.digest);
		for (i=0;i<8;i++)
			IK[8*j+i] = sha_info.digest[i];
	}
}

/* This function performs generation of anonymity key AK.
 *
 *
*/

void
f5(uchar K[],uchar fi,uchar *RAND,uchar Fmk[],uchar AK[])
{
	SHA_INFO sha_info;
	uchar buf[64];
	int i;

	/* NOTE: the following initialization of the sha_info struct can be performed
	   once when K is provisioned, and the results copied into sha_info at the
	   start of this function. */
	shaInitial(&sha_info);
	for (i = 0; i < L_KEY; i++)
		sha_info.digest[i] ^= K[i];

	for (i = 0; i < 64; i++)
		buf[i] = 0x5c;

	for (i = 0; i < 4; i++)
		buf[i+12] ^= Fmk[i];
	for (i = 0; i < 16; i++)
		buf[i+16] ^= RAND[i];

	buf[11] ^= fi;

	shaUpdate(&sha_info,buf,0,512);

	/* perform (AX+B)mod G */
	whiten(sha_info.digest);

	for (i=0;i<L_AK;i++)
		AK[i] = sha_info.digest[i];
}

/* This function performs generation of anonymity key AK for
 * resynchronization.
 *
 *
*/

void
f5star(uchar K[],uchar fi,uchar *RAND,uchar Fmk[],uchar AKS[])
{
	SHA_INFO sha_info;
	uchar buf[64];
	int i;

	/* NOTE: the following initialization of the sha_info struct can be performed
	   once when K is provisioned, and the results copied into sha_info at the
	   start of this function. */
	shaInitial(&sha_info);
	for (i = 0; i < L_KEY; i++)
		sha_info.digest[i] ^= K[i];

	for (i = 0; i < 64; i++)
		buf[i] = 0x5c;

	for (i = 0; i < 4; i++)
		buf[i+12] ^= Fmk[i];
	for (i = 0; i < 16; i++)
		buf[i+16] ^= RAND[i];

	buf[11] ^= fi;

	shaUpdate(&sha_info,buf,0,512);

	/* perform (AX+B)mod G */
	whiten(sha_info.digest);

	for (i=0;i<L_AKS;i++)
		AKS[i] = sha_info.digest[i];
}

/*
 *This function performs generation of UMAC key UAK.
 *
*/
void
f11(uchar K[],uchar fi,uchar *RAND,uchar Fmk[],uchar *UAK)
{
  SHA_INFO sha_info;
  uchar i, buf[64];
  int j;
  for(i=0;i<2;i++)
  {
    /* NOTE: the following initialization of the sha_info struct can be performed
    once when K is provisioned, and the results copied into sha_info at the
    start of this loop. */
    shaInitial(&sha_info);
    for (j = 0; j < L_KEY; j++)
      sha_info.digest[j] ^= K[j];
    for (j = 0; j < 64; j++)
      buf[j] = 0x5c;
    for (j = 0; j < 4; j++)
      buf[j+12] ^= Fmk[j];
    for (j = 0; j < 16; j++)
      buf[j+24] ^= RAND[j];
    buf[3] ^= i;
    buf[11] ^= fi;
    buf[19] ^= i;
    buf[35] ^= i;
    buf[51] ^= i;
    shaUpdate(&sha_info,buf,0,512);
    whiten(sha_info.digest);
    for (j=0;j<8;j++)
      UAK[8*i+j] = sha_info.digest[j];
  }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
粉嫩av亚洲一区二区图片| 欧美欧美午夜aⅴ在线观看| av一区二区不卡| 69久久夜色精品国产69蝌蚪网| 久久精品人人做人人爽人人| 亚洲国产精品自拍| 成人精品小蝌蚪| 精品国产91乱码一区二区三区| 亚洲蜜臀av乱码久久精品| 国产主播一区二区三区| 欧美日韩一区成人| 亚洲激情自拍偷拍| 成人免费电影视频| 久久先锋影音av鲁色资源网| 日韩成人免费在线| 欧美日韩视频在线一区二区| 综合婷婷亚洲小说| 波多野结衣的一区二区三区| 久久一区二区视频| 精品一区二区三区的国产在线播放| 欧美无乱码久久久免费午夜一区| 中文字幕亚洲一区二区av在线| 国产一区欧美日韩| 久久婷婷国产综合精品青草| 日韩高清在线一区| 91麻豆精品国产91久久久久| 亚洲国产你懂的| 欧美三片在线视频观看| 亚洲精品网站在线观看| 99re66热这里只有精品3直播| 国产精品天美传媒| 不卡影院免费观看| 中文字幕中文乱码欧美一区二区 | 久久国产精品99久久久久久老狼 | 欧美三片在线视频观看| 亚洲婷婷综合色高清在线| 高清不卡在线观看av| 久久精品人人做人人综合 | 日韩欧美另类在线| 美国十次综合导航| 精品福利一二区| 国产成人日日夜夜| 国产精品拍天天在线| 99久精品国产| 亚洲一区中文日韩| 日韩亚洲国产中文字幕欧美| 美国十次综合导航| 国产亚洲女人久久久久毛片| 成人精品国产福利| 亚洲欧洲日韩av| 欧美日韩一级片网站| 亚洲综合色自拍一区| 91精品办公室少妇高潮对白| 亚洲成av人片观看| 欧美成人三级在线| 在线观看免费亚洲| 天堂蜜桃91精品| 久久综合九色综合欧美就去吻 | 91福利在线看| 首页国产欧美日韩丝袜| 精品理论电影在线观看| gogogo免费视频观看亚洲一| 亚洲一区二区三区四区不卡| 91精品国产综合久久久久久久久久 | 国产揄拍国内精品对白| 国产精品视频免费看| 欧美性色黄大片手机版| 国产一区二区三区在线观看免费视频 | 亚洲欧美电影一区二区| 欧美一区二区免费观在线| 国产99精品视频| 一区二区三区91| 国产亚洲综合av| 欧美三级一区二区| 国产91对白在线观看九色| 亚洲成人av福利| 国产日韩精品一区二区三区| 欧美日韩精品一区二区天天拍小说| 久久99国产乱子伦精品免费| 亚洲免费成人av| 国产午夜精品久久| 在线成人小视频| 99riav一区二区三区| 韩国精品主播一区二区在线观看 | 国产清纯白嫩初高生在线观看91 | 亚洲视频一区二区在线| 欧美mv日韩mv国产网站app| 色婷婷久久久综合中文字幕 | 石原莉奈在线亚洲二区| 国产精品三级在线观看| 日韩欧美卡一卡二| 欧美亚洲国产一区二区三区va| 国产乱色国产精品免费视频| 天天操天天综合网| 亚洲精品欧美专区| 中文字幕一区二区三区蜜月| 久久蜜臀精品av| 日韩午夜在线观看视频| 欧美亚洲综合另类| 色综合久久中文综合久久97| 国产精品一二一区| 狠狠色丁香九九婷婷综合五月| 日韩成人免费看| 午夜激情久久久| 一区二区在线看| 亚洲欧美日韩久久精品| 国产精品天干天干在观线| 久久九九久精品国产免费直播| 欧美一区二区三区白人| 欧美一区二区三区啪啪| 欧美精品vⅰdeose4hd| 欧美在线制服丝袜| 欧美专区在线观看一区| 色菇凉天天综合网| 在线观看精品一区| 精品1区2区3区| 欧美亚洲一区二区在线| 欧美视频一二三区| 在线成人av影院| 欧美一级理论性理论a| 日韩欧美国产综合一区| 日韩精品在线一区二区| 久久亚洲二区三区| 中文字幕免费不卡在线| 综合中文字幕亚洲| 亚洲自拍偷拍欧美| 日本sm残虐另类| 激情欧美一区二区| 成人app网站| 日本电影亚洲天堂一区| 欧美日本在线一区| 日韩精品一区二区三区在线播放| 精品va天堂亚洲国产| 国产日韩精品一区二区三区| 中文字幕亚洲电影| 香蕉成人伊视频在线观看| 日本视频中文字幕一区二区三区| 韩国理伦片一区二区三区在线播放 | 99久久久久久| 91一区在线观看| 午夜av区久久| 奇米影视一区二区三区小说| 奇米影视一区二区三区小说| 国内外精品视频| 91免费视频网址| 91麻豆精品国产91久久久资源速度 | 国产黄色精品网站| 色婷婷综合视频在线观看| 欧美一级夜夜爽| 中文字幕精品综合| 亚洲h精品动漫在线观看| 国产最新精品免费| 色婷婷激情综合| 亚洲精品在线观| 亚洲乱码国产乱码精品精98午夜| 日韩福利电影在线| 不卡电影免费在线播放一区| 91精品欧美久久久久久动漫| 国产精品欧美极品| 日韩高清电影一区| 99久久精品免费精品国产| 日韩一级欧美一级| 亚洲欧美国产高清| 国产精品一区久久久久| 在线成人av影院| 亚洲视频一二区| 国产精一区二区三区| 欧美色成人综合| 国产精品国产精品国产专区不蜜| 亚洲成年人影院| 色综合久久综合网97色综合| 久久影院视频免费| 琪琪久久久久日韩精品| 色综合激情五月| 国产欧美一区二区精品忘忧草 | 久久久精品欧美丰满| 亚洲午夜免费电影| 99久久99久久久精品齐齐| 日韩精品一区二区三区在线播放 | 久久国产夜色精品鲁鲁99| 色婷婷一区二区| 亚洲日本在线天堂| 成人综合婷婷国产精品久久免费| 欧美一级日韩一级| 午夜精品一区二区三区电影天堂| 99视频有精品| 国产精品福利影院| av午夜精品一区二区三区| 国产亚洲欧美中文| 国产成人a级片| 欧美精品一区二区三区在线播放 | 国产久卡久卡久卡久卡视频精品| 欧美精品v日韩精品v韩国精品v| 一区二区三区日韩精品视频| 成人av资源下载| 国产精品久久久久久久久图文区| 国产成人av一区二区三区在线观看| 欧美白人最猛性xxxxx69交| 蜜臀久久久99精品久久久久久| 91麻豆精品国产无毒不卡在线观看|