| 1 | /* |
| 2 | * Copyright (C) 1999 Ross Combs ([email protected]) |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; either version 2 |
| 7 | * of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 17 | */ |
| 18 | #include "common/setup_before.h"cxx . . $ `<file>/src/common/setup_before.h`/ |
| 19 | #include "common/bnethashconv.h"cxx . . $ `<file>/src/common/bnethashconv.h`/ |
| 20 | |
| 21 | #include "common/bnethash.h"cxx . . $ `<file>/src/common/bnethash.h`/ |
| 22 | #include "common/bn_type.h"cxx . . $ `<file>/src/common/bn_type.h`/ |
| 23 | #include "common/eventlog.h"cxx . . $ `<file>/src/common/eventlog.h`/ |
| 24 | #include "common/setup_after.h"cxx . . $ `<file>/src/common/setup_after.h`/ |
| 25 | |
| 26 | namespace pvpgncxx . . $ pvpgn/ |
| 27 | { |
| 28 | |
| 29 | extern void bnhash_to_hashcxx . . $ pvpgn/bnhash_to_hash(8ced6dd31669b167).(bn_intcxx . . $ pvpgn/bn_int# const * bnhash, t_hash * hash) |
| 30 | { |
| 31 | unsigned int i; |
| 32 | |
| 33 | if (!bnhash) |
| 34 | { |
| 35 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL bnhash"); |
| 36 | return; |
| 37 | } |
| 38 | if (!hash) |
| 39 | { |
| 40 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL hash"); |
| 41 | return; |
| 42 | } |
| 43 | |
| 44 | for (i = 0; i < 5; i++) |
| 45 | (*hash)[i] = bn_int_getcxx . . $ pvpgn/bn_int_get(ca1608e2c87725e2).(bnhash[i]); |
| 46 | } |
| 47 | |
| 48 | |
| 49 | extern void hash_to_bnhashcxx . . $ pvpgn/hash_to_bnhash(50eab12f45c1086c).(t_hash const * hash, bn_intcxx . . $ pvpgn/bn_int# * bnhash) |
| 50 | { |
| 51 | unsigned int i; |
| 52 | |
| 53 | if (!bnhash) |
| 54 | { |
| 55 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL bnhash"); |
| 56 | return; |
| 57 | } |
| 58 | if (!hash) |
| 59 | { |
| 60 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL hash"); |
| 61 | return; |
| 62 | } |
| 63 | |
| 64 | for (i = 0; i < 5; i++) |
| 65 | bn_int_setcxx . . $ pvpgn/bn_int_set(e97e500db3ec3c79).(&bnhash[i], (*hash)[i]); |
| 66 | } |
| 67 | |
| 68 | } |