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

Side by Side Diff: srtp/crypto/include/aes_cbc.h

Issue 889083003: Update libsrtp to upstream 1.5.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libsrtp@master
Patch Set: Updated to libsrtp 1.5.1 Created 5 years, 10 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
« no previous file with comments | « srtp/crypto/include/aes.h ('k') | srtp/crypto/include/aes_gcm_ossl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * aes_cbc.h 2 * aes_cbc.h
3 * 3 *
4 * Header for AES Cipher Blobk Chaining Mode. 4 * Header for AES Cipher Blobk Chaining Mode.
5 * 5 *
6 * David A. McGrew 6 * David A. McGrew
7 * Cisco Systems, Inc. 7 * Cisco Systems, Inc.
8 * 8 *
9 */ 9 */
10
10 /* 11 /*
11 * 12 *
12 * Copyright (c) 2001-2006, Cisco Systems, Inc. 13 * Copyright (c) 2001-2006, Cisco Systems, Inc.
13 * All rights reserved. 14 * All rights reserved.
14 * 15 *
15 * Redistribution and use in source and binary forms, with or without 16 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions 17 * modification, are permitted provided that the following conditions
17 * are met: 18 * are met:
18 * 19 *
19 * Redistributions of source code must retain the above copyright 20 * Redistributions of source code must retain the above copyright
(...skipping 25 matching lines...) Expand all
45 46
46 #ifndef AES_CBC_H 47 #ifndef AES_CBC_H
47 #define AES_CBC_H 48 #define AES_CBC_H
48 49
49 #include "aes.h" 50 #include "aes.h"
50 #include "cipher.h" 51 #include "cipher.h"
51 52
52 typedef struct { 53 typedef struct {
53 v128_t state; /* cipher chaining state */ 54 v128_t state; /* cipher chaining state */
54 v128_t previous; /* previous ciphertext block */ 55 v128_t previous; /* previous ciphertext block */
56 uint8_t key[32];
57 int key_len;
55 aes_expanded_key_t expanded_key; /* the cipher key */ 58 aes_expanded_key_t expanded_key; /* the cipher key */
56 } aes_cbc_ctx_t; 59 } aes_cbc_ctx_t;
57 60
58 err_status_t 61 err_status_t
59 aes_cbc_set_key(aes_cbc_ctx_t *c, 62 aes_cbc_set_key(aes_cbc_ctx_t *c,
60 const unsigned char *key); 63 const unsigned char *key);
61 64
62 err_status_t 65 err_status_t
63 aes_cbc_encrypt(aes_cbc_ctx_t *c, 66 aes_cbc_encrypt(aes_cbc_ctx_t *c,
64 unsigned char *buf, 67 unsigned char *buf,
65 unsigned int *bytes_in_data); 68 unsigned int *bytes_in_data);
66 69
67 err_status_t 70 err_status_t
68 aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key, 71 aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key,
69 » » int key_len, cipher_direction_t dir); 72 » » int key_len);
70 73
71 err_status_t 74 err_status_t
72 aes_cbc_set_iv(aes_cbc_ctx_t *c, void *iv); 75 aes_cbc_set_iv(aes_cbc_ctx_t *c, void *iv, int direction);
73 76
74 err_status_t 77 err_status_t
75 aes_cbc_nist_encrypt(aes_cbc_ctx_t *c, 78 aes_cbc_nist_encrypt(aes_cbc_ctx_t *c,
76 unsigned char *data, 79 unsigned char *data,
77 unsigned int *bytes_in_data); 80 unsigned int *bytes_in_data);
78 81
79 err_status_t 82 err_status_t
80 aes_cbc_nist_decrypt(aes_cbc_ctx_t *c, 83 aes_cbc_nist_decrypt(aes_cbc_ctx_t *c,
81 unsigned char *data, 84 unsigned char *data,
82 unsigned int *bytes_in_data); 85 unsigned int *bytes_in_data);
83 86
84 #endif /* AES_CBC_H */ 87 #endif /* AES_CBC_H */
85 88
OLDNEW
« no previous file with comments | « srtp/crypto/include/aes.h ('k') | srtp/crypto/include/aes_gcm_ossl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698