Commit eab24755 authored by Niels Möller's avatar Niels Möller

(des_ecb3_encrypt): Don't use struct initialization

(c89 doesn't allow non-constant initializers). Reported by James
Ralston.
(des_ede3_cbc_encrypt): Likewise.

Rev: src/nettle/des-compat.c:1.7
parent 235f6868
...@@ -61,7 +61,10 @@ des_ecb3_encrypt(des_cblock *src, des_cblock *dst, ...@@ -61,7 +61,10 @@ des_ecb3_encrypt(des_cblock *src, des_cblock *dst,
des_key_schedule k1, des_key_schedule k2, des_key_schedule k1, des_key_schedule k2,
des_key_schedule k3, int enc) des_key_schedule k3, int enc)
{ {
struct des_compat_des3 keys = { { k1, k2, k3 } }; struct des_compat_des3 keys;
keys.keys[0] = k1;
keys.keys[1] = k2;
keys.keys[2] = k3;
((enc == DES_ENCRYPT) ? des_compat_des3_encrypt : des_compat_des3_decrypt) ((enc == DES_ENCRYPT) ? des_compat_des3_encrypt : des_compat_des3_decrypt)
(&keys, DES_BLOCK_SIZE, *dst, *src); (&keys, DES_BLOCK_SIZE, *dst, *src);
...@@ -142,7 +145,10 @@ des_ede3_cbc_encrypt(des_cblock *src, des_cblock *dst, long length, ...@@ -142,7 +145,10 @@ des_ede3_cbc_encrypt(des_cblock *src, des_cblock *dst, long length,
des_cblock *iv, des_cblock *iv,
int enc) int enc)
{ {
struct des_compat_des3 keys = { { k1, k2, k3 } }; struct des_compat_des3 keys;
keys.keys[0] = k1;
keys.keys[1] = k2;
keys.keys[2] = k3;
switch (enc) switch (enc)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment