Annotation of src/usr.bin/ssh/mpaux.h, Revision 1.1
1.1 ! deraadt 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: /* RCSID("$Id: mpaux.h,v 1.2 1999/05/04 11:58:52 bg Exp $"); */
! 18:
! 19: #ifndef MPAUX_H
! 20: #define MPAUX_H
! 21:
! 22: /* Converts a multiple-precision integer into bytes to be stored in the buffer.
! 23: The buffer will contain the value of the integer, msb first. */
! 24: void mp_linearize_msb_first(unsigned char *buf, unsigned int len,
! 25: MP_INT *value);
! 26:
! 27: /* Extract a multiple-precision integer from buffer. The value is stored
! 28: in the buffer msb first. */
! 29: void mp_unlinearize_msb_first(MP_INT *value, const unsigned char *buf,
! 30: unsigned int len);
! 31:
! 32: /* Computes a 16-byte session id in the global variable session_id.
! 33: The session id is computed by concatenating the linearized, msb
! 34: first representations of host_key_n, session_key_n, and the cookie. */
! 35: void compute_session_id(unsigned char session_id[16],
! 36: unsigned char cookie[8],
! 37: unsigned int host_key_bits,
! 38: MP_INT *host_key_n,
! 39: unsigned int session_key_bits,
! 40: MP_INT *session_key_n);
! 41:
! 42: #endif /* MPAUX_H */