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