日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

SHA-1算法c语言实现

發(fā)布時(shí)間:2023/12/10 编程问答 49 豆豆
生活随笔 收集整理的這篇文章主要介紹了 SHA-1算法c语言实现 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

安全哈希算法(Secure Hash Algorithm)主要適用于數(shù)字簽名標(biāo)準(zhǔn) (Digital Signature Standard DSS)里面定義的數(shù)字簽名算法(Digital Signature Algorithm DSA)。對(duì)于長(zhǎng)度小于2^64位的消息。SHA1會(huì)產(chǎn)生一個(gè)160位的消息摘要。當(dāng)接收到消息的時(shí)候,這個(gè)消息摘要能夠用來(lái)驗(yàn)證數(shù)據(jù)的完整性。在傳輸?shù)倪^(guò)程中。數(shù)據(jù)非??赡軙?huì)發(fā)生變化,那么這時(shí)候就會(huì)產(chǎn)生不同的消息摘要。

SHA1有例如以下特性:不能夠從消息摘要中復(fù)原信息;兩個(gè)不同的消息不會(huì)產(chǎn)生相同的消息摘要。

算法實(shí)現(xiàn)的版本號(hào)比較多,下面代碼來(lái)自:http://download.csdn.net/detail/zhangrulzu/2936159,代碼行數(shù)非常少,但確實(shí)實(shí)現(xiàn)了想要的效果。

下載的SHA-1算法:

#include<stdio.h> void creat_w(unsigned char input[64],unsigned long w[80]) {int i,j;unsigned long temp,temp1;for(i=0;i<16;i++){j=4*i;w[i]=((long)input[j])<<24 |((long)input[1+j])<<16|((long)input[2+j])<<8|((long)input[3+j])<<0;}for(i=16;i<80;i++){w[i]=w[i-16]^w[i-14]^w[i-8]^w[i-3];temp=w[i]<<1;temp1=w[i]>>31;w[i]=temp|temp1;} } char ms_len(long a,char intput[64]) {unsigned long temp3,p1; int i,j;temp3=0;p1=~(~temp3<<8);for(i=0;i<4;i++){j=8*i;intput[63-i]=(char)((a&(p1<<j))>>j);}} main() {unsigned long H0=0x67452301,H1=0xefcdab89,H2=0x98badcfe,H3=0x10325476,H4=0xc3d2e1f0;unsigned long A,B,C,D,E,temp,temp1,temp2,temp3,k,f;int i,flag;unsigned long w[80];unsigned char input[64]; long x;int n;printf("input message:\n");scanf("%s",input);n=strlen(input);if(n<57){x=n*8;ms_len(x,input);if(n==56)for(i=n;i<60;i++)input[i]=0;else{input[n]=128;for(i=n+1;i<60;i++)input[i]=0;}}creat_w(input,w);/*for(i=0;i<80;i++)printf("%lx,",w[i]);*/printf("\n");A=H0;B=H1;C=H2;D=H3;E=H4;for(i=0;i<80;i++){flag=i/20;switch(flag){case 0: k=0x5a827999;f=(B&C)|(~B&D);break;case 1: k=0x6ed9eba1;f=B^C^D;break;case 2: k=0x8f1bbcdc;f=(B&C)|(B&D)|(C&D);break;case 3: k=0xca62c1d6;f=B^C^D;break;}/*printf("%lx,%lx\n",k,f); */temp1=A<<5;temp2=A>>27;temp3=temp1|temp2;temp=temp3+f+E+w[i]+k;E=D;D=C;temp1=B<<30;temp2=B>>2;C=temp1|temp2;B=A;A=temp;printf("%lx,%lx,%lx,%lx,%lx\n",A,B,C,D,E);}H0=H0+A;H1=H1+B;H2=H2+C;H3=H3+D;H4=H4+E;printf("\noutput hash value:\n");printf("%lx,%lx,%lx,%lx,%lx",H0,H1,H2,H3,H4);getch(); }

這里對(duì)算法驗(yàn)證過(guò)程做一個(gè)記錄說(shuō)明:

Visual Studio 2005,文件》新建》項(xiàng)目》Visual c++》Win32控制臺(tái)應(yīng)用程序,輸入項(xiàng)目名稱“SHA1”。完畢;

把下載的代碼貼到SHA1.cpp文件末尾,復(fù)制“int _tmain(int argc, _TCHAR* argv[])”,刪除_tmain函數(shù)。替換“main()”;

編譯代碼。提示下面錯(cuò)誤:

錯(cuò)誤 2 error C3861: “strlen”: 找不到標(biāo)識(shí)符 e:\devlop\sha1\sha1\sha1.cpp 43

錯(cuò)誤 3 error C2664: “ms_len”: 不能將參數(shù) 2 從“unsigned char [64]”轉(zhuǎn)換為“char []” e:\devlop\sha1\sha1\sha1.cpp 47

錯(cuò)誤 4 error C3861: “getch”: 找不到標(biāo)識(shí)符 e:\devlop\sha1\sha1\sha1.cpp 98

第一條是警告。能夠不處理

警告 1 warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. e:\devlop\sha1\sha1\sha1.cpp 42

雙擊錯(cuò)誤2。定位到錯(cuò)誤位置,在“strlen"上單擊鼠標(biāo)右鍵》Refactor》Add Include,例如以下圖:


假設(shè)沒(méi)有這一項(xiàng),那應(yīng)該是沒(méi)有安裝VC助手的原因;

雙擊錯(cuò)誤3,定位到錯(cuò)誤位置。在變量input前加(char*)強(qiáng)制轉(zhuǎn)換;

雙擊錯(cuò)誤4,定位到錯(cuò)誤位置,在“getch"上單擊鼠標(biāo)右鍵》Refactor》Add Include;

按F6鍵編譯項(xiàng)目,發(fā)現(xiàn)還有錯(cuò)誤:

錯(cuò)誤 2 error C2664: “strlen”: 不能將參數(shù) 1 從“unsigned char [64]”轉(zhuǎn)換為“const char *” e:\devlop\sha1\sha1\sha1.cpp 45

雙擊錯(cuò)誤2,定位到錯(cuò)誤位置,在input前加(LPSTR)強(qiáng)制轉(zhuǎn)換,編譯。還有錯(cuò)誤:

錯(cuò)誤 2 error C2065: “LPSTR”: 未聲明的標(biāo)識(shí)符 e:\devlop\sha1\sha1\sha1.cpp 45

錯(cuò)誤 3 error C2146: 語(yǔ)法錯(cuò)誤 : 缺少“)”(在標(biāo)識(shí)符“input”的前面) e:\devlop\sha1\sha1\sha1.cpp 45

錯(cuò)誤 4 error C2059: 語(yǔ)法錯(cuò)誤 : “)” e:\devlop\sha1\sha1\sha1.cpp 45

還是找不到標(biāo)識(shí)符。方法一樣:在“LPSTR"上單擊鼠標(biāo)右鍵》Refactor》Add Include;

再編譯。又報(bào)錯(cuò):

錯(cuò)誤 4 error C4716: “ms_len”: 必須返回一個(gè)值 e:\devlop\sha1\sha1\sha1.cpp 38

定位到錯(cuò)誤位置,細(xì)致看了一下,這個(gè)函數(shù)的返回值應(yīng)該沒(méi)什么用,隨便返回一個(gè):return '0';

再編譯,OK。最終生成成功了。

F5調(diào)試,輸入:abcd,回車。哦。輸出了好多東東,查看代碼的輸出調(diào)用,

找到92行應(yīng)該沒(méi)用,凝視://printf("%lx,%lx,%lx,%lx,%lx\n",A,B,C,D,E);//輸出編碼過(guò)程。

最后得到的SHA1哈希值中還有逗號(hào),找到100行。將printf("%lx,%lx,%lx,%lx,%lx",H0,H1,H2,H3,H4);格式化字符串中的逗號(hào)去掉;

再編譯。F5調(diào)試。輸入:abcd,回車,結(jié)果例如以下圖:


得到的結(jié)果對(duì)不正確呢。找到一個(gè)在線SHA1加密工具,輸入abcd,結(jié)果例如以下:


對(duì)照一下,OK,結(jié)果一至。

改動(dòng)后的SHA-1算法:

// SHA1.cpp : 定義控制臺(tái)應(yīng)用程序的入口點(diǎn)。 // #include "stdafx.h" #include<stdio.h> #include <string.h> #include <conio.h> #include <wtypes.h> void creat_w(unsigned char input[64],unsigned long w[80]) {int i,j;unsigned long temp,temp1;for(i=0;i<16;i++){j=4*i;w[i]=((long)input[j])<<24 |((long)input[1+j])<<16|((long)input[2+j])<<8|((long)input[3+j])<<0;}for(i=16;i<80;i++){w[i]=w[i-16]^w[i-14]^w[i-8]^w[i-3];temp=w[i]<<1;temp1=w[i]>>31;w[i]=temp|temp1;} } char ms_len(long a,char intput[64]) {unsigned long temp3,p1; int i,j;temp3=0;p1=~(~temp3<<8);for(i=0;i<4;i++){j=8*i;intput[63-i]=(char)((a&(p1<<j))>>j);}return '0'; } int _tmain(int argc, _TCHAR* argv[]) {unsigned long H0=0x67452301,H1=0xefcdab89,H2=0x98badcfe,H3=0x10325476,H4=0xc3d2e1f0;unsigned long A,B,C,D,E,temp,temp1,temp2,temp3,k,f;int i,flag;unsigned long w[80];unsigned char input[64]; long x;int n;printf("input message:\n");scanf("%s",input);n=strlen((LPSTR)input);if(n<57){x=n*8;ms_len(x,(char*)input);if(n==56)for(i=n;i<60;i++)input[i]=0;else{input[n]=128;for(i=n+1;i<60;i++)input[i]=0;}}creat_w(input,w);/*for(i=0;i<80;i++)printf("%lx,",w[i]);*/printf("\n");A=H0;B=H1;C=H2;D=H3;E=H4;for(i=0;i<80;i++){flag=i/20;switch(flag){case 0: k=0x5a827999;f=(B&C)|(~B&D);break;case 1: k=0x6ed9eba1;f=B^C^D;break;case 2: k=0x8f1bbcdc;f=(B&C)|(B&D)|(C&D);break;case 3: k=0xca62c1d6;f=B^C^D;break;}/*printf("%lx,%lx\n",k,f); */temp1=A<<5;temp2=A>>27;temp3=temp1|temp2;temp=temp3+f+E+w[i]+k;E=D;D=C;temp1=B<<30;temp2=B>>2;C=temp1|temp2;B=A;A=temp;//printf("%lx,%lx,%lx,%lx,%lx\n",A,B,C,D,E);//輸出編碼過(guò)程}H0=H0+A;H1=H1+B;H2=H2+C;H3=H3+D;H4=H4+E;printf("\noutput hash value:\n");printf("%lx%lx%lx%lx%lx",H0,H1,H2,H3,H4);getch(); }

改動(dòng)后項(xiàng)目源代碼下載:http://download.csdn.net/detail/testcs_dn/7344003

注意:此代碼存在局限性,字符數(shù)大于57的時(shí)候,結(jié)果就不正確了!

sha-1僅僅滿足64比特的輸入 期中有8比特是用于長(zhǎng)度的所以大于57的就加不了密了!

研究算法原理的朋友請(qǐng)參考:Redis源代碼中探秘SHA-1算法原理及其編程實(shí)現(xiàn)

以及下面的RFC文檔:沒(méi)有找到中文版??碋文吧!

RFC中已經(jīng)給出了實(shí)現(xiàn)代碼。感興趣的小伙伴能夠提取出來(lái)驗(yàn)證!

