提交 5a61e580 authored 作者: Viktor Krikun's avatar Viktor Krikun 提交者: Travis Cross

Add libzrtp beta

上级 f61ed4a1
#
# Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved.
# Contact: http://philzimmermann.com
# For licensing and other legal details, see the file zrtp_legal.c.
#
# Viktor Krikun <v.krikun at zfoneproject.com>
libzrtp BETA
Created by Phil Zimmermann.
Developers:
Viktor Krikun
Nikolay Popok
Vitaly Rozhkov
Andrey Rozinko
Bryce Wilcox-O'Hearn
Thanks to:
Alan Johnston
Jon Callas
Hal Finney
Colin Plumb
Sagar Pai
Werner Dittmann
L. Amber Wilcox-O'Hearn
Ariel Boston
Donovan Preston
Software development services provided by Soft_industry http://www.soft-industry.com/en.
Portions of this software are available under open source licenses from other authors.
Notably, Brian Gladman's AES implementation, and David McGrew's libSRTP package.
差异被折叠。
#
# libZRTP SDK library, implements the ZRTP secure VoIP protocol.
# Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved.
# Contact: http://philzimmermann.com
# For licensing and other legal details, see the file zrtp_legal.c.
#
- Check HTML Documentation ./doc
- Visit the Zfone Project Home Page http://zfoneproject.com/
- Report bugs via the Zfone Bugs Page http://zfoneproject.com/bugs.html
差异被折叠。
BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
font-family: Geneva, Arial, Helvetica, sans-serif;
}
BODY,TD {
font-size: 100%;
}
CODE {
font-size: 120%;
font-family: monospace;
}
.fragment, pre {
font-size: 110%;
font-family: monospace;
}
H1 {
text-align: center;
font-size: 240%;
}
H2 {
font-size: 180%;
margin-top: 60px;
}
H3 {
font-size: 140%;
}
H4 {
font-size: 120%;
}
caption {
font-weight: bold;
}
div.qindex, div.navtab{
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
padding: 2px;
}
div.qindex, div.navpath {
width: 100%;
line-height: 140%;
}
div.navtab {
margin-right: 15px;
}
/* @group Link Styling */
a {
color: #153788;
font-weight: normal;
text-decoration: none;
}
.contents a:visited {
color: #1b77c5;
}
a:hover {
text-decoration: underline;
}
a.qindex {
font-weight: bold;
}
a.qindexHL {
font-weight: bold;
background-color: #6666cc;
color: #ffffff;
border: 1px double #9295C2;
}
.contents a.qindexHL:visited {
color: #ffffff;
}
a.el {
font-weight: bold;
}
a.elRef {
}
a.code {
}
a.codeRef {
}
/* @end */
dl.el {
margin-left: -1cm;
}
.fragment {
font-family: monospace, fixed;
font-size: 105%;
}
pre.fragment {
border: 1px solid #CCCCCC;
background-color: #f5f5f5;
padding: 4px 6px;
margin: 4px 8px 4px 2px;
}
div.ah {
background-color: black;
font-weight: bold;
color: #ffffff;
margin-bottom: 3px;
margin-top: 3px
}
div.groupHeader {
margin-left: 16px;
margin-top: 12px;
margin-bottom: 6px;
font-weight: bold;
}
div.groupText {
margin-left: 16px;
font-style: italic;
}
body {
background: white;
color: black;
margin-right: 20px;
margin-left: 20px;
}
td.indexkey {
background-color: #e8eef2;
font-weight: bold;
border: 1px solid #CCCCCC;
margin: 2px 0px 2px 0;
padding: 2px 10px;
}
td.indexvalue {
background-color: #e8eef2;
border: 1px solid #CCCCCC;
padding: 2px 10px;
margin: 2px 0px;
}
tr.memlist {
background-color: #f0f0f0;
}
p.formulaDsp {
text-align: center;
}
img.formulaDsp {
}
img.formulaInl {
vertical-align: middle;
}
/* @group Code Colorization */
span.keyword {
color: #008000
}
span.keywordtype {
color: #604020
}
span.keywordflow {
color: #e08000
}
span.comment {
color: #800000
}
span.preprocessor {
color: #806020
}
span.stringliteral {
color: #002080
}
span.charliteral {
color: #008080
}
span.vhdldigit {
color: #ff00ff
}
span.vhdlchar {
color: #000000
}
span.vhdlkeyword {
color: #700070
}
span.vhdllogic {
color: #ff0000
}
/* @end */
.search {
color: #003399;
font-weight: bold;
}
form.search {
margin-bottom: 0px;
margin-top: 0px;
}
input.search {
font-size: 75%;
color: #000080;
font-weight: normal;
background-color: #e8eef2;
}
td.tiny {
font-size: 75%;
}
.dirtab {
padding: 4px;
border-collapse: collapse;
border: 1px solid #84b0c7;
}
th.dirtab {
background: #e8eef2;
font-weight: bold;
}
hr {
height: 0;
border: none;
border-top: 1px solid #666;
}
/* @group Member Descriptions */
.mdescLeft, .mdescRight,
.memItemLeft, .memItemRight,
.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
background-color: #FAFAFA;
border: none;
margin: 4px;
padding: 1px 0 0 8px;
}
.mdescLeft, .mdescRight {
padding: 0px 8px 4px 8px;
color: #555;
}
.memItemLeft, .memItemRight, .memTemplParams {
border-top: 1px solid #ccc;
}
.memTemplParams {
color: #606060;
}
/* @end */
/* @group Member Details */
/* Styles for detailed member documentation */
.memtemplate {
font-size: 80%;
color: #606060;
font-weight: normal;
margin-left: 3px;
}
.memnav {
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
margin-right: 15px;
padding: 2px;
}
.memitem {
padding: 0;
}
.memname {
white-space: nowrap;
font-weight: bold;
}
.memproto, .memdoc {
border: 1px solid #84b0c7;
}
.memproto {
padding: 0;
background-color: #d5e1e8;
font-weight: bold;
-webkit-border-top-left-radius: 8px;
-webkit-border-top-right-radius: 8px;
-moz-border-radius-topleft: 8px;
-moz-border-radius-topright: 8px;
}
.memdoc {
padding: 2px 5px;
background-color: #eef3f5;
border-top-width: 0;
-webkit-border-bottom-left-radius: 8px;
-webkit-border-bottom-right-radius: 8px;
-moz-border-radius-bottomleft: 8px;
-moz-border-radius-bottomright: 8px;
}
.paramkey {
text-align: right;
}
.paramtype {
white-space: nowrap;
}
.paramname {
color: #602020;
white-space: nowrap;
}
.paramname em {
font-style: normal;
}
/* @end */
/* @group Directory (tree) */
/* for the tree view */
.ftvtree {
font-family: sans-serif;
margin: 0.5em;
}
/* these are for tree view when used as main index */
.directory {
font-size: 9pt;
font-weight: bold;
}
.directory h3 {
margin: 0px;
margin-top: 1em;
font-size: 11pt;
}
/*
The following two styles can be used to replace the root node title
with an image of your choice. Simply uncomment the next two styles,
specify the name of your image and be sure to set 'height' to the
proper pixel height of your image.
*/
/*
.directory h3.swap {
height: 61px;
background-repeat: no-repeat;
background-image: url("yourimage.gif");
}
.directory h3.swap span {
display: none;
}
*/
.directory > h3 {
margin-top: 0;
}
.directory p {
margin: 0px;
white-space: nowrap;
}
.directory div {
display: none;
margin: 0px;
}
.directory img {
vertical-align: -30%;
}
/* these are for tree view when not used as main index */
.directory-alt {
font-size: 100%;
font-weight: bold;
}
.directory-alt h3 {
margin: 0px;
margin-top: 1em;
font-size: 11pt;
}
.directory-alt > h3 {
margin-top: 0;
}
.directory-alt p {
margin: 0px;
white-space: nowrap;
}
.directory-alt div {
display: none;
margin: 0px;
}
.directory-alt img {
vertical-align: -30%;
}
/* @end */
address {
font-style: normal;
color: #333;
}
<hr size="1"><address style="text-align: right;"><small>
Generated on $datetime for $projectname &nbsp;<a href="http://www.zfoneproject.com"><img src="zfone.jpg" alt="zfone" align="middle" border="0"></a> </small></address>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>$title</title>
<link href="$relpath$tabs.css" rel="stylesheet" type="text/css">
<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css">
</head><body>
差异被折叠。
差异被折叠。
#
# Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved.
# Contact: http://philzimmermann.com
# For licensing and other legal details, see the file zrtp_legal.c.
#
# Viktor Krykun <v.krikun at zfoneproject.com>
/**
\mainpage ZRTP VoIP security
****************************************************************************************************
\section intro Intro
****************************************************************************************************
ZRTP Protocol finally goes RFC and we going to stabilize SDK as well. Libzrtp series 0.9X builds
will contain bug-fixes, performance and stability improvements only.
So, please, be a patient with new API changes. We hope you will find them useful.
****************************************************************************************************
\section aboutdoc About this Documentation
****************************************************************************************************
Libzrtp, since v0.80 includes new, documentation. We have updated "How to Get Up and Running Quickly with libZRTP" and Public API documentation.
We working on new "Libzrtp Developers Guide" which will give more detail information about ZRTP protocol and libzrtp architecture. This document will be available in next versions of libzrtp. But even now, libzrtp contains enough documentation to start using it comfortable.
\note
libzrtp private API may have outdated information from previous version (links like this: \ref XXX). We working hard on that part of the documentation and it will be published in next versions of libzrtp.
****************************************************************************************************
\section zrtp Libzrtp Documents
****************************************************************************************************
-# \ref changelog
-# \ref howto
-# \ref rng
*/
#
# Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved.
# Contact: http://philzimmermann.com
# For licensing and other legal details, see the file zrtp_legal.c.
#
# Viktor Krykun <v.krikun at zfoneproject.com>
/**
* \file rng.dox
* \brief Random Number Generation in libzrtp
*/
/**
\page rng Random Number Generation in libzrtp
\section rng Random number generation
The generation of cryptographic key material is a highly sensitive process. To do this, you need high entropy random numbers that an attacker cannot predict. This section discusses the random number generator used by libzrtp, and how suitable entropy can be collected on different hardware platforms.
Failure to use true entropy from the physical environment as a basis for generating random cryptographic key material would lead to a disastrous loss of security.
****************************************************************************************************
\subsection rng_algorithm Deterministic Random Bit Generator
****************************************************************************************************
<HR>
Libzrtp uses a cryptographically strong Deterministic Random Bit Generator (DRBG), based on running the AES-256 block cipher in counter mode. The output of this DRBG is used for key material by libzrtp for the Diffie-Hellman private keys, and other random protocol components such as nonces. The 256-bit AES key and 128-bit initialization vector for the DRBG are drawn from an entropy pool
created by a SHA-512 hash of raw entropy sources. These raw entropy sources are highly platform dependent and thus are not included in libzrtp. The library provides only a set of interfaces for adding the entropy to the entropy pool. We will discuss the entropy collection in the next section.
When a random number is required by the ZRTP protocol, the library kernel calls the Deterministic Random Bit Generator interface function zrtp_randstr(). That function requires the existance of an entropy pool that has already been seeded with sufficient entropy. This entropy pool must be seeded by calling zrtp_entropy_add().
The zrtp_entropy_add() function takes a buffer of raw unprocessed entropy provided by the caller and adds it to the entropy pool via the SHA-512 hash function.
****************************************************************************************************
\subsection rng_accumulation Entropy accumulation
****************************************************************************************************
<HR>
Random numbers for cryptographic key material must be derived from a physical entropy source, such as RF noise, acoustic noise, thermal noise, high resolution timings of environmental events, or other unpredictable physical sources of entropy. For a detailed explanation of cryptographic grade random numbers and guidance for collecting suitable entropy, see <A
HREF="http://tools.ietf.org/html/rfc4086">RFC 4086</A> and Chapter 10 of "Practical Cryptography" by Ferguson and Schneier. The raw entropy must be distilled and processed through a Deterministic Random Bit Generator (DRBG). We supply a suitable DRBG in libzrtp, which is accessed through the zrtp_randstr() function.
To add entropy to the entropy pool maintained by the libzrtp random number generator, the application calls the zrtp_entropy_add() function. This entropy accumulation function may be called whenever new entropy becomes available.
\warning
The entropy pool builds up more precious entropy each time you call zrtp_entropy_add(). Once in a while, it is a good idea to save the entropy in nonvolatile storage, by calling zrtp_randstr() and writing the output to a file, or to flash memory, or to some nonvolatile system storage area. This can be done whenever the VoIP application shuts down, or perhaps at the end of each secure VoIP call. A minimum of 512 bits (64 bytes) of output from zrtp_randstr() should be stored this way, but there is no need to store more than 256 bytes. When the VoIP application starts back up again, the contents of this nonvolatile entropy file should be added back into the active entropy pool by passing it to the zrtp_entropy_add() function.
****************************************************************************************************
\subsection rng_default Libzrtp built-in entropy sources
****************************************************************************************************
<HR>
The SDK library provides a default implementation of entropy accumulation for <b>Windows Kernel</b> and <b>Unix based</b> platforms.
For the Windows kernel mode it gathers current system state information as an entropy source. Among them are the performance counter, the current value of the system interrupt-time count, the count of the interval timer interrupts, and the values of some CPU registers.
For Unix platforms, libzrtp calls \c /dev/urandom.
If you are running libzrtp on a Windows Kernel or a full-blown desktop *nix-like system - you need not do anything more to implement the RNG. If you are using some other platform - carefully read the next section.
****************************************************************************************************
\subsection rng_guidelines Entropy sources for your platform.
****************************************************************************************************
<HR>
On a desktop or laptop PC running Linux, FreeBSD, NetBSD, or OpenBSD, a good source of entropy may be found by reading from \c /dev/random or \c /dev/urandom. This is because \c /dev/random is seeded by entropy from keyboard timings, mouse movements, disk latency measurements, or other physical noise sources, some of them involving unpredictable human interaction.
However, some low cost embedded Linux systems have no keyboard, no mouse or trackpad, no disk drive, and are starving for high quality entropy. There are some low cost Asterisk PBX boxes that are built this way. Or hardware Analog Telephone Adapters. Or low cost consumer routers. Many of them have no \c /dev/random implemented, or worse, have only a stub for /dev/random that does not actually collect any environmental entropy. This creates a dangerous illusion that entropy is available, because \c /dev/urandom appears to work, but is not backed by true entropy. This is bad, and not only for ZRTP. Platforms like these might not be able to generate strong cryptographic key material for SSH or SSL.
If you are an OEM that builds hardware like this, and you wish to implement the ZRTP protocol with our libzrtp SDK, you really should provide a properly implemented \c /dev/random and \c /dev/urandom, properly supplied with true environmental entropy. If you are building a telephone, you can easily collect entropy from raw audio samples from the microphone. If the phone includes a video camera, you can collect entropy by sampling a few raw uncompressed video frames. If it's a mobile phone or a cordless phone, you can collect entropy from the RF noise in your wireless circuitry. If it's an embedded box like a router or low cost PBX, you can do high resolution timings of packet arrivals and use the timer readings as entropy sources. A PBX might include an analog interface to PSTN phone lines, and those interfaces usually include registers that measure analog voltage levels, which can serve as a source of entropy. The entropy sources do not need to produce much entropy, just a few bits at a time, but it can build up slowly until you have accumulated a few hundred bits of entropy. That's enough to generate cryptographically useful keys. Even if it takes some seconds or even minutes to accumulate this much entropy the first time your product is activated, it can be stored in nonvolatile storage so that it will be ready to reseed the entropy pool instantly the next time your product is powered up.
In the ideal case, if you are designing the embedded hardware yourself, you could provide a good source of entropy by including a simple <A HREF="http://en.wikipedia.org/wiki/Ring_oscillator">ring oscillator</A> in the hardware. A ring oscillator is a circular chain (a ring) of NOT gates, and has nothing whatsoever to do with a telephone ring generator. The oscillation frequency drifts from thermal noise, and sampling the output at some low sampling rate is a good way to get some entropy. However, most designers have to work with existing hardware designs, and don't have the luxury of adding special hardware to generate entropy, which means you have to improvise with whatever you can collect from the environment, using any of the methods described above.
If the library is used on another platform, the potential entropy sources should be thoroughly analyzed and a custom implementation must be developed for that platform. You can get your entropy collection ideas by looking at the default implementation of \c zrtp_add_system_state() provided in \c zrtp_rng.c. Again, microphone noise can be a good entropy source for VoIP clients. Raw, uncompressed, unfiltered audio samples should be used.
If you have entropy gathering schemes for platforms not already supported in libzrtp, or if you doubt the correctness of your entropy collection approach, contact us to discuss how it may be done. We will do our best to provide you with technical assistance.
*/
This diff was suppressed by a .gitattributes entry.
差异被折叠。
/*
* libZRTP SDK library, implements the ZRTP secure VoIP protocol.
* Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved.
* Contact: http://philzimmermann.com
* For licensing and other legal details, see the file zrtp_legal.c.
*
* Viktor Krykun <v.krikun at zfoneproject.com>
*/
#ifndef __ZRTP_BASE_H__
#define __ZRTP_BASE_H__
#include "zrtp_config.h"
typedef double uint64_t_;
typedef uint8_t zrtp_uchar4_t[4];
typedef uint8_t zrtp_uchar8_t[8];
typedef uint8_t zrtp_uchar12_t[12];
typedef uint8_t zrtp_uchar16_t[16];
typedef uint8_t zrtp_uchar32_t[32];
typedef uint8_t zrtp_uchar64_t[64];
typedef uint8_t zrtp_uchar128_t[128];
typedef uint8_t zrtp_uchar256_t[256];
typedef uint8_t zrtp_uchar1024_t[1024];
typedef uint32_t zrtp_id_t;
typedef struct zrtp_profile_t zrtp_profile_t;
typedef struct zrtp_stream_t zrtp_stream_t;
typedef struct zrtp_session_t zrtp_session_t;
typedef struct zrtp_global_t zrtp_global_t;
typedef struct zrtp_protocol_t zrtp_protocol_t;
typedef struct zrtp_srtp_ctx_t zrtp_srtp_ctx_t;
typedef struct zrtp_shared_secret_t zrtp_shared_secret_t;
typedef struct zrtp_retry_task_t zrtp_retry_task_t;
typedef struct zrtp_hash_t zrtp_hash_t;
typedef struct zrtp_cipher_t zrtp_cipher_t;
typedef struct zrtp_auth_tag_length_t zrtp_auth_tag_length_t;
typedef struct zrtp_pk_scheme_t zrtp_pk_scheme_t;
typedef struct zrtp_sas_scheme_t zrtp_sas_scheme_t;
typedef struct zrtp_sig_scheme_t zrtp_sig_scheme_t;
typedef struct zrtp_mutex_t zrtp_mutex_t;
typedef struct zrtp_sem_t zrtp_sem_t;
typedef struct zrtp_stream_info_t zrtp_stream_info_t;
typedef struct zrtp_session_info_t zrtp_session_info_t;
#include "sha2.h"
#define MD_CTX sha512_ctx
#define MD_Update(a,b,c) sha512_hash((const unsigned char *)(b),c,a)
/**
* \brief Function computing minimum value
*
* This macro returns the lesser of two values. If the numbers are equal, either of them is returned.
*
* \param left - first value for comparison;
* \param right - second value for comparison.
* \return
* - lesser of compared numbers.
*/
#define ZRTP_MIN(left, right) ((left < right) ? left : right)
/*!
* \brief zrtp_htonXX, zrtp_ntohXX - convert values between host and network
* byte order
*
* To avoid ambiguities and difficulties with compilation on various platforms,
* we designed our own swap functions. Byte order detection is based on zrtp_system.h.
*
* On the i80x86 the host byte order is little-endian (least significant byte
* first), whereas the network byte order, as used on the Internet, is
* big-endian (most significant byte first).
*/
ZRTP_INLINE uint16_t zrtp_swap16(uint16_t x) {
return (x >> 8 | x << 8);
}
uint32_t zrtp_swap32(uint32_t x);
uint64_t zrtp_swap64(uint64_t x);
#if ZRTP_BYTE_ORDER == ZBO_BIG_ENDIAN
/*! Converts 16 bit unsigned integer to network byte order */
#define zrtp_hton16(x) (x)
/*! Converts 32 bit unsigned integer to network byte order */
#define zrtp_hton32(x) (x)
/*! Converts 64 bit unsigned integer to network byte order */
#define zrtp_hton64(x) (x)
/*! Converts 16 bit unsigned integer to host byte order */
#define zrtp_ntoh16(x) (x)
/*! Converts 32 bit unsigned integer to host byte order */
#define zrtp_ntoh32(x) (x)
/*! Converts 64 bit unsigned integer to host byte order */
#define zrtp_ntoh64(x) (x)
#else /* ZBO_BIG_ENDIAN */
/*! Converts 16 bit unsigned integer to network byte order */
#define zrtp_hton16(x) (zrtp_swap16(x))
/*! Converts 32 bit unsigned integer to network byte order */
#define zrtp_hton32(x) (zrtp_swap32(x))
/*! Converts 64 bit unsigned integer to network byte order */
#define zrtp_hton64(x) (zrtp_swap64(x))
/*! Converts 16 bit unsigned integer to host byte order */
#define zrtp_ntoh16(x) (zrtp_swap16(x))
/*! Converts 32 bit unsigned integer to host byte order */
#define zrtp_ntoh32(x) (zrtp_swap32(x))
/*! Converts 64 bit unsigned integer to host byte order */
#define zrtp_ntoh64(x) (zrtp_swap64(x))
#endif
/*
* 128 and 256-bit structures used in Ciphers and SRTP module
*/
typedef union
{
uint8_t v8[16];
uint16_t v16[8];
uint32_t v32[4];
uint64_t v64[2];
} zrtp_v128_t;
typedef union
{
uint8_t v8[32];
uint16_t v16[16];
uint32_t v32[8];
uint64_t v64[4];
} zrtp_v256_t;
/*
* The following macros define the data manipulation functions.
*
* If DATATYPES_USE_MACROS is defined, then these macros are used directly (and
* function-call overhead is avoided). Otherwise, the macros are used through
* the functions defined in datatypes.c (and the compiler provides better
* warnings).
*/
#define _zrtp_v128_xor(z, x, y) \
( \
(z)->v32[0] = (x)->v32[0] ^ (y)->v32[0], \
(z)->v32[1] = (x)->v32[1] ^ (y)->v32[1], \
(z)->v32[2] = (x)->v32[2] ^ (y)->v32[2], \
(z)->v32[3] = (x)->v32[3] ^ (y)->v32[3] \
)
#define _zrtp_v128_get_bit(x, bit) \
( \
( (((x)->v32[(bit) >> 5]) >> ((bit) & 31)) & 1) \
)
#define zrtp_bitmap_get_bit(x, bit) \
( \
( (((x)[(bit) >> 3]) >> ((bit) & 7) ) & 1) \
)
#define zrtp_bitmap_set_bit(x, bit) \
( \
( (((x)[(bit) >> 3])) |= ((uint8_t)1 << ((bit) & 7)) ) \
)
#define zrtp_bitmap_clear_bit(x, bit) \
( \
( (((x)[(bit) >> 3])) &= ~((uint8_t)1 << ((bit) & 7)) ) \
)
void zrtp_bitmap_left_shift(uint8_t *x, int width_bytes, int index);
void zrtp_v128_xor(zrtp_v128_t *z, zrtp_v128_t *x, zrtp_v128_t *y);
//WIN64 {
#if (ZRTP_PLATFORM == ZP_WIN32_KERNEL)
#ifdef WIN64 // For 64-bit apps
unsigned __int64 __rdtsc(void);
#pragma intrinsic(__rdtsc)
#define _RDTSC __rdtsc
#else // For 32-bit apps
#define _RDTSC_STACK(ts) \
__asm rdtsc \
__asm mov DWORD PTR [ts], eax \
__asm mov DWORD PTR [ts+4], edx
__inline unsigned __int64 _inl_rdtsc32() {
unsigned __int64 t;
_RDTSC_STACK(t);
return t;
}
#define _RDTSC _inl_rdtsc32
#endif
#endif
//WIN64 }
#endif /*__ZRTP_BASE_H__*/
/*
* libZRTP SDK library, implements the ZRTP secure VoIP protocol.
* Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved.
* Contact: http://philzimmermann.com
* For licensing and other legal details, see the file zrtp_legal.c.
*
* Viktor Krykun <v.krikun at zfoneproject.com>
*/
#ifndef __ZRTP_CONFIG_H__
#define __ZRTP_CONFIG_H__
#include "zrtp_config_user.h"
/*
* ZRTP PLATFORM DETECTION
* If platworm is not specified manually in zrtp_config_user.h - try to detect it aytomatically
*/
#if !defined(ZRTP_PLATFORM)
# if defined(linux) || defined(__linux)
# include <linux/version.h>
# define ZRTP_PLATFORM ZP_LINUX
# elif defined(__MACOSX__) || defined (__APPLE__) || defined (__MACH__)
# define ZRTP_PLATFORM ZP_DARWIN
# elif defined(_WIN32_WCE) || defined(UNDER_CE)
# include <windef.h>
# define ZRTP_PLATFORM ZP_WINCE
# elif defined(__SYMBIAN32__)
# define ZRTP_PLATFORM ZP_SYMBIAN
# elif defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(WIN32) || defined(__TOS_WIN__)
# if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)
# define ZRTP_PLATFORM ZP_WIN32_KERNEL
# else
# define ZRTP_PLATFORM ZP_WIN32
# endif
# endif
#endif
#if (ZRTP_PLATFORM == ZP_LINUX) || (ZRTP_PLATFORM == ZP_DARWIN) || (ZRTP_PLATFORM == ZP_BSD) || defined(ZRTP_AUTOMAKE)
# include "zrtp_config_unix.h"
#elif (ZRTP_PLATFORM == ZP_WIN32) || (ZRTP_PLATFORM == ZP_WIN32_KERNEL) || (ZRTP_PLATFORM == ZP_WINCE)
# include "zrtp_config_win.h"
#elif (ZRTP_PLATFORM == ZP_SYMBIAN)
# include "zrtp_config_symbian.h"
#endif
#if !defined(ZRTP_PLATFORM)
# error "Libzrtp can't detect software platform: use manual setup in zrtp_config_user.h"
#endif
#if ZRTP_HAVE_LINUX_VERSION_H == 1
#include <linux/version.h>
#endif
#if ZRTP_HAVE_ASM_TYPES_H == 1
#include <asm/types.h>
#endif
/*
* ZRTP BYTEORDER DETECTION
* If the byte order is not specified manually in zrtp_config_user.h - try to detect it aytomatically
*/
#if !defined(ZRTP_BYTE_ORDER)
#if defined(_i386_) || defined(i_386_) || defined(_X86_) || defined(x86) || defined(__i386__) || \
defined(__i386) || defined(_M_IX86) || defined(__I86__)
/*
* Generic i386 processor family, little-endian
*/
#define ZRTP_BYTE_ORDER ZBO_LITTLE_ENDIAN
#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_AMD64_)
/*
* AMD 64bit processor, little endian
*/
#define ZRTP_BYTE_ORDER ZBO_LITTLE_ENDIAN
#elif defined( __sparc__) || defined(__sparc)
/*
* Sun Sparc, big endian
*/
#define ZRTP_BYTE_ORDER ZBO_BIG_ENDIAN
#elif defined(ARM) || defined(_ARM_) || defined(ARMV4) || defined(__arm__)
/*
* ARM, default to little endian
*/
#define ZRTP_BYTE_ORDER ZBO_LITTLE_ENDIAN
#elif defined(__powerpc) || defined(__powerpc__) || defined(__POWERPC__) || defined(__ppc__) || \
defined(_M_PPC) || defined(_ARCH_PPC)
/*
* PowerPC, big endian
*/
#define ZRTP_BYTE_ORDER ZBO_BIG_ENDIAN
#endif /* Automatic byte order detection */
#endif
#if !defined(ZRTP_BYTE_ORDER)
# error "Libzrtp can't detect byte order: use manual setup in zrtp_config_user.h"
#endif
/*
* Define Unaligned structure for target platform
*/
#if (ZRTP_PLATFORM == ZP_WINCE)
# define ZRTP_UNALIGNED(type) UNALIGNED type
#else
# define ZRTP_UNALIGNED(type) type
#endif
/*
* Define basic literal types for libzrtp
* We use this definitions in SRTP, AES and Hash implementation
*/
#if (ZRTP_PLATFORM != ZP_WIN32_KERNEL)
# if ZRTP_HAVE_STDLIB_H == 1
# include <stdlib.h>
# endif
# if ZRTP_HAVE_STDINT_H == 1
# include <stdint.h>
# endif
# if ZRTP_HAVE_INTTYPES_H == 1
# include <inttypes.h>
# endif
# if ZRTP_HAVE_SYS_TYPES_H == 1
# include <sys/types.h>
# endif
# if ZRTP_HAVE_SYS_INT_TYPES_H == 1
# include <sys/int_types.h>
# endif
# if ZRTP_HAVE_MACHINE_TYPES_H == 1
# include <machine/types.h>
# endif
#endif
#if (ZRTP_PLATFORM == ZP_WINCE) || (ZRTP_PLATFORM == ZP_SYMBIAN)
# define ALIGNMENT_32BIT_REQUIRED
#endif
#ifdef ZRTP_HAVE_UINT64_T
# if ZRTP_HAVE_UINT64_T == 0
# if defined(WIN32) || defined(WIN64)
# if defined(_MSC_VER) && (_MSC_VER < 1310)
typedef __int64 uint64_t;
# else
typedef unsigned long long uint64_t;
# endif
# else
# if SIZEOF_UNSIGNED_LONG == 8
typedef unsigned long uint64_t;
# elif SIZEOF_UNSIGNED_LONG_LONG == 8
typedef unsigned long long uint64_t;
# else
# define ZRTP_NO_64BIT_MATH 1
# endif
# endif /* WIN32 */
# endif
#endif
#ifdef ZRTP_HAVE_INT64_T
# if ZRTP_HAVE_INT64_T == 0
# if defined(WIN32) || defined(WIN64)
# if defined(_MSC_VER) && (_MSC_VER < 1310)
typedef __int64 int64_t;
# else
typedef long long int64_t;
# endif
# else
# if SIZEOF_UNSIGNED_LONG == 8
typedef long int64_t;
# elif SIZEOF_UNSIGNED_LONG_LONG == 8
typedef long long int64_t;
# else
# define ZRTP_NO_64BIT_MATH 1
# endif
# endif /* WIN32 */
# endif
#endif
#define SIZEOF_UNSIGNED_LONG_LONG 8
#if defined(WIN32) || defined(WIN64)
# if defined(_MSC_VER) && (_MSC_VER < 1310)
# define li_64(h) 0x##h##ui64
# else
# define li_64(h) 0x##h##ull
# endif
#else
# if SIZEOF_UNSIGNED_LONG == 8
# define li_64(h) 0x##h##ul
# elif SIZEOF_UNSIGNED_LONG_LONG == 8
# define li_64(h) 0x##h##ull
# else
# define ZRTP_NO_64BIT_MATH 1
# endif
#endif /* WIN32 */
#ifdef ZRTP_HAVE_UINT8_T
# if ZRTP_HAVE_UINT8_T == 0
typedef unsigned char uint8_t;
# endif
#endif
#ifdef ZRTP_HAVE_UINT16_T
# if ZRTP_HAVE_UINT16_T == 0
typedef unsigned short int uint16_t;
# endif
#endif
#ifdef ZRTP_HAVE_UINT32_T
# if ZRTP_HAVE_UINT32_T == 0
typedef unsigned int uint32_t;
# endif
#endif
#ifdef ZRTP_HAVE_INT8_T
# if ZRTP_HAVE_INT8_T == 0
typedef char int8_t;
# endif
#endif
#ifdef ZRTP_HAVE_INT16_T
# if ZRTP_HAVE_INT16_T == 0
typedef short int int16_t;
# endif
#endif
#ifdef ZRTP_HAVE_INT32_T
# if ZRTP_HAVE_INT32_T == 0
typedef int int32_t;
# endif
#endif
#endif /*__ZRTP_CONFIG_H__ */
/*
* libZRTP SDK library, implements the ZRTP secure VoIP protocol.
* Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved.
* Contact: http://philzimmermann.com
* For licensing and other legal details, see the file zrtp_legal.c.
*
* Viktor Krykun <v.krikun at zfoneproject.com>
*/
#ifndef ZRTP_SYMB_CONFIG_H__
#define ZRTP_SYMB_CONFIG_H__
/*
* Used to map system integer types to zrtp integer definitions.
* Define to 1 if you have the <inttypes.h> header file.
*/
#undef ZRTP_HAVE_INTTYPES_H
/*
* This header is needed for operations with binary file in deefault realization
* of the secrets' cache. Can be eliminated if default cache isn't used.
* Define to 1 if you have the <stdio.h> header file.
*/
#ifndef ZRTP_HAVE_STDIO_H
# define ZRTP_HAVE_STDIO_H 1
#endif
#ifndef ZRTP_HAVE_STDARG_H
# define ZRTP_HAVE_STDARG_H 1
#endif
/*
* Used by bnlib, but we don't need this on Symbian platform.
*/
#ifndef NO_ASSERT_H
# define NO_ASSERT_H 1
#endif
/*
* Used by bnlib. We have stdlib in Symbian platform - set it to 1.
*/
#ifndef NO_STDLIB_H
# define NO_STDLIB_H 0
#endif
#ifndef ZRTP_HAVE_SYS_TIME_H
# define ZRTP_HAVE_SYS_TIME_H 1
#endif
#define ZRTP_HAVE_INT64_T 0
#define ZRTP_HAVE_INT32_T 0
#define ZRTP_HAVE_INT16_T 0
#define ZRTP_HAVE_INT8_T 0
#define ZRTP_HAVE_UINT64_T 0
#define ZRTP_HAVE_UINT32_T 0
#define ZRTP_HAVE_UINT16_T 0
#define ZRTP_HAVE_UINT8_T 0
#define ZRTP_BYTE_ORDER ZBO_BIG_ENDIAN
#define SIZEOF_UNSIGNED_LONG 4
#define SIZEOF_UNSIGNED_LONG_LONG 8
#define ZRTP_INLINE static __inline
#endif /* ZRTP_WIN_CONFIG_H__ */
差异被折叠。
/*
* libZRTP SDK library, implements the ZRTP secure VoIP protocol.
* Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved.
* Contact: http://philzimmermann.com
* For licensing and other legal details, see the file zrtp_legal.c.
*
* Viktor Krykun <v.krikun at zfoneproject.com>
*/
#ifndef ZRTP_WIN_CONFIG_H__
#define ZRTP_WIN_CONFIG_H__
/*
* Used to map system integer types to zrtp integer definitions.
* Define to 1 if you have the <inttypes.h> header file.
*/
#undef ZRTP_HAVE_INTTYPES_H
#define ZRTP_HAVE_STRING_H 1
/*
* This header is needed for operations with binary file in deefault realization
* of the secrets' cache. Can be eliminated if default cache isn't used.
* Define to 1 if you have the <stdio.h> header file.
*/
#ifndef ZRTP_HAVE_STDIO_H
# define ZRTP_HAVE_STDIO_H 1
#endif
#ifndef ZRTP_HAVE_STDARG_H
# define ZRTP_HAVE_STDARG_H 1
#endif
/*
* Used by bnlib, but we don't need this on Windows platform.
*/
#ifndef NO_ASSERT_H
#define NO_ASSERT_H 1
#endif
/*
* Used by bnlib. We have stdlib in any Windows platform - set it to 1.
*/
#ifndef NO_STDLIB_H
#define NO_STDLIB_H 0
#endif
#define ZRTP_HAVE_INT64_T 0
#define ZRTP_HAVE_INT32_T 0
#define ZRTP_HAVE_INT16_T 0
#define ZRTP_HAVE_INT8_T 0
#define ZRTP_HAVE_UINT64_T 0
#define ZRTP_HAVE_UINT32_T 0
#define ZRTP_HAVE_UINT16_T 0
#define ZRTP_HAVE_UINT8_T 0
#define SIZEOF_UNSIGNED_LONG 4
#define SIZEOF_UNSIGNED_LONG_LONG 8
#define ZRTP_INLINE static __inline
#define ZRTP_VERSION "0.90"
#endif /* ZRTP_WIN_CONFIG_H__ */
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
/*
* libZRTP SDK library, implements the ZRTP secure VoIP protocol.
* Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved.
* Contact: http://philzimmermann.com
* For licensing and other legal details, see the file zrtp_legal.c.
*
* Viktor Krykun <v.krikun at zfoneproject.com>
*/
#ifndef __ZRTP_LEGAL_H__
#define __ZRTP_LEGAL_H__
/*
* We want the copyright string accessable to the unix strings command in
* the linked binary, and don't want the linker to remove it if it's not
* referenced, thus the volatile qualifier.
*
* ANSI C standard, section 3.5.3: "An object that has volatile-qualified
* type may be modified in ways unknown to the implementation or have
* other unknown side effects."
*/
extern volatile const char zrtpCopyright[];
#endif /*__ZRTP_LEGAL_H__ */
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
/*
* libZRTP SDK library, implements the ZRTP secure VoIP protocol.
* Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved.
* Contact: http://philzimmermann.com
* For licensing and other legal details, see the file zrtp_legal.c.
*
* Viktor Krykun <v.krikun at zfoneproject.com>
*/
#ifndef __ZRTP_VERSION_H__
#define __ZRTP_VERSION_H__
#define LIBZRTP_VERSION_MAJOR 1
#define LIBZRTP_VERSION_MINOR 0
#define LIBZRTP_VERSION_BUILD 591
#define LIBZRTP_VERSION_STR "v1.00 590"
#endif /*__ZRTP_VERSION_H__*/
差异被折叠。
/*
* libZRTP SDK library, implements the ZRTP secure VoIP protocol.
* Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved.
* Contact: http://philzimmermann.com
* For licensing and other legal details, see the file zrtp_legal.c.
*/
\ No newline at end of file
Change Log is available at [https://developers.zfoneproject.com/libzrtp/wiki/LibzrtpChangeLog]
\ No newline at end of file
差异被折叠。
差异被折叠。
#!/bin/bash
aclocal -I ./config/
autoheader
autoconf
automake
差异被折叠。
差异被折叠。
#!/bin/bash
./configure --enable-enterprise
\ No newline at end of file
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
bldmake bldfiles
\ No newline at end of file
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论