Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Side by Side Diff: libsrtp/crypto/include/prng.h

Issue 3423016: Add current version of libSRTP from CVS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: '' Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « libsrtp/crypto/include/null_cipher.h ('k') | libsrtp/crypto/include/rand_source.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
OLDNEW
« no previous file with comments | « libsrtp/crypto/include/null_cipher.h ('k') | libsrtp/crypto/include/rand_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698