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

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

?? test.c

?? 最新版本的加密解密算法庫
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* This is the worst code you have ever seen written on purpose.... this code is just a big hack to testout the functionality of the library */#ifdef SONY_PS2#include <eetypes.h>#include <eeregs.h>#include "timer.h"#endif#include <mycrypt.h>int     errnum;intnull_setup (const unsigned char *key, int keylen, int num_rounds,        symmetric_key * skey){  return CRYPT_OK;}voidnull_ecb_encrypt (const unsigned char *pt, unsigned char *ct,          symmetric_key * key){  memcpy (ct, pt, 8);}voidnull_ecb_decrypt (const unsigned char *ct, unsigned char *pt,          symmetric_key * key){  memcpy (pt, ct, 8);}intnull_test (void){  return CRYPT_OK;}intnull_keysize (int *desired_keysize){  return CRYPT_OK;}const struct _cipher_descriptor null_desc = {  "memcpy()",  255,  8, 8, 8, 1,  &null_setup,  &null_ecb_encrypt,  &null_ecb_decrypt,  &null_test,  &null_keysize};prng_state prng;voidstore_tests (void){  unsigned char buf[8];  unsigned long L;  ulong64 LL;  printf ("LOAD32/STORE32 tests\n");  L = 0x12345678UL;  STORE32L (L, &buf[0]);  L = 0;  LOAD32L (L, &buf[0]);  if (L != 0x12345678UL) {    printf ("LOAD/STORE32 Little don't work\n");    exit (-1);  }  LL = CONST64 (0x01020304050607);  STORE64L (LL, &buf[0]);  LL = 0;  LOAD64L (LL, &buf[0])    if (LL != CONST64 (0x01020304050607)) {    printf ("LOAD/STORE64 Little don't work\n");    exit (-1);  }  L = 0x12345678UL;  STORE32H (L, &buf[0]);  L = 0;  LOAD32H (L, &buf[0]);  if (L != 0x12345678UL) {    printf ("LOAD/STORE32 High don't work, %08lx\n", L);    exit (-1);  }  LL = CONST64 (0x01020304050607);  STORE64H (LL, &buf[0]);  LL = 0;  LOAD64H (LL, &buf[0])    if (LL != CONST64 (0x01020304050607)) {    printf ("LOAD/STORE64 High don't work\n");    exit (-1);  }}voidcipher_tests (void){  int     x;  printf ("Ciphers compiled in\n");  for (x = 0; cipher_descriptor[x].name != NULL; x++) {    printf      (" %12s (%2d) Key Size: %4d to %4d, Block Size: %3d, Default # of rounds: %2d\n",       cipher_descriptor[x].name, cipher_descriptor[x].ID,       cipher_descriptor[x].min_key_length * 8,       cipher_descriptor[x].max_key_length * 8,       cipher_descriptor[x].block_length * 8,       cipher_descriptor[x].default_rounds);  }}voidecb_tests (void){  int     x;  printf ("ECB tests\n");  for (x = 0; cipher_descriptor[x].name != NULL; x++) {    printf (" %12s: ", cipher_descriptor[x].name);    if ((errnum = cipher_descriptor[x].test ()) != CRYPT_OK) {      printf (" **failed** Reason: %s\n", error_to_string (errnum));      exit (-1);    } else {      printf ("passed\n");    }  }}#ifdef CBCvoidcbc_tests (void){  symmetric_CBC cbc;  int     x, y;  unsigned char blk[32], ct[32], key[32], IV[32];  const unsigned char test[] =    { 0XFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  printf ("CBC tests\n");  /* ---- CBC ENCODING ---- */  /* make up a block and IV */  for (x = 0; x < 32; x++)    blk[x] = IV[x] = x;  /* now lets start a cbc session */  if ((errnum =       cbc_start (find_cipher ("blowfish"), IV, key, 16, 0,          &cbc)) != CRYPT_OK) {    printf ("CBC Setup: %s\n", error_to_string (errnum));    exit (-1);  }  /* now lets encode 32 bytes */  for (x = 0; x < 4; x++) {    if ((errnum = cbc_encrypt (blk + 8 * x, ct + 8 * x, &cbc)) != CRYPT_OK) {      printf ("CBC encrypt: %s\n", error_to_string (errnum));      exit (-1);    }  }  zeromem (blk, sizeof (blk));  /* ---- CBC DECODING ---- */  /* make up a IV */  for (x = 0; x < 32; x++)    IV[x] = x;  /* now lets start a cbc session */  if ((errnum =       cbc_start (find_cipher ("blowfish"), IV, key, 16, 0,          &cbc)) != CRYPT_OK) {    printf ("CBC Setup: %s\n", error_to_string (errnum));    exit (-1);  }  /* now lets decode 32 bytes */  for (x = 0; x < 4; x++) {    if ((errnum = cbc_decrypt (ct + 8 * x, blk + 8 * x, &cbc)) != CRYPT_OK) {      printf ("CBC decrypt: %s\n", error_to_string (errnum));      exit (-1);    }  }  /* print output */  for (x = y = 0; x < 32; x++)    if (blk[x] != x)      y = 1;  printf ("  %s\n", y ? "failed" : "passed");  /* lets actually check the bytes */  memset (IV, 0, 8);  IV[0] = 0xFF;         /* IV  = FF 00 00 00 00 00 00 00 */  memset (blk, 0, 32);  blk[8] = 0xFF;        /* BLK = 00 00 00 00 00 00 00 00 FF 00 00 00 00 00 00 00 */  cbc_start (find_cipher ("memcpy()"), IV, key, 8, 0, &cbc);  cbc_encrypt (blk, ct, &cbc);  /* expect: FF 00 00 00 00 00 00 00 */  cbc_encrypt (blk + 8, ct + 8, &cbc);  /* expect: 00 00 00 00 00 00 00 00 */  if (memcmp (ct, test, 16)) {    printf ("CBC failed logical testing.\n");    for (x = 0; x < 16; x++)      printf ("%02x ", ct[x]);    printf ("\n");    exit (-1);  } else {    printf ("CBC passed logical testing.\n");  }}#elsevoidcbc_tests (void){  printf ("CBC not compiled in\n");}#endif#ifdef OFBvoidofb_tests (void){  symmetric_OFB ofb;  int     x, y;  unsigned char blk[32], ct[32], key[32], IV[32];  printf ("OFB tests\n");  /* ---- ofb ENCODING ---- */  /* make up a block and IV */  for (x = 0; x < 32; x++)    blk[x] = IV[x] = x;  /* now lets start a ofb session */  if ((errnum =       ofb_start (find_cipher ("cast5"), IV, key, 16, 0, &ofb)) != CRYPT_OK) {    printf ("OFB Setup: %s\n", error_to_string (errnum));    exit (-1);  }  /* now lets encode 32 bytes */  for (x = 0; x < 4; x++) {    if ((errnum = ofb_encrypt (blk + 8 * x, ct + 8 * x, 8, &ofb)) != CRYPT_OK) {      printf ("OFB encrypt: %s\n", error_to_string (errnum));      exit (-1);    }  }  zeromem (blk, sizeof (blk));  /* ---- ofb DECODING ---- */  /* make up a IV */  for (x = 0; x < 32; x++)    IV[x] = x;  /* now lets start a ofb session */  if ((errnum =       ofb_start (find_cipher ("cast5"), IV, key, 16, 0, &ofb)) != CRYPT_OK) {    printf ("OFB setup: %s\n", error_to_string (errnum));    exit (-1);  }  /* now lets decode 32 bytes */  for (x = 0; x < 4; x++) {    if ((errnum = ofb_decrypt (ct + 8 * x, blk + 8 * x, 8, &ofb)) != CRYPT_OK) {      printf ("OFB decrypt: %s\n", error_to_string (errnum));      exit (-1);    }  }  /* print output */  for (x = y = 0; x < 32; x++)    if (blk[x] != x)      y = 1;  printf ("  %s\n", y ? "failed" : "passed");  if (y)    exit (-1);}#elsevoidofb_tests (void){  printf ("OFB not compiled in\n");}#endif#ifdef CFBvoidcfb_tests (void){  symmetric_CFB cfb;  int     x, y;  unsigned char blk[32], ct[32], key[32], IV[32];  printf ("CFB tests\n");  /* ---- cfb ENCODING ---- */  /* make up a block and IV */  for (x = 0; x < 32; x++)    blk[x] = IV[x] = x;  /* now lets start a cfb session */  if ((errnum =       cfb_start (find_cipher ("blowfish"), IV, key, 16, 0,          &cfb)) != CRYPT_OK) {    printf ("CFB setup: %s\n", error_to_string (errnum));    exit (-1);  }  /* now lets encode 32 bytes */  for (x = 0; x < 4; x++) {    if ((errnum = cfb_encrypt (blk + 8 * x, ct + 8 * x, 8, &cfb)) != CRYPT_OK) {      printf ("CFB encrypt: %s\n", error_to_string (errnum));      exit (-1);    }  }  zeromem (blk, sizeof (blk));  /* ---- cfb DECODING ---- */  /* make up ahash_descriptor[prng->yarrow.hash].hashsize IV */  for (x = 0; x < 32; x++)    IV[x] = x;  /* now lets start a cfb session */  if ((errnum =       cfb_start (find_cipher ("blowfish"), IV, key, 16, 0,          &cfb)) != CRYPT_OK) {    printf ("CFB Setup: %s\n", error_to_string (errnum));    exit (-1);  }  /* now lets decode 32 bytes */  for (x = 0; x < 4; x++) {    if ((errnum = cfb_decrypt (ct + 8 * x, blk + 8 * x, 8, &cfb)) != CRYPT_OK) {      printf ("CFB decrypt: %s\n", error_to_string (errnum));      exit (-1);    }  }  /* print output */  for (x = y = 0; x < 32; x++)    if (blk[x] != x)      y = 1;  printf ("  %s\n", y ? "failed" : "passed");  if (y)    exit (-1);}#elsevoidcfb_tests (void){  printf ("CFB not compiled in\n");}#endif#ifdef CTRvoidctr_tests (void){  symmetric_CTR ctr;  int     x, y;  unsigned char blk[32], ct[32], key[32], count[32];  const unsigned char test[] =    { 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0 };  printf ("CTR tests\n");  /* ---- CTR ENCODING ---- */  /* make up a block and IV */  for (x = 0; x < 32; x++)    blk[x] = count[x] = x;  /* now lets start a ctr session */  if ((errnum =       ctr_start (find_cipher ("xtea"), count, key, 16, 0,          &ctr)) != CRYPT_OK) {    printf ("CTR Setup: %s\n", error_to_string (errnum));    exit (-1);  }  /* now lets encode 32 bytes */  for (x = 0; x < 4; x++) {    if ((errnum = ctr_encrypt (blk + 8 * x, ct + 8 * x, 8, &ctr)) != CRYPT_OK) {      printf ("CTR encrypt: %s\n", error_to_string (errnum));      exit (-1);    }  }  zeromem (blk, sizeof (blk));  /* ---- CTR DECODING ---- */  /* make up a IV */  for (x = 0; x < 32; x++)    count[x] = x;  /* now lets start a cbc session */  if ((errnum =       ctr_start (find_cipher ("xtea"), count, key, 16, 0,          &ctr)) != CRYPT_OK) {    printf ("CTR Setup: %s\n", error_to_string (errnum));    exit (-1);  }  /* now lets decode 32 bytes */  for (x = 0; x < 4; x++) {    if ((errnum = ctr_decrypt (ct + 8 * x, blk + 8 * x, 8, &ctr)) != CRYPT_OK) {      printf ("CTR decrypt: %s\n", error_to_string (errnum));      exit (-1);    }  }  /* print output */  for (x = y = 0; x < 32; x++)    if (blk[x] != x)      y = 1;  printf ("  %s\n", y ? "failed" : "passed");  if (y)    exit (-1);  /* lets actually check the bytes */  memset (count, 0, 8);  count[0] = 0xFF;      /* IV  = FF 00 00 00 00 00 00 00 */  memset (blk, 0, 32);  blk[9] = 2;           /* BLK = 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 */  ctr_start (find_cipher ("memcpy()"), count, key, 8, 0, &ctr);  ctr_encrypt (blk, ct, 8, &ctr);   /* expect: FF 00 00 00 00 00 00 00 */  ctr_encrypt (blk + 8, ct + 8, 8, &ctr);   /* expect: 00 03 00 00 00 00 00 00 */  if (memcmp (ct, test, 16)) {    printf ("CTR failed logical testing.\n");    for (x = 0; x < 16; x++)      printf ("%02x ", ct[x]);    printf ("\n");  } else {    printf ("CTR passed logical testing.\n");  }}#elsevoidctr_tests (void){  printf ("CTR not compiled in\n");}#endifvoidhash_tests (void){  int     x;  printf ("Hash tests\n");  for (x = 0; hash_descriptor[x].name != NULL; x++) {    printf (" %10s (%2d) ", hash_descriptor[x].name, hash_descriptor[x].ID);    if ((errnum = hash_descriptor[x].test ()) != CRYPT_OK) {      printf ("**failed** Reason: %s\n", error_to_string (errnum));      exit(-1);    } else {      printf ("passed\n");    }  }}#ifdef MRSAvoidpad_test (void){  unsigned char in[100], out[100];  unsigned long x, y;  /* make a dummy message */  for (x = 0; x < 16; x++)    in[x] = (unsigned char) x;  /* pad the message so that random filler is placed before and after it */  y = 100;  if ((errnum =       rsa_pad (in, 16, out, &y, find_prng ("yarrow"), &prng)) != CRYPT_OK) {    printf ("Error: %s\n", error_to_string (errnum));    exit (-1);  }  /* depad the message to get the original content */  memset (in, 0, sizeof (in));  x = 100;  if ((errnum = rsa_depad (out, y, in, &x)) != CRYPT_OK) {    printf ("Error: %s\n", error_to_string (errnum));    exit (-1);  }  /* check outcome */  printf ("rsa_pad: ");  if (x != 16) {    printf ("Failed.  Wrong size.\n");    exit (-1);  }  for (x = 0; x < 16; x++)    if (in[x] != x) {      printf ("Failed.  Expected %02lx and got %02x.\n", x, in[x]);      exit (-1);    }  printf ("passed.\n");}voidrsa_test (void){  unsigned char in[520], out[520];  unsigned long x, y, z, limit;  int     stat;  rsa_key key;  clock_t t;  /* ---- SINGLE ENCRYPT ---- */  /* encrypt a short 8 byte string */  if ((errnum =       rsa_make_key (&prng, find_prng ("yarrow"), 1024 / 8, 65537,             &key)) != CRYPT_OK) {    printf ("Error: %s\n", error_to_string (errnum));    exit (-1);  }  for (x = 0; x < 8; x++)    in[x] = (unsigned char) (x + 1);  y = sizeof (in);  if ((errnum = rsa_exptmod (in, 8, out, &y, PK_PUBLIC, &key)) != CRYPT_OK) {    printf ("Error: %s\n", error_to_string (errnum));    exit (-1);  }  /* decrypt it */  zeromem (in, sizeof (in));  x = sizeof (out);  if ((errnum = rsa_exptmod (out, y, in, &x, PK_PRIVATE, &key)) != CRYPT_OK) {    printf ("Error: %s\n", error_to_string (errnum));    exit (-1);  }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品中文字幕欧美| 97久久超碰国产精品| 成人永久看片免费视频天堂| 欧美日韩一本到| 亚洲国产激情av| 午夜精品久久久久影视| 成人午夜在线播放| 日韩欧美一卡二卡| 亚洲已满18点击进入久久| 国产精品18久久久久久久久久久久 | 婷婷久久综合九色综合绿巨人| 国产美女精品在线| 欧美一区日韩一区| 一区二区三区欧美日| av福利精品导航| 久久久天堂av| 国产一区二区三区香蕉| 日韩亚洲欧美中文三级| 亚洲国产精品久久久男人的天堂| 成人性生交大片免费看视频在线 | 久久精品噜噜噜成人av农村| 在线观看日韩精品| 亚洲免费在线播放| a在线播放不卡| 国产日产精品1区| 国产乱理伦片在线观看夜一区| 欧美一区二区三区喷汁尤物| 香蕉成人伊视频在线观看| 欧美午夜精品一区二区三区| 亚洲综合免费观看高清完整版 | 亚洲国产欧美在线| 91在线播放网址| 一区在线观看视频| av亚洲精华国产精华| 国产精品五月天| 成人激情图片网| 欧美高清在线一区| a亚洲天堂av| 一区二区三区中文字幕在线观看| 色伊人久久综合中文字幕| 亚洲人成小说网站色在线| 91在线视频观看| 亚洲综合一二三区| 欧美精品高清视频| 精品一区二区免费看| 精品国产免费视频| 成人免费av在线| 亚洲乱码国产乱码精品精的特点 | a级高清视频欧美日韩| 中文字幕日韩av资源站| 色吊一区二区三区| 婷婷成人激情在线网| 337p亚洲精品色噜噜噜| 国产老妇另类xxxxx| 中文字幕精品一区| 色久综合一二码| 蜜臀av一区二区在线观看| 久久久亚洲午夜电影| 91蜜桃传媒精品久久久一区二区| 亚洲福利电影网| 精品国产乱码久久久久久老虎| 国产999精品久久久久久| 成人欧美一区二区三区小说 | 国产性色一区二区| 91亚洲精品乱码久久久久久蜜桃| 亚洲国产精品嫩草影院| 欧美一区二区二区| 成人动漫在线一区| 亚洲成av人片www| 久久久久久久久久久久电影| 91性感美女视频| 蜜臀av性久久久久av蜜臀妖精| 中文字幕一区二区三区在线播放 | 国产精品网友自拍| 欧美日韩亚洲另类| 国产白丝精品91爽爽久久| 亚洲综合视频在线观看| 精品成人一区二区| 欧美三级电影在线观看| 成人综合婷婷国产精品久久免费| 日韩综合在线视频| 国产精品免费人成网站| 欧美一级在线视频| 91在线观看美女| 国产一区激情在线| 亚洲成av人片一区二区三区 | 一本大道久久a久久综合婷婷| 蜜桃在线一区二区三区| 有码一区二区三区| 久久精品欧美一区二区三区麻豆| 欧美日本国产一区| 9i在线看片成人免费| 国内一区二区在线| 亚洲电影你懂得| 一区二区三区在线观看欧美| 国产精品久久久久一区| 日韩欧美中文字幕精品| 精品视频一区二区三区免费| 成人久久久精品乱码一区二区三区| 久久精品国产免费看久久精品| 亚洲一区二区免费视频| 亚洲免费大片在线观看| 国产精品色一区二区三区| 久久综合色一综合色88| 日韩免费在线观看| 91麻豆精品91久久久久同性| 精品视频在线看| 色婷婷亚洲精品| 色噜噜狠狠一区二区三区果冻| 91污在线观看| 91女神在线视频| 99久久精品情趣| 成人精品高清在线| 国产91综合网| 不卡一区二区三区四区| 97久久精品人人爽人人爽蜜臀| eeuss影院一区二区三区| 91一区二区在线观看| 97精品久久久午夜一区二区三区| 91网站最新地址| 91在线国产观看| 91丨九色porny丨蝌蚪| 91美女片黄在线| 欧美午夜精品免费| 在线不卡免费欧美| 日韩三级在线观看| 26uuu亚洲综合色欧美| 久久精品亚洲精品国产欧美| 国产欧美一区二区精品仙草咪| 国产精品欧美一区喷水| 亚洲另类中文字| 五月天亚洲婷婷| 极品少妇xxxx精品少妇偷拍| 国产乱对白刺激视频不卡| jizzjizzjizz欧美| 欧美在线|欧美| 欧美一区中文字幕| 久久久久高清精品| 亚洲狠狠丁香婷婷综合久久久| 日欧美一区二区| 国产乱码精品一区二区三| jiyouzz国产精品久久| 欧美日韩高清一区| 欧美精品一区二区久久久| 国产精品天天看| 午夜亚洲国产au精品一区二区| 久久国产综合精品| bt7086福利一区国产| 91麻豆精品国产91久久久久| 欧美国产精品中文字幕| 性做久久久久久免费观看欧美| 久久精品国产网站| 日本高清视频一区二区| 欧美一级一区二区| 国产精品卡一卡二| 日韩av不卡在线观看| a在线播放不卡| 欧美tk—视频vk| 亚洲夂夂婷婷色拍ww47| 国产一区二区网址| 欧美日韩精品欧美日韩精品一综合| 久久久噜噜噜久噜久久综合| 亚洲成人你懂的| 成人免费观看视频| 精品精品欲导航| 亚洲最大成人网4388xx| 国产精品一区二区久久不卡 | 欧美高清一级片在线观看| 性做久久久久久| 99九九99九九九视频精品| 欧美一级日韩免费不卡| 亚洲视频香蕉人妖| 国产精品99久久久久久宅男| 91精品久久久久久蜜臀| 亚洲另类在线制服丝袜| 成人涩涩免费视频| 久久综合久久99| 美女视频黄a大片欧美| 欧美三级资源在线| 一区二区在线观看av| 成人免费三级在线| 久久亚洲综合色| 美女网站一区二区| 欧美日韩成人在线| 亚洲综合999| 日本伦理一区二区| 最新国产の精品合集bt伙计| 国产成人av网站| 久久久亚洲综合| 国产在线精品国自产拍免费| 日韩一区二区三区在线观看| 婷婷中文字幕一区三区| 在线精品视频一区二区三四| 亚洲精选一二三| 91免费版pro下载短视频| 国产精品久久久久久户外露出 | 亚洲最大色网站| 欧美影院一区二区| 亚洲在线视频一区| 欧美色图在线观看|