diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 2000-06-08 20:49:02 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 2000-06-08 20:49:02 +0000 |
commit | acfeca15ffc9b85fdebe0122167944ad324df52b (patch) | |
tree | 0a3dc5f547896ba59137d3d6ae2c1663c1a1d7ef /sbin/isakmpd | |
parent | 403acad51ad6f90694bd19b4a686c05cd51def05 (diff) |
Merge with EOM 1.6
author: ho
Attempt to get GMP usable here.
Diffstat (limited to 'sbin/isakmpd')
-rw-r--r-- | sbin/isakmpd/gmp_util.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sbin/isakmpd/gmp_util.c b/sbin/isakmpd/gmp_util.c index f12e90467a7..02800d81abb 100644 --- a/sbin/isakmpd/gmp_util.c +++ b/sbin/isakmpd/gmp_util.c @@ -1,5 +1,5 @@ -/* $OpenBSD: gmp_util.c,v 1.7 2000/04/07 22:10:30 niklas Exp $ */ -/* $EOM: gmp_util.c,v 1.5 2000/04/07 22:05:57 niklas Exp $ */ +/* $OpenBSD: gmp_util.c,v 1.8 2000/06/08 20:49:01 niklas Exp $ */ +/* $EOM: gmp_util.c,v 1.6 2000/05/08 13:42:43 ho Exp $ */ /* * Copyright (c) 1998 Niels Provos. All rights reserved. @@ -60,7 +60,11 @@ mpz_getraw (u_int8_t *raw, math_mp_t v, u_int32_t len) math_mp_t a; #if MP_FLAVOUR == MP_FLAVOUR_GMP -#error "XXX not implemented yet" + math_mp_t tmp; + + /* XXX mpz_get_str (raw, BASE, v); ? */ + mpz_init_set (a, v); + mpz_init (tmp); #elif MP_FLAVOUR == MP_FLAVOUR_OPENSSL /* XXX bn2bin? */ a = BN_dup (v); @@ -74,7 +78,8 @@ mpz_getraw (u_int8_t *raw, math_mp_t v, u_int32_t len) #endif #if MP_FLAVOUR == MP_FLAVOUR_GMP -#error "XXX not implemented yet" + mpz_clear (a); + mpz_clear (tmp); #elif MP_FLAVOUR == MP_FLAVOUR_OPENSSL BN_clear_free (a); #endif @@ -86,7 +91,8 @@ mpz_setraw (math_mp_t d, u_int8_t *s, u_int32_t l) u_int32_t i; #if MP_FLAVOUR == MP_FLAVOUR_GMP -#error "XXX not implemented yet" + /* XXX mpz_set_str (d, s, 0); */ + mpz_set_si (d, 0); #elif MP_FLAVOUR == MP_FLAVOUR_OPENSSL /* XXX bin2bn? */ BN_set_word (d, 0); |