Kévin Redon | 9a12d68 | 2018-07-08 13:21:16 +0200 | [diff] [blame] | 1 | /* ISO7816-3 Fi/Di tables + computation |
| 2 | * |
| 3 | * (C) 2010-2015 by Harald Welte <laforge@gnumonks.org> |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA |
| 18 | */ |
Harald Welte | 30a53f8 | 2015-11-08 14:29:55 +0100 | [diff] [blame] | 19 | #pragma once |
| 20 | |
| 21 | #include <stdint.h> |
| 22 | |
Kévin Redon | 7406337 | 2018-07-03 15:57:03 +0200 | [diff] [blame] | 23 | /* Table 7 of ISO 7816-3:2006 */ |
| 24 | extern const uint16_t fi_table[]; |
| 25 | |
| 26 | /* Table 8 from ISO 7816-3:2006 */ |
| 27 | extern const uint8_t di_table[]; |
| 28 | |
Harald Welte | 30a53f8 | 2015-11-08 14:29:55 +0100 | [diff] [blame] | 29 | /* compute the F/D ratio based on Fi and Di values */ |
| 30 | int compute_fidi_ratio(uint8_t fi, uint8_t di); |