kexc25519.c (261320) | kexc25519.c (263712) |
---|---|
1/* $OpenBSD: kexc25519.c,v 1.4 2014/01/12 08:13:13 djm Exp $ */ | 1/* $OpenBSD: kexc25519.c,v 1.5 2014/01/31 16:39:19 tedu Exp $ */ |
2/* 3 * Copyright (c) 2001, 2013 Markus Friedl. All rights reserved. 4 * Copyright (c) 2010 Damien Miller. All rights reserved. 5 * Copyright (c) 2013 Aris Adamantiadis. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: --- 55 unchanged lines hidden (view full) --- 65 u_char shared_key[CURVE25519_SIZE]; 66 67 crypto_scalarmult_curve25519(shared_key, key, pub); 68#ifdef DEBUG_KEXECDH 69 dump_digest("shared secret", shared_key, CURVE25519_SIZE); 70#endif 71 buffer_clear(out); 72 buffer_put_bignum2_from_string(out, shared_key, CURVE25519_SIZE); | 2/* 3 * Copyright (c) 2001, 2013 Markus Friedl. All rights reserved. 4 * Copyright (c) 2010 Damien Miller. All rights reserved. 5 * Copyright (c) 2013 Aris Adamantiadis. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: --- 55 unchanged lines hidden (view full) --- 65 u_char shared_key[CURVE25519_SIZE]; 66 67 crypto_scalarmult_curve25519(shared_key, key, pub); 68#ifdef DEBUG_KEXECDH 69 dump_digest("shared secret", shared_key, CURVE25519_SIZE); 70#endif 71 buffer_clear(out); 72 buffer_put_bignum2_from_string(out, shared_key, CURVE25519_SIZE); |
73 memset(shared_key, 0, CURVE25519_SIZE); /* XXX explicit_bzero() */ | 73 explicit_bzero(shared_key, CURVE25519_SIZE); |
74} 75 76void 77kex_c25519_hash( 78 int hash_alg, 79 char *client_version_string, 80 char *server_version_string, 81 char *ckexinit, int ckexinitlen, --- 41 unchanged lines hidden --- | 74} 75 76void 77kex_c25519_hash( 78 int hash_alg, 79 char *client_version_string, 80 char *server_version_string, 81 char *ckexinit, int ckexinitlen, --- 41 unchanged lines hidden --- |