~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.1.0/third_party/srtp/crypto/include/prng.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (1.1.11)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20140128182336-3xenud1kbnwmf3mz
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * prng.h
 
3
 *
 
4
 * pseudorandom source
 
5
 *
 
6
 * David A. McGrew
 
7
 * Cisco Systems, Inc.
 
8
 */
 
9
 
 
10
#ifndef PRNG_H
 
11
#define PRNG_H
 
12
 
 
13
#include "rand_source.h"  /* for rand_source_func_t definition       */
 
14
#include "aes.h"          /* for aes                                 */
 
15
#include "aes_icm.h"      /* for aes ctr                             */
 
16
 
 
17
#define MAX_PRNG_OUT_LEN 0xffffffffU
 
18
 
 
19
/*
 
20
 * x917_prng is an ANSI X9.17-like AES-based PRNG
 
21
 */
 
22
 
 
23
typedef struct {
 
24
  v128_t   state;          /* state data                              */
 
25
  aes_expanded_key_t key;  /* secret key                              */
 
26
  uint32_t octet_count;    /* number of octets output since last init */
 
27
  rand_source_func_t rand; /* random source for re-initialization     */
 
28
} x917_prng_t;
 
29
 
 
30
err_status_t
 
31
x917_prng_init(rand_source_func_t random_source);
 
32
 
 
33
err_status_t
 
34
x917_prng_get_octet_string(uint8_t *dest, uint32_t len);
 
35
 
 
36
 
 
37
/*
 
38
 * ctr_prng is an AES-CTR based PRNG
 
39
 */
 
40
 
 
41
typedef struct {
 
42
  uint32_t octet_count;    /* number of octets output since last init */
 
43
  aes_icm_ctx_t   state;   /* state data                              */
 
44
  rand_source_func_t rand; /* random source for re-initialization     */
 
45
} ctr_prng_t;
 
46
 
 
47
err_status_t
 
48
ctr_prng_init(rand_source_func_t random_source);
 
49
 
 
50
err_status_t
 
51
ctr_prng_get_octet_string(void *dest, uint32_t len);
 
52
 
 
53
 
 
54
#endif