1 | /* |
---|
2 | |
---|
3 | mpaux.h |
---|
4 | |
---|
5 | Author: Tatu Ylonen <ylo@cs.hut.fi> |
---|
6 | |
---|
7 | Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
---|
8 | All rights reserved |
---|
9 | |
---|
10 | Created: Sun Jul 16 04:29:30 1995 ylo |
---|
11 | |
---|
12 | This file contains various auxiliary functions related to multiple |
---|
13 | precision integers. |
---|
14 | |
---|
15 | */ |
---|
16 | |
---|
17 | /* |
---|
18 | * $Id: mpaux.h,v 1.1.1.2 1999-03-08 17:43:41 danw Exp $ |
---|
19 | * $Log: not supported by cvs2svn $ |
---|
20 | * Revision 1.1.1.1 1996/02/18 21:38:10 ylo |
---|
21 | * Imported ssh-1.2.13. |
---|
22 | * |
---|
23 | * Revision 1.1 1995/07/27 03:28:03 ylo |
---|
24 | * Auxiliary functions for manipulating mp-ints. |
---|
25 | * |
---|
26 | * $Endlog$ |
---|
27 | */ |
---|
28 | |
---|
29 | #ifndef MPAUX_H |
---|
30 | #define MPAUX_H |
---|
31 | |
---|
32 | /* Converts a multiple-precision integer into bytes to be stored in the buffer. |
---|
33 | The buffer will contain the value of the integer, msb first. */ |
---|
34 | void mp_linearize_msb_first(unsigned char *buf, unsigned int len, |
---|
35 | MP_INT *value); |
---|
36 | |
---|
37 | /* Extract a multiple-precision integer from buffer. The value is stored |
---|
38 | in the buffer msb first. */ |
---|
39 | void mp_unlinearize_msb_first(MP_INT *value, const unsigned char *buf, |
---|
40 | unsigned int len); |
---|
41 | |
---|
42 | /* Computes a 16-byte session id in the global variable session_id. |
---|
43 | The session id is computed by concatenating the linearized, msb |
---|
44 | first representations of host_key_n, session_key_n, and the cookie. */ |
---|
45 | void compute_session_id(unsigned char session_id[16], |
---|
46 | unsigned char cookie[8], |
---|
47 | unsigned int host_key_bits, |
---|
48 | MP_INT *host_key_n, |
---|
49 | unsigned int session_key_bits, |
---|
50 | MP_INT *session_key_n); |
---|
51 | |
---|
52 | #endif /* MPAUX_H */ |
---|