halap.c

来自「一个免费的SMART CARD OS系统。」· C语言 代码 · 共 80 行

C
80
字号
/* ============================================================================   Project Name : jayaCard   Module Name  : proto/hal/<template>/halap.c   Version : $Id: halap.c,v 1.7 2004/01/11 09:56:33 dgil Exp $	Description: Manage Attack protection setting(s)    The Original Code is jayaCard 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):    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.    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.  See the    GNU General Public License for more details.    You should have received a copy of the GNU General Public License    along with this program; see http://www.gnu.org/licenses/gpl.html   History Rev	Description   011903 dgil	wrote it from scratch   ============================================================================*/#include "precomp.h"#if defined(JAYA_ATTACK_PROTECTION)/* =========================================================================	__hal_enter_attackprotection()	Secure: use a local or a global semaphore to check the call has not been 	bypassed.	Secure: after attack protection set, check it (read register or do any	action to test the protection is working).   ========================================================================= */jbyte __hal_enter_attackprotection(jbyte ap){	if (ap==JSEC_OK) {		/* start attack protection */		ap++;		/* ToBeImplemented */		/* check attack protection is working */		ap++;		/* ToBeImplemented */		/* signal the semaphore the work has been done */		return ap;	}	HAL_HALT();	return JSEC_FAIL;}/* =========================================================================	__hal_leave_attackprotection()   ========================================================================= */void __hal_leave_attackprotection(void){	// ToBeImplemented}#endif/* =========================================================================	That's all folks !   ========================================================================= */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?