Commit ec85dfe3 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

bcrypt: Rename mode_id to chain_mode.

parent 6f5028dd
...@@ -144,31 +144,31 @@ enum alg_id ...@@ -144,31 +144,31 @@ enum alg_id
ALG_ID_RNG, ALG_ID_RNG,
}; };
enum mode_id enum chain_mode
{ {
MODE_ID_CBC, CHAIN_MODE_CBC,
MODE_ID_ECB, CHAIN_MODE_ECB,
MODE_ID_CFB, CHAIN_MODE_CFB,
MODE_ID_CCM, CHAIN_MODE_CCM,
MODE_ID_GCM, CHAIN_MODE_GCM,
}; };
struct algorithm struct algorithm
{ {
struct object hdr; struct object hdr;
enum alg_id id; enum alg_id id;
enum mode_id mode; enum chain_mode mode;
unsigned flags; unsigned flags;
}; };
struct key_symmetric struct key_symmetric
{ {
enum mode_id mode; enum chain_mode mode;
ULONG block_size; ULONG block_size;
UCHAR *vector; UCHAR *vector;
ULONG vector_len; ULONG vector_len;
UCHAR *secret; UCHAR *secret;
unsigned secret_len; unsigned secret_len;
CRITICAL_SECTION cs; CRITICAL_SECTION cs;
}; };
......
...@@ -490,7 +490,7 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key ) ...@@ -490,7 +490,7 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
WARN( "handle block size\n" ); WARN( "handle block size\n" );
switch (key->u.s.mode) switch (key->u.s.mode)
{ {
case MODE_ID_CBC: case CHAIN_MODE_CBC:
return GNUTLS_CIPHER_3DES_CBC; return GNUTLS_CIPHER_3DES_CBC;
default: default:
break; break;
...@@ -502,17 +502,17 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key ) ...@@ -502,17 +502,17 @@ static gnutls_cipher_algorithm_t get_gnutls_cipher( const struct key *key )
WARN( "handle block size\n" ); WARN( "handle block size\n" );
switch (key->u.s.mode) switch (key->u.s.mode)
{ {
case MODE_ID_GCM: case CHAIN_MODE_GCM:
if (key->u.s.secret_len == 16) return GNUTLS_CIPHER_AES_128_GCM; if (key->u.s.secret_len == 16) return GNUTLS_CIPHER_AES_128_GCM;
if (key->u.s.secret_len == 32) return GNUTLS_CIPHER_AES_256_GCM; if (key->u.s.secret_len == 32) return GNUTLS_CIPHER_AES_256_GCM;
break; break;
case MODE_ID_ECB: /* can be emulated with CBC + empty IV */ case CHAIN_MODE_ECB: /* can be emulated with CBC + empty IV */
case MODE_ID_CBC: case CHAIN_MODE_CBC:
if (key->u.s.secret_len == 16) return GNUTLS_CIPHER_AES_128_CBC; if (key->u.s.secret_len == 16) return GNUTLS_CIPHER_AES_128_CBC;
if (key->u.s.secret_len == 24) return GNUTLS_CIPHER_AES_192_CBC; if (key->u.s.secret_len == 24) return GNUTLS_CIPHER_AES_192_CBC;
if (key->u.s.secret_len == 32) return GNUTLS_CIPHER_AES_256_CBC; if (key->u.s.secret_len == 32) return GNUTLS_CIPHER_AES_256_CBC;
break; break;
case MODE_ID_CFB: case CHAIN_MODE_CFB:
if (key->u.s.secret_len == 16) return GNUTLS_CIPHER_AES_128_CFB8; if (key->u.s.secret_len == 16) return GNUTLS_CIPHER_AES_128_CFB8;
if (key->u.s.secret_len == 24) return GNUTLS_CIPHER_AES_192_CFB8; if (key->u.s.secret_len == 24) return GNUTLS_CIPHER_AES_192_CFB8;
if (key->u.s.secret_len == 32) return GNUTLS_CIPHER_AES_256_CFB8; if (key->u.s.secret_len == 32) return GNUTLS_CIPHER_AES_256_CFB8;
...@@ -2041,13 +2041,13 @@ typedef ULONG PTR32; ...@@ -2041,13 +2041,13 @@ typedef ULONG PTR32;
struct key_symmetric32 struct key_symmetric32
{ {
enum mode_id mode; enum chain_mode mode;
ULONG block_size; ULONG block_size;
PTR32 vector; PTR32 vector;
ULONG vector_len; ULONG vector_len;
PTR32 secret; PTR32 secret;
ULONG secret_len; ULONG secret_len;
ULONG __cs[6]; ULONG __cs[6];
}; };
struct key_asymmetric32 struct key_asymmetric32
......
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