Network Working Group D. Eastlake, 3rd Request for Comments: 3174 Motorola Category: Informational P. JonesCisco SystemsSeptember 2001US Secure Hash Algorithm 1 (SHA1)Status of this MemoThis memo provides information for the Internet community. It doesnot specify an Internet standard of any kind. Distribution of thismemo is unlimited.Copyright NoticeCopyright (C) The Internet Society (2001). All Rights Reserved.AbstractThe purpose of this document is to make the SHA-1 (Secure HashAlgorithm 1) hash algorithm conveniently available to the Internetcommunity. The United States of America has adopted the SHA-1 hashalgorithm described herein as a Federal Information ProcessingStandard. Most of the text herein was taken by the authors from FIPS180-1. Only the C code implementation is "original".AcknowledgementsMost of the text herein was taken from [FIPS 180-1]. Only the C codeimplementation is "original" but its style is similar to thepreviously published MD4 and MD5 RFCs [RFCs 1320, 1321].The SHA-1 is based on principles similar to those used by ProfessorRonald L. Rivest of MIT when designing the MD4 message digestalgorithm [MD4] and is modeled after that algorithm [RFC 1320].Useful comments from the following, which have been incorporatedherein, are gratefully acknowledged:Tony HansenGarrett WollmanEastlake & Jones Informational [Page 1]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001Table of Contents1. Overview of Contents........................................... 22. Definitions of Bit Strings and Integers........................ 33. Operations on Words............................................ 34. Message Padding................................................ 45. Functions and Constants Used................................... 66. Computing the Message Digest................................... 66.1 Method 1...................................................... 66.2 Method 2...................................................... 77. C Code......................................................... 87.1 .h file....................................................... 87.2 .c file....................................................... 107.3 Test Driver................................................... 188. Security Considerations........................................ 20References........................................................ 21Authors' Addresses................................................ 21Full Copyright Statement.......................................... 221. Overview of ContentsNOTE: The text below is mostly taken from [FIPS 180-1] and assertionstherein of the security of SHA-1 are made by the US Government, theauthor of [FIPS 180-1], and not by the authors of this document.This document specifies a Secure Hash Algorithm, SHA-1, for computinga condensed representation of a message or a data file. When amessage of any length < 2^64 bits is input, the SHA-1 produces a160-bit output called a message digest. The message digest can then,for example, be input to a signature algorithm which generates orverifies the signature for the message. Signing the message digestrather than the message often improves the efficiency of the processbecause the message digest is usually much smaller in size than themessage. The same hash algorithm must be used by the verifier of adigital signature as was used by the creator of the digitalsignature. Any change to the message in transit will, with very highprobability, result in a different message digest, and the signaturewill fail to verify.The SHA-1 is called secure because it is computationally infeasibleto find a message which corresponds to a given message digest, or tofind two different messages which produce the same message digest.Any change to a message in transit will, with very high probability,result in a different message digest, and the signature will fail toverify.Eastlake & Jones Informational [Page 2]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001Section 2 below defines the terminology and functions used asbuilding blocks to form SHA-1.2. Definitions of Bit Strings and IntegersThe following terminology related to bit strings and integers will beused:a. A hex digit is an element of the set {0, 1, ... , 9, A, ... , F}.A hex digit is the representation of a 4-bit string. Examples: 7= 0111, A = 1010.b. A word equals a 32-bit string which may be represented as asequence of 8 hex digits. To convert a word to 8 hex digits each4-bit string is converted to its hex equivalent as described in(a) above. Example:1010 0001 0000 0011 1111 1110 0010 0011 = A103FE23.c. An integer between 0 and 2^32 - 1 inclusive may be represented asa word. The least significant four bits of the integer arerepresented by the right-most hex digit of the wordrepresentation. Example: the integer 291 = 2^8+2^5+2^1+2^0 =256+32+2+1 is represented by the hex word, 00000123.If z is an integer, 0 <= z < 2^64, then z = (2^32)x + y where 0 <=x < 2^32 and 0 <= y < 2^32. Since x and y can be represented aswords X and Y, respectively, z can be represented as the pair ofwords (X,Y).d. block = 512-bit string. A block (e.g., B) may be represented as asequence of 16 words.3. Operations on WordsThe following logical operators will be applied to words:a. Bitwise logical word operationsX AND Y = bitwise logical "and" of X and Y.X OR Y = bitwise logical "inclusive-or" of X and Y.X XOR Y = bitwise logical "exclusive-or" of X and Y.NOT X = bitwise logical "complement" of X.Eastlake & Jones Informational [Page 3]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001Example:01101100101110011101001001111011XOR 01100101110000010110100110110111--------------------------------= 00001001011110001011101111001100b. The operation X + Y is defined as follows: words X and Yrepresent integers x and y, where 0 <= x < 2^32 and 0 <= y < 2^32.For positive integers n and m, let n mod m be the remainder upondividing n by m. Computez = (x + y) mod 2^32.Then 0 <= z < 2^32. Convert z to a word, Z, and define Z = X +Y.c. The circular left shift operation S^n(X), where X is a word and nis an integer with 0 <= n < 32, is defined byS^n(X) = (X << n) OR (X >> 32-n).In the above, X << n is obtained as follows: discard the left-mostn bits of X and then pad the result with n zeroes on the right(the result will still be 32 bits). X >> n is obtained bydiscarding the right-most n bits of X and then padding the resultwith n zeroes on the left. Thus S^n(X) is equivalent to acircular shift of X by n positions to the left.4. Message PaddingSHA-1 is used to compute a message digest for a message or data filethat is provided as input. The message or data file should beconsidered to be a bit string. The length of the message is thenumber of bits in the message (the empty message has length 0). Ifthe number of bits in a message is a multiple of 8, for compactnesswe can represent the message in hex. The purpose of message paddingis to make the total length of a padded message a multiple of 512.SHA-1 sequentially processes blocks of 512 bits when computing themessage digest. The following specifies how this padding shall beperformed. As a summary, a "1" followed by m "0"s followed by a 64-bit integer are appended to the end of the message to produce apadded message of length 512 * n. The 64-bit integer is the lengthof the original message. The padded message is then processed by theSHA-1 as n 512-bit blocks.Eastlake & Jones Informational [Page 4]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001Suppose a message has length l < 2^64. Before it is input to theSHA-1, the message is padded on the right as follows:a. "1" is appended. Example: if the original message is "01010000",this is padded to "010100001".b. "0"s are appended. The number of "0"s will depend on the originallength of the message. The last 64 bits of the last 512-bit blockare reservedfor the length l of the original message.Example: Suppose the original message is the bit string01100001 01100010 01100011 01100100 01100101.After step (a) this gives01100001 01100010 01100011 01100100 01100101 1.Since l = 40, the number of bits in the above is 41 and 407 "0"sare appended, making the total now 448. This gives (in hex)61626364 65800000 00000000 0000000000000000 00000000 00000000 0000000000000000 00000000 00000000 0000000000000000 00000000.c. Obtain the 2-word representation of l, the number of bits in theoriginal message. If l < 2^32 then the first word is all zeroes.Append these two words to the padded message.Example: Suppose the original message is as in (b). Then l = 40(note that l is computed before any padding). The two-wordrepresentation of 40 is hex 00000000 00000028. Hence the finalpadded message is hex61626364 65800000 00000000 0000000000000000 00000000 00000000 0000000000000000 00000000 00000000 0000000000000000 00000000 00000000 00000028.The padded message will contain 16 * n words for some n > 0.The padded message is regarded as a sequence of n blocks M(1) ,M(2), first characters (or bits) of the message.Eastlake & Jones Informational [Page 5]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 20015. Functions and Constants UsedA sequence of logical functions f(0), f(1),..., f(79) is used inSHA-1. Each f(t), 0 <= t <= 79, operates on three 32-bit words B, C,D and produces a 32-bit word as output. f(t;B,C,D) is defined asfollows: for words B, C, D,f(t;B,C,D) = (B AND C) OR ((NOT B) AND D) ( 0 <= t <= 19)f(t;B,C,D) = B XOR C XOR D (20 <= t <= 39)f(t;B,C,D) = (B AND C) OR (B AND D) OR (C AND D) (40 <= t <= 59)f(t;B,C,D) = B XOR C XOR D (60 <= t <= 79).A sequence of constant words K(0), K(1), ... , K(79) is used in theSHA-1. In hex these are given byK(t) = 5A827999 ( 0 <= t <= 19)K(t) = 6ED9EBA1 (20 <= t <= 39)K(t) = 8F1BBCDC (40 <= t <= 59)K(t) = CA62C1D6 (60 <= t <= 79).6. Computing the Message DigestThe methods given in 6.1 and 6.2 below yield the same message digest.Although using method 2 saves sixty-four 32-bit words of storage, itis likely to lengthen execution time due to the increased complexityof the address computations for the { W[t] } in step (c). There areother computation methods which give identical results.6.1 Method 1The message digest is computed using the message padded as describedin section 4. The computation is described using two buffers, eachconsisting of five 32-bit words, and a sequence of eighty 32-bitwords. The words of the first 5-word buffer are labeled A,B,C,D,E.The words of the second 5-word buffer are labeled H0, H1, H2, H3, H4.The words of the 80-word sequence are labeled W(0), W(1),..., W(79).A single word buffer TEMP is also employed.To generate the message digest, the 16-word blocks M(1), M(2),...,M(n) defined in section 4 are processed in order. The processing ofeach M(i) involves 80 steps.Eastlake & Jones Informational [Page 6]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001Before processing any blocks, the H's are initialized as follows: inhex,H0 = 67452301H1 = EFCDAB89H2 = 98BADCFEH3 = 10325476H4 = C3D2E1F0.Now M(1), M(2), ... , M(n) are processed. To process M(i), weproceed as follows:a. Divide M(i) into 16 words W(0), W(1), ... , W(15), where W(0)is the left-most word.b. For t = 16 to 79 letW(t) = S^1(W(t-3) XOR W(t-8) XOR W(t-14) XOR W(t-16)).c. Let A = H0, B = H1, C = H2, D = H3, E = H4.d. For t = 0 to 79 doTEMP = S^5(A) + f(t;B,C,D) + E + W(t) + K(t);E = D; D = C; C = S^30(B); B = A; A = TEMP;e. Let H0 = H0 + A, H1 = H1 + B, H2 = H2 + C, H3 = H3 + D, H4 = H4+ E.After processing M(n), the message digest is the 160-bit stringrepresented by the 5 wordsH0 H1 H2 H3 H4.6.2 Method 2The method above assumes that the sequence W(0), ... , W(79) isimplemented as an array of eighty 32-bit words. This is efficientfrom the standpoint of minimization of execution time, since theaddresses of W(t-3), ... ,W(t-16) in step (b) are easily computed.If space is at a premium, an alternative is to regard { W(t) } as aEastlake & Jones Informational [Page 7]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001circular queue, which may be implemented using an array of sixteen32-bit words W[0], ... W[15]. In this case, in hex letMASK = 0000000F. Then processing of M(i) is as follows:a. Divide M(i) into 16 words W[0], ... , W[15], where W[0] is theleft-most word.b. Let A = H0, B = H1, C = H2, D = H3, E = H4.c. For t = 0 to 79 dos = t AND MASK;if (t >= 16) W[s] = S^1(W[(s + 13) AND MASK] XOR W[(s + 8) ANDMASK] XOR W[(s + 2) AND MASK] XOR W[s]);TEMP = S^5(A) + f(t;B,C,D) + E + W[s] + K(t);E = D; D = C; C = S^30(B); B = A; A = TEMP;d. Let H0 = H0 + A, H1 = H1 + B, H2 = H2 + C, H3 = H3 + D, H4 = H4+ E.7. C CodeBelow is a demonstration implementation of SHA-1 in C. Section 7.1contains the header file, 7.2 the C code, and 7.3 a test driver.7.1 .h file/** sha1.h** Description:* This is the header file for code which implements the Secure* Hashing Algorithm 1 as defined in FIPS PUB 180-1 published* April 17, 1995.** Many of the variable names in this code, especially the* single character names, were used because those were the names* used in the publication.** Please read the file sha1.c for more information.**/Eastlake & Jones Informational [Page 8]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001#ifndef _SHA1_H_ #define _SHA1_H_#include <stdint.h> /** If you do not have the ISO standard stdint.h header file, then you* must typdef the following:* name meaning* uint32_t unsigned 32 bit integer* uint8_t unsigned 8 bit integer (i.e., unsigned char)* int_least16_t integer of >= 16 bits**/#ifndef _SHA_enum_ #define _SHA_enum_ enum {shaSuccess = 0,shaNull, /* Null pointer parameter */shaInputTooLong, /* input data too long */shaStateError /* called Input after Result */ }; #endif #define SHA1HashSize 20/** This structure will hold context information for the SHA-1* hashing operation*/ typedef struct SHA1Context {uint32_t Intermediate_Hash[SHA1HashSize/4]; /* Message Digest */uint32_t Length_Low; /* Message length in bits */uint32_t Length_High; /* Message length in bits *//* Index into message block array */int_least16_t Message_Block_Index;uint8_t Message_Block[64]; /* 512-bit message blocks */int Computed; /* Is the digest computed? */int Corrupted; /* Is the message digest corrupted? */ } SHA1Context;/** Function Prototypes*/Eastlake & Jones Informational [Page 9]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001int SHA1Reset( SHA1Context *); int SHA1Input( SHA1Context *,const uint8_t *,unsigned int); int SHA1Result( SHA1Context *,uint8_t Message_Digest[SHA1HashSize]);#endif7.2 .c file/** sha1.c** Description:* This file implements the Secure Hashing Algorithm 1 as* defined in FIPS PUB 180-1 published April 17, 1995.** The SHA-1, produces a 160-bit message digest for a given* data stream. It should take about 2**n steps to find a* message with the same digest as a given message and* 2**(n/2) to find any two messages with the same digest,* when n is the digest size in bits. Therefore, this* algorithm can serve as a means of providing a* "fingerprint" for a message.** Portability Issues:* SHA-1 is defined in terms of 32-bit "words". This code* uses <stdint.h> (included via "sha1.h" to define 32 and 8* bit unsigned integer types. If your C compiler does not* support 32 bit unsigned integers, this code is not* appropriate.** Caveats:* SHA-1 is designed to work with messages less than 2^64 bits* long. Although SHA-1 allows a message digest to be generated* for messages of any number of bits less than 2^64, this* implementation only works with messages with a length that is* a multiple of the size of an 8-bit character.**/Eastlake & Jones Informational [Page 10]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001#include "sha1.h"/** Define the SHA1 circular left shift macro*/ #define SHA1CircularShift(bits,word) \(((word) << (bits)) | ((word) >> (32-(bits))))/* Local Function Prototyptes */ void SHA1PadMessage(SHA1Context *); void SHA1ProcessMessageBlock(SHA1Context *);/** SHA1Reset** Description:* This function will initialize the SHA1Context in preparation* for computing a new SHA1 message digest.** Parameters:* context: [in/out]* The context to reset.** Returns:* sha Error Code.**/ int SHA1Reset(SHA1Context *context) {if (!context){return shaNull;}context->Length_Low = 0;context->Length_High = 0;context->Message_Block_Index = 0;context->Intermediate_Hash[0] = 0x67452301;context->Intermediate_Hash[1] = 0xEFCDAB89;context->Intermediate_Hash[2] = 0x98BADCFE;context->Intermediate_Hash[3] = 0x10325476;context->Intermediate_Hash[4] = 0xC3D2E1F0;context->Computed = 0;context->Corrupted = 0;Eastlake & Jones Informational [Page 11]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001return shaSuccess; }/** SHA1Result** Description:* This function will return the 160-bit message digest into the* Message_Digest array provided by the caller.* NOTE: The first octet of hash is stored in the 0th element,* the last octet of hash in the 19th element.** Parameters:* context: [in/out]* The context to use to calculate the SHA-1 hash.* Message_Digest: [out]* Where the digest is returned.** Returns:* sha Error Code.**/ int SHA1Result( SHA1Context *context,uint8_t Message_Digest[SHA1HashSize]) {int i;if (!context || !Message_Digest){return shaNull;}if (context->Corrupted){return context->Corrupted;}if (!context->Computed){SHA1PadMessage(context);for(i=0; i<64; ++i){/* message may be sensitive, clear it out */context->Message_Block[i] = 0;}context->Length_Low = 0; /* and clear length */context->Length_High = 0;context->Computed = 1;Eastlake & Jones Informational [Page 12]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001}for(i = 0; i < SHA1HashSize; ++i){Message_Digest[i] = context->Intermediate_Hash[i>>2]>> 8 * ( 3 - ( i & 0x03 ) );}return shaSuccess; }/** SHA1Input** Description:* This function accepts an array of octets as the next portion* of the message.** Parameters:* context: [in/out]* The SHA context to update* message_array: [in]* An array of characters representing the next portion of* the message.* length: [in]* The length of the message in message_array** Returns:* sha Error Code.**/ int SHA1Input( SHA1Context *context,const uint8_t *message_array,unsigned length) {if (!length){return shaSuccess;}if (!context || !message_array){return shaNull;}if (context->Computed){context->Corrupted = shaStateError;Eastlake & Jones Informational [Page 13]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001return shaStateError;}if (context->Corrupted){return context->Corrupted;}while(length-- && !context->Corrupted){context->Message_Block[context->Message_Block_Index++] =(*message_array & 0xFF);context->Length_Low += 8;if (context->Length_Low == 0){context->Length_High++;if (context->Length_High == 0){/* Message is too long */context->Corrupted = 1;}}if (context->Message_Block_Index == 64){SHA1ProcessMessageBlock(context);}message_array++;}return shaSuccess; }/** SHA1ProcessMessageBlock** Description:* This function will process the next 512 bits of the message* stored in the Message_Block array.** Parameters:* None.** Returns:* Nothing.** Comments:Eastlake & Jones Informational [Page 14]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001* Many of the variable names in this code, especially the* single character names, were used because those were the* names used in the publication.***/ void SHA1ProcessMessageBlock(SHA1Context *context) {const uint32_t K[] = { /* Constants defined in SHA-1 */0x5A827999,0x6ED9EBA1,0x8F1BBCDC,0xCA62C1D6};int t; /* Loop counter */uint32_t temp; /* Temporary word value */uint32_t W[80]; /* Word sequence */uint32_t A, B, C, D, E; /* Word buffers *//** Initialize the first 16 words in the array W*/for(t = 0; t < 16; t++){W[t] = context->Message_Block[t * 4] << 24;W[t] |= context->Message_Block[t * 4 + 1] << 16;W[t] |= context->Message_Block[t * 4 + 2] << 8;W[t] |= context->Message_Block[t * 4 + 3];}for(t = 16; t < 80; t++){W[t] = SHA1CircularShift(1,W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]);}A = context->Intermediate_Hash[0];B = context->Intermediate_Hash[1];C = context->Intermediate_Hash[2];D = context->Intermediate_Hash[3];E = context->Intermediate_Hash[4];for(t = 0; t < 20; t++){temp = SHA1CircularShift(5,A) +((B & C) | ((~B) & D)) + E + W[t] + K[0];E = D;D = C;C = SHA1CircularShift(30,B);Eastlake & Jones Informational [Page 15]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001B = A;A = temp;}for(t = 20; t < 40; t++){temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[1];E = D;D = C;C = SHA1CircularShift(30,B);B = A;A = temp;}for(t = 40; t < 60; t++){temp = SHA1CircularShift(5,A) +((B & C) | (B & D) | (C & D)) + E + W[t] + K[2];E = D;D = C;C = SHA1CircularShift(30,B);B = A;A = temp;}for(t = 60; t < 80; t++){temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[3];E = D;D = C;C = SHA1CircularShift(30,B);B = A;A = temp;}context->Intermediate_Hash[0] += A;context->Intermediate_Hash[1] += B;context->Intermediate_Hash[2] += C;context->Intermediate_Hash[3] += D;context->Intermediate_Hash[4] += E;context->Message_Block_Index = 0; }/** SHA1PadMessage*Eastlake & Jones Informational [Page 16]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001* Description:* According to the standard, the message must be padded to an even* 512 bits. The first padding bit must be a '1'. The last 64* bits represent the length of the original message. All bits in* between should be 0. This function will pad the message* according to those rules by filling the Message_Block array* accordingly. It will also call the ProcessMessageBlock function* provided appropriately. When it returns, it can be assumed that* the message digest has been computed.** Parameters:* context: [in/out]* The context to pad* ProcessMessageBlock: [in]* The appropriate SHA*ProcessMessageBlock function* Returns:* Nothing.**/void SHA1PadMessage(SHA1Context *context) {/** Check to see if the current message block is too small to hold* the initial padding bits and length. If so, we will pad the* block, process it, and then continue padding into a second* block.*/if (context->Message_Block_Index > 55){context->Message_Block[context->Message_Block_Index++] = 0x80;while(context->Message_Block_Index < 64){context->Message_Block[context->Message_Block_Index++] = 0;}SHA1ProcessMessageBlock(context);while(context->Message_Block_Index < 56){context->Message_Block[context->Message_Block_Index++] = 0;}}else{context->Message_Block[context->Message_Block_Index++] = 0x80;while(context->Message_Block_Index < 56){Eastlake & Jones Informational [Page 17]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001context->Message_Block[context->Message_Block_Index++] = 0;}}/** Store the message length as the last 8 octets*/context->Message_Block[56] = context->Length_High >> 24;context->Message_Block[57] = context->Length_High >> 16;context->Message_Block[58] = context->Length_High >> 8;context->Message_Block[59] = context->Length_High;context->Message_Block[60] = context->Length_Low >> 24;context->Message_Block[61] = context->Length_Low >> 16;context->Message_Block[62] = context->Length_Low >> 8;context->Message_Block[63] = context->Length_Low;SHA1ProcessMessageBlock(context); }7.3 Test DriverThe following code is a main program test driver to exercise the codein sha1.c./** sha1test.c** Description:* This file will exercise the SHA-1 code performing the three* tests documented in FIPS PUB 180-1 plus one which calls* SHA1Input with an exact multiple of 512 bits, plus a few* error test checks.** Portability Issues:* None.**/#include <stdint.h> #include <stdio.h> #include <string.h> #include "sha1.h"/** Define patterns for testing*/ #define TEST1 "abc" #define TEST2a "abcdbcdecdefdefgefghfghighijhi"Eastlake & Jones Informational [Page 18]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001#define TEST2b "jkijkljklmklmnlmnomnopnopq" #define TEST2 TEST2a TEST2b #define TEST3 "a" #define TEST4a "01234567012345670123456701234567" #define TEST4b "01234567012345670123456701234567"/* an exact multiple of 512 bits */ #define TEST4 TEST4a TEST4b char *testarray[4] = {TEST1,TEST2,TEST3,TEST4 }; long int repeatcount[4] = { 1, 1, 1000000, 10 }; char *resultarray[4] = {"A9 99 3E 36 47 06 81 6A BA 3E 25 71 78 50 C2 6C 9C D0 D8 9D","84 98 3E 44 1C 3B D2 6E BA AE 4A A1 F9 51 29 E5 E5 46 70 F1","34 AA 97 3C D4 C4 DA A4 F6 1E EB 2B DB AD 27 31 65 34 01 6F","DE A3 56 A2 CD DD 90 C7 A7 EC ED C5 EB B5 63 93 4F 46 04 52" };int main() {SHA1Context sha;int i, j, err;uint8_t Message_Digest[20];/** Perform SHA-1 tests*/for(j = 0; j < 4; ++j){printf( "\nTest %d: %d, '%s'\n",j+1,repeatcount[j],testarray[j]);err = SHA1Reset(&sha);if (err){fprintf(stderr, "SHA1Reset Error %d.\n", err );break; /* out of for j loop */}for(i = 0; i < repeatcount[j]; ++i){Eastlake & Jones Informational [Page 19]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001err = SHA1Input(&sha,(const unsigned char *) testarray[j],strlen(testarray[j]));if (err){fprintf(stderr, "SHA1Input Error %d.\n", err );break; /* out of for i loop */}}err = SHA1Result(&sha, Message_Digest);if (err){fprintf(stderr,"SHA1Result Error %d, could not compute message digest.\n",err );}else{printf("\t");for(i = 0; i < 20 ; ++i){printf("%02X ", Message_Digest[i]);}printf("\n");}printf("Should match:\n");printf("\t%s\n", resultarray[j]);}/* Test some error returns */err = SHA1Input(&sha,(const unsigned char *) testarray[1], 1);printf ("\nError %d. Should be %d.\n", err, shaStateError );err = SHA1Reset(0);printf ("\nError %d. Should be %d.\n", err, shaNull );return 0; }8. Security ConsiderationsThis document is intended to provide convenient open source access bythe Internet community to the United States of America FederalInformation Processing Standard Secure Hash Function SHA-1 [FIPS180-1]. No independent assertion of the security of this hashfunction by the authors for any particular use is intended.Eastlake & Jones Informational [Page 20]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001References[FIPS 180-1] "Secure Hash Standard", United States of American,National Institute of Science and Technology, FederalInformation Processing Standard (FIPS) 180-1, April1993.[MD4] "The MD4 Message Digest Algorithm," Advances inCryptology - CRYPTO '90 Proceedings, Springer-Verlag,1991, pp. 303-311.[RFC 1320] Rivest, R., "The MD4 Message-Digest Algorithm", RFC1320, April 1992.[RFC 1321] Rivest, R., "The MD5 Message-Digest Algorithm", RFC1321, April 1992.[RFC 1750] Eastlake, D., Crocker, S. and J. Schiller, "RandomnessRequirements for Security", RFC 1750, December 1994.Authors' AddressesDonald E. Eastlake, 3rdMotorola155 Beaver StreetMilford, MA 01757 USAPhone: +1 508-634-2066 (h)+1 508-261-5434 (w)Fax: +1 508-261-4777EMail: Donald.Eastlake@motorola.comPaul E. JonesCisco Systems, Inc.7025 Kit Creek RoadResearch Triangle Park, NC 27709 USAPhone: +1 919 392 6948EMail: paulej@packetizer.comEastlake & Jones Informational [Page 21]RFC 3174 US Secure Hash Algorithm 1 (SHA1) September 2001Full Copyright StatementCopyright (C) The Internet Society (2001). All Rights Reserved.This document and translations of it may be copied and furnished toothers, and derivative works that comment on or otherwise explain itor assist in its implementation may be prepared, copied, publishedand distributed, in whole or in part, without restriction of anykind, provided that the above copyright notice and this paragraph areincluded on all such copies and derivative works. However, thisdocument itself may not be modified in any way, such as by removingthe copyright notice or references to the Internet Society or otherInternet organizations, except as needed for the purpose ofdeveloping Internet standards in which case the procedures forcopyrights defined in the Internet Standards process must befollowed, or as required to translate it into languages other thanEnglish.The limited permissions granted above are perpetual and will not berevoked by the Internet Society or its successors or assigns.This document and the information contained herein is provided on an"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERINGTASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDINGBUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATIONHEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OFMERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.AcknowledgementFunding for the RFC Editor function is currently provided by theInternet Society.Eastlake & Jones Informational [Page 22]

