?? msk.c
字號:
/* ============================================================================ Project Name : jayaCard TCK Module Name : proto/tck/common/msk.c Version : $Id: msk.c,v 1.6 2004/01/11 09:56:34 dgil Exp $ Description: Default MSK definition The Original Code is jayaCard TCK code. The Initial Developer of the Original Code is Gilles Dumortier. Portions created by the Initial Developer are Copyright (C) 2002-2004 the Initial Developer. All Rights Reserved. Contributor(s): Permission is granted to any individual to use, copy, or redistribute this software so long as all of the original files are included unmodified, that it is not sold for profit, and that this copyright notice is retained. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. History Rev Description 042203 dgil wrote it from scratch ============================================================================*/#include "precomp.h"/* ============================================================================ Default MSK ========================================================================= */jbyte MSK[18] ={ 0x00,0x00, /* CRC */ 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x70,0x60,0x50,0x40,0x30,0x20,0x10,0x55,0xAA};/* ============================================================================ read MSK ========================================================================= */void read_MSK(void){ FILE* f; jword n; /* read optional file */ f = fopen("msk.bin","rb"); if (f!=NULL) { /* only if file exist ! */ n = fread(&MSK[2],1,16,f); if (n!=16) { fprintf(stderr,"read_MSK(): can't read from the 'msk.bin' file !\n"); fclose(f); return; } fclose(f); LOG("TCK","Info: 'msk.bin' key file has been loaded in MSK[] !"); } HAL_CRC_INIT(); /* calculate the CRC */ for (n=0;n<16;n++) { HAL_CRC_COMPUTE(MSK[n+2]); } MSK[0] = HAL_CRC_LO(); MSK[1] = HAL_CRC_HI();}/* ========================================================================= That's all folks ! ========================================================================= */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -