Browse Source

Added setiv method

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
0d07657296
1 changed files with 16 additions and 0 deletions
  1. 16
    0
      src/include/gpxe/crypto.h

+ 16
- 0
src/include/gpxe/crypto.h View File

34
 	 * @ret rc		Return status code
34
 	 * @ret rc		Return status code
35
 	 */
35
 	 */
36
 	int ( * setkey ) ( void *ctx, void *key, size_t keylen );
36
 	int ( * setkey ) ( void *ctx, void *key, size_t keylen );
37
+	/** Set initialisation vector
38
+	 *
39
+	 * @v ctx		Context
40
+	 * @v iv		Initialisation vector
41
+	 */
42
+	void ( *setiv ) ( void *ctx, void *iv );
37
 	/** Encode data
43
 	/** Encode data
38
 	 *
44
 	 *
39
 	 * @v ctx		Context
45
 	 * @v ctx		Context
85
 	crypto->final ( ctx, out );
91
 	crypto->final ( ctx, out );
86
 }
92
 }
87
 
93
 
94
+static inline void cipher_setiv ( struct crypto_algorithm *crypto,
95
+				 void *ctx, void *iv ) {
96
+	crypto->setiv ( ctx, iv );
97
+}
98
+
99
+static inline int cipher_setkey ( struct crypto_algorithm *crypto,
100
+				  void *ctx, void *key, size_t keylen ) {
101
+	return crypto->setkey ( ctx, key, keylen );
102
+}
103
+
88
 static inline int cipher_encrypt ( struct crypto_algorithm *crypto,
104
 static inline int cipher_encrypt ( struct crypto_algorithm *crypto,
89
 				   void *ctx, const void *src, void *dst,
105
 				   void *ctx, const void *src, void *dst,
90
 				   size_t len ) {
106
 				   size_t len ) {

Loading…
Cancel
Save