======================文檔信息===========================

版權(quán)聲明:非商用自由轉(zhuǎn)載-保持署名-注明出處

署名(BY) :testcs_dn(微wx笑)

文章出處:[無(wú)知人生。記錄點(diǎn)滴](http://blog.csdn.net/testcs_dn)

轉(zhuǎn)載于:https://www.cnblogs.com/jzssuanfa/p/6785543.html

總結(jié)

以上是生活随笔為你收集整理的SHA-1算法c语言实现的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。

久久九九国产精品 | 91九色蝌蚪视频网站 | 久久永久免费视频 | 国产亚洲久一区二区 | 天天操天天射天天舔 | 免费av黄色 | 在线www色 | 午夜久久久久久久久久影院 | 亚洲国产精品va在线 | 国产理伦在线 | 国产成人精品一区二区三区在线 | av片一区| 五月天六月色 | 69国产盗摄一区二区三区五区 | 日日操日日插 | 欧美日韩电影在线播放 | 久久久久久综合 | 国模视频一区二区三区 | 国产精品欧美久久 | 国产成人99av超碰超爽 | 欧美一区二区免费在线观看 | 中文区中文字幕免费看 | 91在线免费观看国产 | 日本黄色片一区二区 | 国产91精品在线观看 | 久久色在线播放 | 在线观看日韩国产 | 国产乱码精品一区二区蜜臀 | 免费观看完整版无人区 | 99视频播放| 黄色毛片网站在线观看 | 国产精品亚洲片夜色在线 | 久久伊人热 | 天天伊人网 | 97香蕉久久国产在线观看 | 国产短视频在线播放 | 欧美成人亚洲 | 欧美日韩午夜在线 | 超碰在线人人爱 | 国产一区播放 | 麻豆成人精品 | 黄色在线观看污 | 国产精品丝袜在线 | 在线不卡视频 | 国产高清精品在线 | 国产精品99久久久久久有的能看 | 亚洲精品网站在线 | 久久久久女人精品毛片九一 | 久久男女视频 | 久久夜色网 | 国产国产人免费人成免费视频 | 国产精品九色 | 久久综合导航 | 一级黄色片在线 | 五月天久久婷 | 亚洲精品久久久久中文字幕m男 | a色视频| 最新av网址在线观看 | 亚洲欧美激情插 | 成年人免费在线看 | 最新国产一区二区三区 | 美女免费视频观看网站 | 国产黄色视 | 在线成人小视频 | 综合网欧美 | 中文av字幕在线观看 | 人人舔人人 | 精品三级av | 亚洲精品国内 | 在线 视频 一区二区 | 天天干,天天射,天天操,天天摸 | 国产精品日韩久久久久 | 欧美老少交 | 最近日本中文字幕a | 成人av中文字幕 | 国产成人精品一区二区三区福利 | 不卡视频在线 | 国产成本人视频在线观看 | 黄色中文字幕在线 | 黄色成人av网址 | 在线亚洲高清视频 | 亚洲精品女人久久久 | 欧美日韩精品区 | 成人精品国产 | 911国产在线观看 | 国产精品一区二区在线 | 日韩欧美精品一区二区 | 99精品视频在线观看播放 | 国产精品久久久久久欧美 | 91亚洲国产成人 | 中文字幕色综合网 | 最近中文字幕免费大全 | 高清国产午夜精品久久久久久 | 91在线免费视频 | 日本一区二区免费在线观看 | 999视频网站| 婷婷综合av | 亚洲综合少妇 | 亚洲成人精品久久久 | 黄色成人在线观看 | 夜夜躁狠狠躁日日躁 | 狠狠干中文字幕 | 婷婷色av | 国产亚洲久一区二区 | 精品日韩在线一区 | 久久免费视频国产 | 午夜精品一区二区三区免费视频 | 99久久精品国 | 日韩视 | 国产少妇在线观看 | 日韩av一区二区三区在线观看 | 婷婷色网视频在线播放 | 亚洲日本va在线观看 | 99精品国产兔费观看久久99 | 激情五月婷婷综合网 | 成人在线免费视频 | 97精品国产91久久久久久久 | 国产福利在线免费 | 日本少妇高清做爰视频 | 国产乱视频 | 国产小视频91 | 在线视频欧美日韩 | 久久精彩免费视频 | 狠狠躁日日躁 | www.888av| 国产精品久久久久久吹潮天美传媒 | 亚洲理论片 | 亚洲爱爱视频 | 成人av电影在线观看 | 97网| 欧美精品一区在线发布 | 国产精品视频地址 | 日韩色中色 | ww亚洲ww亚在线观看 | 一区二区三区在线电影 | 最新国产视频 | 中文字幕av网站 | 久草在线播放视频 | 人人爽人人搞 | 视频在线观看入口黄最新永久免费国产 | 激情丁香在线 | 91黄站| 日韩精品欧美一区 | 天天插日日操 | 91麻豆精品久久久久久 | 国产美女视频免费 | 国产中文字幕在线免费观看 | 五月天婷婷免费视频 | 一区二区三区动漫 | 久久成人久久 | 国产日韩在线一区 | 日韩无在线 | 午夜久久成人 | 999久久久久久久久久久 | 福利视频 | 国产r级在线观看 | 亚洲一区美女视频在线观看免费 | 91精品国产99久久久久 | 日韩电影中文字幕在线观看 | 99riav1国产精品视频 | 国产欧美精品在线观看 | 国产精品18毛片一区二区 | 青青草在久久免费久久免费 | 亚洲午夜精 | 欧美日韩国产一区 | 国产激情久久久 | 国产亚洲欧美一区 | 在线99热| 色就是色综合 | 91精品国产麻豆国产自产影视 | 超碰在线最新地址 | 欧美在线观看视频一区二区三区 | 最近日本韩国中文字幕 | av福利在线看 | 国产手机在线播放 | 国产香蕉久久精品综合网 | 91视频高清| 欧美性生活免费 | 999视频精品 | 久久久久久久亚洲精品 | 成人久久精品视频 | 国产成人亚洲在线观看 | 99久久综合精品五月天 | 男女视频91| 亚洲色图 校园春色 | 91在线播放综合 | 成人在线观看资源 | 一区二区视频播放 | 在线观看国产日韩欧美 | 91精品国产乱码久久 | 91九色蝌蚪视频网站 | 久久久久久久av | 国产亚洲在线观看 | 国产色婷婷 | 人人爽人人爽人人爽学生一级 | 国产一区二区三区视频在线 | 国产精品一区二区三区在线播放 | 久久综合久久综合久久 | 午夜av在线播放 | 亚洲激情网站免费观看 | 毛片永久新网址首页 | 狠狠狠色丁香综合久久天下网 | 亚洲天堂网在线播放 | 久久精品国产精品亚洲 | 免费在线黄色av | 91精品国产一区二区三区 | 91精品天码美女少妇 | 精品二区久久 | 伊人视频 | 麻豆传媒在线视频 | 亚洲精品99久久久久中文字幕 | 国产网红在线观看 | 国产 日韩 欧美 在线 | 日本大片免费观看在线 | 日韩精品在线视频 | 欧美在线观看视频一区二区三区 | 国产精品手机视频 | 日韩av快播电影网 | 国产视频在线观看一区 | 国产精品第72页 | 五月天色综合 | 亚洲婷婷综合色高清在线 | 一区二区三区 亚洲 | 日本精品一区二区三区在线播放视频 | 婷婷丁香激情综合 | 久久久久电影 | 国产 亚洲 欧美 在线 | 久久婷婷一区二区三区 | 毛片激情永久免费 | 亚洲高清91 | 中文字幕在线视频一区 | 亚洲色图27p| 极品久久久 | 天天色天天色 | 国产99久久久国产精品免费二区 | 四虎www.| 天天干天天干天天干天天干天天干天天干 | 国内精品久久久精品电影院 | 国产一级大片在线观看 | 日韩精品一区二区在线视频 | 免费h在线观看 | 国产精品 美女 | 成人av在线播放网站 | 久久综合久久综合这里只有精品 | 久久高清片 | 九九精品久久久 | 亚洲精品456在线播放乱码 | 日日夜夜狠狠操 | 99久久99久久免费精品蜜臀 | 国产女人18毛片水真多18精品 | 久草av在线播放 | 九九久久成人 | 碰天天操天天 | 久久综合之合合综合久久 | 国产精品久久久久亚洲影视 | 最新中文字幕视频 | 亚洲国产精品成人综合 | 国产精品久久久久久久久毛片 | 国产亚洲va综合人人澡精品 | 国产 在线 日韩 | 在线观看国产日韩欧美 | www.色爱| 日韩精品视频一二三 | 国产亚洲午夜高清国产拍精品 | 久久久午夜精品理论片中文字幕 | 亚洲h在线播放在线观看h | 国产午夜精品一区二区三区嫩草 | 国产在线观看二区 | 美女国产在线 | 正在播放日韩 | 日韩欧美精品免费 | 在线a亚洲视频播放在线观看 | 国产精品私人影院 | 国产精品成人久久久久 | 免费在线观看成人av | 国产高清视频免费观看 | www.亚洲黄色| 人人爽人人爽人人爽 | 欧美 亚洲 另类 激情 另类 | 久久婷婷色综合 | 国内少妇自拍视频一区 | 久久综合色影院 | 久久av网 | 国产在线最新 | 久久久久久麻豆 | 国产成人一区二区三区久久精品 | 992tv在线成人免费观看 | 久久九九久久 | 欧美福利视频一区 | 五月婷婷丁香网 | 成人97视频一区二区 | 久草青青在线观看 | 国产精品欧美久久久久无广告 | 天天久久综合 | 久久久久久久久亚洲精品 | 久久综合电影 | 888av| 狠狠躁夜夜a产精品视频 | 亚洲国产视频网站 | 国产亚洲视频中文字幕视频 | 六月婷操| 午夜精品福利一区二区三区蜜桃 | 欧美最新另类人妖 | 亚洲激情久久 | 欧美特一级片 | 日韩免费电影一区二区三区 | 天天夜夜狠狠操 | 国产精品美女久久久久久久久久久 | 欧美日韩成人一区 | 日韩精品一区二区三区中文字幕 | 国产精品白浆视频 | 久久五月婷婷丁香社区 | 狠狠网亚洲精品 | 日韩精品中文字幕在线不卡尤物 | 日韩久久精品一区二区三区 | 日韩av电影中文字幕在线观看 | 国产精品久久久久久久久久久久午夜 | 男女免费视频观看 | 日韩欧美一区二区三区在线 | 在线免费视频你懂的 | 国产福利网站 | 亚洲黄色在线免费观看 | 日本夜夜草视频网站 | 亚洲国产中文在线观看 | 福利网在线 | 九九视频一区 | 国产激情小视频在线观看 | 三级a毛片 | 精品二区久久 | 欧美做受xxx | 九九免费在线看完整版 | 国产婷婷一区二区 | 综合久久久久 | 欧美一区二区伦理片 | 一级精品视频在线观看宜春院 | 国产高清一级 | 亚洲色图美腿丝袜 | 丁香六月国产 | 国产精品久久久久久久毛片 | 92精品国产成人观看免费 | 欧美激情综合色 | 久久精品3 | 国产一区高清在线观看 | 91chinese在线| 91精品国产高清自在线观看 | 亚洲精品成人av在线 | 日韩欧美在线视频一区二区 | 久久激情视频免费观看 | 久99久在线 | 国产91精品一区二区麻豆网站 | av网址在线播放 | 东方av在线免费观看 | 久热久草在线 | 欧美精品九九99久久 | 在线中文字幕电影 | 久草在线视频资源 | 91人人爽久久涩噜噜噜 | 96亚洲精品久久 | 最新精品视频在线 | 国产高清一区二区 | 九九免费在线看完整版 | 亚洲成 人精品 | 天天操偷偷干 | 天天干 夜夜操 | 亚洲精品一区二区三区四区高清 | av不卡免费看 | 国产视频999| 99夜色| av片免费播放 | 久草视频中文在线 | 天天av在线播放 | 美女黄频在线观看 | 国产精品大全 | 婷婷日 | 亚洲成人精品久久久 | 亚洲更新最快 | 精品字幕在线 | 久久久精品国产一区二区三区 | 欧美日韩国产精品一区二区亚洲 | 黄色www | 成人国产精品久久久 | 欧美久久久久久久 | 日韩免费专区 | 亚洲精品456在线播放 | 欧美久久久久久久久久久久久 | 久久九九精品久久 | 精品久久久久久久久久岛国gif | www最近高清中文国语在线观看 | 精品视频国产一区 | 91av中文字幕| 天天射天天添 | 亚洲欧洲精品一区 | 婷婷网站天天婷婷网站 | 91麻豆精品国产自产 | av丁香| 四虎www. | 成人黄色电影视频 | 国产99免费 | 欧美性猛片| 一区二区三区在线影院 | 免费高清在线观看电视网站 | 视频福利在线观看 | 日韩欧美一区二区三区视频 | 久操视频在线免费看 | 色多视频在线观看 | 免费久久精品视频 | 亚洲国产视频a | 亚洲黄色在线免费观看 | 日韩在线 | 久久久久久久久久免费 | 久久99精品国产 | 亚洲精品自拍视频在线观看 | 国产精品毛片网 | 97视频在线免费播放 | 九九免费精品视频 | 亚洲婷婷伊人 | 中文字幕人成不卡一区 | 国产麻豆精品一区二区 | 久久草在线精品 | www.久久免费 | 射久久 | 久久污视频| 久久国色夜色精品国产 | 欧美粗又大 | 国产日韩精品视频 | 天天躁日日躁狠狠躁av中文 | 欧美日韩视频观看 | 久久国产一区二区 | 亚洲精品视频免费 | 国产在线观看 | 国产一级免费在线观看 | 精品久久国产精品 | 正在播放国产一区二区 | 色在线亚洲 | 久久久久久久久久久久久影院 | 91理论片午午伦夜理片久久 | 99热这里是精品 | 国产97色在线 | 免费成人在线视频网站 | 福利视频导航网址 | 国产一线天在线观看 | 在线电影av | 久久视屏网 | 激情五月播播久久久精品 | 日韩理论视频 | 中国精品少妇 | 久久久久电影网站 | 色婷婷伊人 | 免费日韩av片 | 中文字幕91 | 婷婷免费在线视频 | 成人xxxx | 在线免费黄网站 | 夜夜操天天 | 国产一线二线三线性视频 | 国产视频精品免费 | 人人超在线公开视频 | 婷婷综合网 | 国产做aⅴ在线视频播放 | 亚洲天天干 | 色妞色视频一区二区三区四区 | 国产精品久久久久久久毛片 | 91精品在线观看视频 | 国产成人黄色 | 91麻豆精品国产91久久久久久久久 | 日韩免费在线观看视频 | 国产小视频福利在线 | 成 人 黄 色 视频 免费观看 | 九九免费在线观看 | 成人18视频 | 久久国产一区二区三区 | 日韩区欠美精品av视频 | 中文字幕日韩在线播放 | 亚洲成人黄色在线观看 | 欧美韩日精品 | 99精品国产一区二区三区不卡 | 久久久噜噜噜久久久 | 77国产精品| 三级免费黄色 | 亚洲成人av电影在线 | 午夜一级免费电影 | 日日爽| 国产视频一区二区在线播放 | 久久久综合精品 | 欧美日韩在线视频一区二区 | 国产一区二区在线视频观看 | 午夜影视av| 97超碰在 | 精品久久片 | 在线韩国电影免费观影完整版 | 特级西西444www高清大视频 | 久久久久电影 | 91亚洲精品乱码久久久久久蜜桃 | 91久久一区二区 | 高清av网站| 久久免费国产电影 | 精品视频成人 | 天天干,天天干 | 久久免费视频这里只有精品 | 国产成人av综合色 | 在线观看香蕉视频 | 麻豆视传媒官网免费观看 | 一区二区三区在线看 | 久久视讯 | 美女视频a美女大全免费下载蜜臀 | 免费在线播放av电影 | 精品专区一区二区 | 欧美巨乳波霸 | 夜夜夜草 | 青草视频在线看 | 成人免费视频a | 中文字幕二区 | 免费男女羞羞的视频网站中文字幕 | 亚洲精品久久久久久久蜜桃 | 中文字幕欧美三区 | 爱爱av网站 | 成人午夜电影在线观看 | 国产精品一区二区在线 | 欧美9999 | 久久久网页 | 91精品国产欧美一区二区 | 天天摸天天弄 | 中文字幕无吗 | 久久人人爽人人爽人人片 | 超碰在线天天 | 中文字幕在线一区二区三区 | 亚洲爽爽网 | 99综合久久 | 视频一区二区在线观看 | 欧美在线观看视频一区二区三区 | 欧美国产日韩在线视频 | 99精品国产在热久久 | japanesefreesex中国少妇 | 在线免费观看欧美日韩 | 久久视频免费 | 久久综合久久久 | 人人澡人人爽欧一区 | 亚洲欧美视频一区二区三区 | 色91av | 69精品| 国产在线国产 | 亚洲综合视频网 | 国产精品免费麻豆入口 | 国产一区二区三区免费在线观看 | 三级av在线 | 狠狠干免费 | 最近中文字幕免费 | 久久国产视频网站 | 九九视频免费观看视频精品 | 一本一本久久a久久精品牛牛影视 | 日本黄色免费看 | 99视频在线观看一区三区 | 最近中文字幕高清字幕免费mv | 中文字幕在线观看的网站 | 久久国产欧美日韩 | 亚洲精品女人久久久 | 日韩中文字幕国产精品 | 97超碰精品| 婷婷午夜 | 偷拍区另类综合在线 | 日韩美视频| 成人免费观看电影 | 日韩中文字幕免费视频 | 久视频在线 | 激情丁香久久 | a资源在线 | 色播99| 国产精品一二三 | 日韩三级一区 | 亚洲精品乱码久久久久久蜜桃不爽 | 精品麻豆| 久久夜色网 | 欧美日韩中文字幕综合视频 | 久久免费视频国产 | 亚洲年轻女教师毛茸茸 | 狠狠躁夜夜躁人人爽超碰97香蕉 | 亚洲国产精品电影 | 国产区精品视频 | 国产麻豆视频网站 | 久久精品之 | 日韩在线电影 | 天天干夜夜爽 | 中文字幕日韩伦理 | 国产丝袜高跟 | 91麻豆网 | 亚洲黄色免费电影 | 日韩在线免费小视频 | 激情大尺度视频 | 夜夜躁日日躁狠狠躁 | 97成人超碰| 色综合五月天 | 日韩黄视频 | 91中文字幕视频 | 亚洲精品国产精品国自产观看 | 天干啦夜天干天干在线线 | 国产精品一区二区白浆 | 国产在线国偷精品产拍 | av短片在线| 狠狠狠色丁香婷婷综合激情 | 欧美激情视频一二区 | 成人在线播放免费观看 | 超碰97免费在线 | 国产在线观看免费av | 在线久久| 国产精品久久伊人 | 亚洲视频电影在线 | 国产高清无线码2021 | 久久精品精品电影网 | 国产亚洲精品v | 亚洲成人资源 | 国产一区二区精品在线 | avv天堂| 国产精品一区二区中文字幕 | 久草视频在线播放 | 97人人艹 | 国产精品久久久久久久电影 | 国产成人黄色片 | 国产黄色精品在线 | 欧洲亚洲精品 | 天天综合网 天天综合色 | 亚洲综合国产精品 | 久久综合成人 | 亚洲九九九在线观看 | 久久综合成人网 | 欧美色黄| 97超碰人人在线 | 夜色资源网 | 久久视频精品在线观看 | 国产尤物一区二区三区 | 亚洲欧美日韩在线一区二区 | 欧美久久久久久久久久久久 | 久久精品直播 | 99视频在线精品国自产拍免费观看 | 国产在线观看免费观看 | 欧美a影视 | 亚洲精品视频在线免费播放 | 国产精品永久免费在线 | 黄色片亚洲 | av再线观看| 日日夜夜草 | 国产精品国产亚洲精品看不卡15 | 黄a在线看 | 国产精品久久久久久久久搜平片 | 超碰97在线资源 | 成人一区二区在线观看 | 亚洲视频电影在线 | 黄色一级网 | 色婷婷综合在线 | 国产原创在线视频 | 国产亚洲精品久久网站 | 亚洲成年片 | 综合久久婷婷 | av中文字幕在线播放 | 久久久久久久久网站 | 综合中文字幕 | 69绿帽绿奴3pvideos | 天堂中文在线视频 | 97视频中文字幕 | 在线v片免费观看视频 | 国产日韩精品一区二区三区 | 天天综合色天天综合 | 久热色超碰| 国产一区二区成人 | 超碰av在线 | 91在线免费播放视频 | 99视频在线精品免费观看2 | 91中文字幕网| 国产在线日韩 | 国产最新91 | 综合网天天射 | 国产精品久久久久久久久久久久午夜片 | 97综合视频 | 日韩精品一区二区三区在线播放 | 99热99| 国产精品免费不卡 | 国产精品一区免费在线观看 | 日韩电影在线观看中文字幕 | 欧美福利网站 | 18国产精品白浆在线观看免费 | 国产91精品在线播放 | 国产精品久久久久久久久久久久久 | 国产精品欧美久久久久无广告 | 欧美黄污视频 | 成年人国产精品 | 黄色av观看| 色干综合| 久久草草热国产精品直播 | 国产精品亚洲人在线观看 | 婷婷深爱五月 | 最新国产福利 | 91久久精品一区二区二区 | 丁香六月伊人 | 亚洲伊人婷婷 | 欧洲不卡av | 奇米影视8888在线观看大全免费 | 亚洲激情一区二区三区 | 99免费精品视频 | 91免费看片黄 | 九七视频在线 | 国产精品成人久久久 | 成人va天堂 | 午夜美女视频 | 国产成人精品久久久久蜜臀 | av在线免费不卡 | 色婷婷播放 | 狠狠插天天干 | 成 人 a v天堂 | 亚洲欧洲国产精品 | 97在线视| 人人艹人人 | 久久国产一区二区 | 91大神免费在线观看 | 免费高清看电视网站 | 中文字幕一区二区在线观看 | 激情久久综合 | 日本免费一二三区 | 久久中文字幕视频 | 97在线视频网站 | 99久久精品午夜一区二区小说 | 三上悠亚一区二区在线观看 | 黄色成人毛片 | 国产高清视频在线免费观看 | av亚洲产国偷v产偷v自拍小说 | 探花视频在线观看+在线播放 | 人人澡人摸人人添学生av | 国产91电影在线观看 | av高清在线观看 | 亚洲理论在线观看 | 亚洲午夜精品一区 | 免费视频91蜜桃 | 日日操天天射 | 91丨精品丨蝌蚪丨白丝jk | 天堂av中文字幕 | 国产在线不卡视频 | 91香蕉视频 | 91尤物在线播放 | 国产精品一区免费看8c0m | 99精品视频免费全部在线 | 国内偷拍精品视频 | 中文字幕乱码电影 | 成人免费视频网址 | 国产一区二区精 | 国产视频精品久久 | 天天综合导航 | 麻豆国产精品va在线观看不卡 | 久久一区二区三区超碰国产精品 | 久久天天躁夜夜躁狠狠85麻豆 | 在线观看小视频 | 91精品一区二区三区蜜桃 | 亚洲手机天堂 | 久久极品 | 精品99久久久久久 | 国产精品一区在线观看 | 深夜视频久久 | 91 在线视频 | 麻豆果冻剧传媒在线播放 | 免费a网| 亚洲精品九九 | 狠狠狠色丁香婷婷综合激情 | 5月丁香婷婷综合 | 天天躁天天狠天天透 | 久久精美视频 | 国产 日韩 在线 亚洲 字幕 中文 | 日韩欧美精品一区二区三区经典 | www.五月婷婷.com | 黄色av观看 | 美女福利视频一区二区 | 中文字幕高清免费日韩视频在线 | 免费高清国产 | 国产成人精品久久久 | 国产这里只有精品 | 久久精品看片 | 麻豆视频国产在线观看 | www.天天综合 | 中文在线免费观看 | 久久精品久久久精品美女 | 免费在线观看不卡av | 激情久久久久久久久久久久久久久久 | 91精品久久香蕉国产线看观看 | 麻豆久久久久久久 | 欧美精品一区二区在线观看 | 久久精品国产成人 | av高清免费| 夜夜天天干 | 在线视频你懂得 | 伊人中文在线 | 精品视频免费播放 | 国产九九热视频 | 欧美性久久久久久 | 国产精品丝袜在线 | 超黄视频网站 | 丝袜美腿在线视频 | 久久五月婷婷综合 | 国产在线黄色 | 国产精品国产三级国产aⅴ无密码 | 久久国产精品久久国产精品 | 欧美一级免费片 | 丁香久久久 | 久久亚洲成人网 | 婷婷丁香七月 | 国产视频资源 | 日韩欧美精品一区二区 | 97精品国自产拍在线观看 | 国产精品久久久av久久久 | 免费一级片视频 | 亚洲一区二区精品3399 | 中文一二区 | 成人av网站在线观看 | 亚洲精品日韩一区二区电影 | 国产精品6999成人免费视频 | 久久黄色免费 | 国产精品亚洲综合久久 | 日精品 | 久久综合桃花 | 五月婷婷久久综合 | 欧美成人亚洲 | 久久久99精品免费观看乱色 | 久久高清视频免费 | 麻豆视频入口 | 99精品视频在线免费观看 | 亚洲成人精品av | 久久久影院一区二区三区 | 久久99爱视频 | 国产日韩精品欧美 | 色的网站在线观看 | 日韩精品视频免费在线观看 | 国产精品18久久久久久不卡孕妇 | 久久久久久久久久久久久影院 | 久草视频中文 | 在线观看视频免费大全 | 亚洲天堂网在线观看视频 | 日本美女xx | 91九色在线 | 又色又爽又激情的59视频 | 激情五月亚洲 | 国产一区二区在线影院 | 操操操av | av.com在线 | 日韩最新在线 | 亚洲欧洲久久久 | 在线观看日韩免费视频 | 久久精品96| 啪嗒啪嗒免费观看完整版 | 日韩在线播放视频 | 天天综合网在线观看 | 久久九九精品 | 久久久久免费 | 久久精品一区二区三区四区 | www.亚洲黄色 | 九九精品在线观看 | 亚洲爱爱视频 | 人人艹人人 | 久久精彩免费视频 | 蜜桃视频日本 | www免费视频com━ | 国产999| 久久久久 免费视频 | 亚洲国产中文字幕在线 | 国产成人一区二区在线观看 | 日韩av成人在线观看 | 成人午夜在线电影 | 亚洲综合色视频 | 中文字幕成人在线观看 | 九九av| 欧美激情视频一区 | 久草视频看看 | 成人av片免费观看app下载 | 人人干97 | 天堂av在线网站 | 国产又黄又爽无遮挡 | 日韩超碰在线 | 久久久91精品国产一区二区精品 | 国内久久视频 | 欧美成人在线网站 | 在线免费高清视频 | 超碰公开97 | 久久久久久综合网天天 | 婷婷色站 | 国产色视频| 国内外成人免费在线视频 | 中文字幕在线视频第一页 | 亚洲第一中文网 | 国产又黄又猛又粗 | 久久成人久久 | 亚洲精品福利在线观看 | 国产一区av在线 | 国产色女人 | 亚洲国产成人av网 | 综合久久久久久久 | 中文字幕在线视频第一页 | 婷婷香蕉 | 18网站在线观看 | 超碰人人91 | 四虎视频| 日韩电影一区二区在线 | 欧美一级黄色网 | 国产精品毛片一区二区在线看 | 91高清完整版在线观看 | 国产亚洲成av人片在线观看桃 | 人人爽人人爽人人爽人人爽 | 香蕉在线观看 | 91夫妻自拍 | 久久久精品高清 | 日韩免费在线 | 丰满少妇麻豆av | 中文字幕在线日本 | 午夜精品久久久久久久99无限制 | 97看片吧| 一区 在线 影院 | 亚洲成人动漫在线观看 | 欧美日韩高清在线一区 | 在线观看91视频 | 九九av| 亚洲天堂香蕉 | 国产精品热视频 | 亚洲国产中文字幕 | 911免费视频 | 日韩免费视频一区二区 | 国产精品99爱 | 91精品小视频 | 亚洲人成人在线 | 国产午夜精品视频 | 久久久在线视频 | 91色国产在线 | 这里只有精彩视频 | 日韩精品久久久久久 | 天天摸天天干天天操天天射 | 久久99精品久久久久久秒播蜜臀 | 久久精品这里精品 | 日韩电影一区二区在线观看 | 色综合久久综合中文综合网 | 色视频国产直接看 | 91麻豆精品一区二区三区 | 欧美极品少妇xxxxⅹ欧美极品少妇xxxx亚洲精品 | 97av色| 国产网红在线观看 | 日韩成人看片 | 色视频网站在线观看一=区 a视频免费在线观看 | 中文字幕在线观看完整版电影 | 久久免费电影网 | 欧美精品亚州精品 | 福利视频区 | 91女人18片女毛片60分钟 | 色综合天天色 | 免费观看黄 | 国产在线一区二区三区播放 | 亚洲国产网站 | 狠狠狠操 | 射射色 | 色婷婷精品大在线视频 | 国产精品麻豆三级一区视频 | 一级特黄av | 国产欧美日韩精品一区二区免费 | 国产高清av | 中文字幕永久免费 | 美女av免费 | 99热在 | 手机看片1042| 成人在线观看免费视频 | 久久精品这里热有精品 | 亚洲色图 校园春色 | 久久久久色 | 99久久精品免费看国产一区二区三区 | 国内精品亚洲 | 国产精品麻豆果冻传媒在线播放 | 亚洲精区二区三区四区麻豆 | 久久情网| 黄色一级在线观看 | 久草网视频在线观看 | 亚洲精品合集 | 久草在线视频国产 | 黄色av免费电影 | 午夜免费电影院 | 一区二区三区四区精品视频 | 开心婷婷色 | 久久久久久久99 | 久久人操 | 国产成人在线综合 | 97夜夜澡人人双人人人喊 | 国产永久免费高清在线观看视频 | 亚洲精品网址在线观看 | 九色在线| 免费网站在线观看成人 | www.狠狠操.com | 中文字幕国产一区二区 | 精品久久久免费视频 | 在线观看黄色免费视频 | 一二三精品视频 | 精品一区二区日韩 | 久久久www成人免费毛片麻豆 | 91丨九色丨蝌蚪丰满 | 久久人人爽人人人人片 | 欧美成人a在线 | 国产一二三四在线观看视频 | 黄色免费大全 | 亚洲精品在线观看免费 | 四虎影院在线观看av | 99久久99久久精品 |