update master-with-bazel from master branch
This commit is contained in:
@@ -85,16 +85,14 @@ static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in,
|
||||
}
|
||||
|
||||
static const EVP_CIPHER evp_des_cbc = {
|
||||
/* nid = */ NID_des_cbc,
|
||||
/* block_size = */ 8,
|
||||
/* key_len = */ 8,
|
||||
/* iv_len = */ 8,
|
||||
/* ctx_size = */ sizeof(EVP_DES_KEY),
|
||||
/* flags = */ EVP_CIPH_CBC_MODE,
|
||||
/* init = */ des_init_key,
|
||||
/* cipher = */ des_cbc_cipher,
|
||||
/* cleanup = */ NULL,
|
||||
/* ctrl = */ NULL,
|
||||
.nid = NID_des_cbc,
|
||||
.block_size = 8,
|
||||
.key_len = 8,
|
||||
.iv_len = 8,
|
||||
.ctx_size = sizeof(EVP_DES_KEY),
|
||||
.flags = EVP_CIPH_CBC_MODE,
|
||||
.init = des_init_key,
|
||||
.cipher = des_cbc_cipher,
|
||||
};
|
||||
|
||||
const EVP_CIPHER *EVP_des_cbc(void) { return &evp_des_cbc; }
|
||||
@@ -114,16 +112,14 @@ static int des_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in,
|
||||
}
|
||||
|
||||
static const EVP_CIPHER evp_des_ecb = {
|
||||
/* nid = */ NID_des_ecb,
|
||||
/* block_size = */ 8,
|
||||
/* key_len = */ 8,
|
||||
/* iv_len = */ 0,
|
||||
/* ctx_size = */ sizeof(EVP_DES_KEY),
|
||||
/* flags = */ EVP_CIPH_ECB_MODE,
|
||||
/* init = */ des_init_key,
|
||||
/* cipher = */ des_ecb_cipher,
|
||||
/* cleanup = */ NULL,
|
||||
/* ctrl = */ NULL,
|
||||
.nid = NID_des_ecb,
|
||||
.block_size = 8,
|
||||
.key_len = 8,
|
||||
.iv_len = 0,
|
||||
.ctx_size = sizeof(EVP_DES_KEY),
|
||||
.flags = EVP_CIPH_ECB_MODE,
|
||||
.init = des_init_key,
|
||||
.cipher = des_ecb_cipher,
|
||||
};
|
||||
|
||||
const EVP_CIPHER *EVP_des_ecb(void) { return &evp_des_ecb; }
|
||||
@@ -153,16 +149,14 @@ static int des_ede3_cbc_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out,
|
||||
}
|
||||
|
||||
static const EVP_CIPHER evp_des_ede3_cbc = {
|
||||
/* nid = */ NID_des_ede3_cbc,
|
||||
/* block_size = */ 8,
|
||||
/* key_len = */ 24,
|
||||
/* iv_len = */ 8,
|
||||
/* ctx_size = */ sizeof(DES_EDE_KEY),
|
||||
/* flags = */ EVP_CIPH_CBC_MODE,
|
||||
/* init = */ des_ede3_init_key,
|
||||
/* cipher = */ des_ede3_cbc_cipher,
|
||||
/* cleanup = */ NULL,
|
||||
/* ctrl = */ NULL,
|
||||
.nid = NID_des_ede3_cbc,
|
||||
.block_size = 8,
|
||||
.key_len = 24,
|
||||
.iv_len = 8,
|
||||
.ctx_size = sizeof(DES_EDE_KEY),
|
||||
.flags = EVP_CIPH_CBC_MODE,
|
||||
.init = des_ede3_init_key,
|
||||
.cipher = des_ede3_cbc_cipher,
|
||||
};
|
||||
|
||||
const EVP_CIPHER *EVP_des_ede3_cbc(void) { return &evp_des_ede3_cbc; }
|
||||
@@ -178,16 +172,14 @@ static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key,
|
||||
}
|
||||
|
||||
static const EVP_CIPHER evp_des_ede_cbc = {
|
||||
/* nid = */ NID_des_ede_cbc,
|
||||
/* block_size = */ 8,
|
||||
/* key_len = */ 16,
|
||||
/* iv_len = */ 8,
|
||||
/* ctx_size = */ sizeof(DES_EDE_KEY),
|
||||
/* flags = */ EVP_CIPH_CBC_MODE,
|
||||
/* init = */ des_ede_init_key,
|
||||
/* cipher = */ des_ede3_cbc_cipher,
|
||||
/* cleanup = */ NULL,
|
||||
/* ctrl = */ NULL,
|
||||
.nid = NID_des_ede_cbc,
|
||||
.block_size = 8,
|
||||
.key_len = 16,
|
||||
.iv_len = 8,
|
||||
.ctx_size = sizeof(DES_EDE_KEY),
|
||||
.flags = EVP_CIPH_CBC_MODE,
|
||||
.init = des_ede_init_key,
|
||||
.cipher = des_ede3_cbc_cipher,
|
||||
};
|
||||
|
||||
const EVP_CIPHER *EVP_des_ede_cbc(void) { return &evp_des_ede_cbc; }
|
||||
@@ -208,31 +200,27 @@ static int des_ede_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out,
|
||||
}
|
||||
|
||||
static const EVP_CIPHER evp_des_ede = {
|
||||
/* nid = */ NID_des_ede_ecb,
|
||||
/* block_size = */ 8,
|
||||
/* key_len = */ 16,
|
||||
/* iv_len = */ 0,
|
||||
/* ctx_size = */ sizeof(DES_EDE_KEY),
|
||||
/* flags = */ EVP_CIPH_ECB_MODE,
|
||||
/* init = */ des_ede_init_key,
|
||||
/* cipher = */ des_ede_ecb_cipher,
|
||||
/* cleanup = */ NULL,
|
||||
/* ctrl = */ NULL,
|
||||
.nid = NID_des_ede_ecb,
|
||||
.block_size = 8,
|
||||
.key_len = 16,
|
||||
.iv_len = 0,
|
||||
.ctx_size = sizeof(DES_EDE_KEY),
|
||||
.flags = EVP_CIPH_ECB_MODE,
|
||||
.init = des_ede_init_key,
|
||||
.cipher = des_ede_ecb_cipher,
|
||||
};
|
||||
|
||||
const EVP_CIPHER *EVP_des_ede(void) { return &evp_des_ede; }
|
||||
|
||||
static const EVP_CIPHER evp_des_ede3 = {
|
||||
/* nid = */ NID_des_ede3_ecb,
|
||||
/* block_size = */ 8,
|
||||
/* key_len = */ 24,
|
||||
/* iv_len = */ 0,
|
||||
/* ctx_size = */ sizeof(DES_EDE_KEY),
|
||||
/* flags = */ EVP_CIPH_ECB_MODE,
|
||||
/* init = */ des_ede3_init_key,
|
||||
/* cipher = */ des_ede_ecb_cipher,
|
||||
/* cleanup = */ NULL,
|
||||
/* ctrl = */ NULL,
|
||||
.nid = NID_des_ede3_ecb,
|
||||
.block_size = 8,
|
||||
.key_len = 24,
|
||||
.iv_len = 0,
|
||||
.ctx_size = sizeof(DES_EDE_KEY),
|
||||
.flags = EVP_CIPH_ECB_MODE,
|
||||
.init = des_ede3_init_key,
|
||||
.cipher = des_ede_ecb_cipher,
|
||||
};
|
||||
|
||||
const EVP_CIPHER *EVP_des_ede3(void) { return &evp_des_ede3; }
|
||||
|
||||
@@ -78,9 +78,13 @@ static int null_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out,
|
||||
}
|
||||
|
||||
static const EVP_CIPHER n_cipher = {
|
||||
NID_undef, 1 /* block size */, 0 /* key_len */, 0 /* iv_len */,
|
||||
0 /* ctx_size */, 0 /* flags */, null_init_key, null_cipher,
|
||||
NULL /* cleanup */, NULL /* ctrl */,
|
||||
.nid = NID_undef,
|
||||
.block_size = 1,
|
||||
.key_len = 0,
|
||||
.iv_len = 0,
|
||||
.ctx_size = 0,
|
||||
.init = null_init_key,
|
||||
.cipher = null_cipher,
|
||||
};
|
||||
|
||||
const EVP_CIPHER *EVP_enc_null(void) { return &n_cipher; }
|
||||
|
||||
@@ -427,35 +427,29 @@ static int rc2_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr) {
|
||||
}
|
||||
|
||||
static const EVP_CIPHER rc2_40_cbc = {
|
||||
NID_rc2_40_cbc,
|
||||
8 /* block size */,
|
||||
5 /* 40 bit */,
|
||||
8 /* iv len */,
|
||||
sizeof(EVP_RC2_KEY),
|
||||
EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT,
|
||||
rc2_init_key,
|
||||
rc2_cbc_cipher,
|
||||
NULL,
|
||||
rc2_ctrl,
|
||||
.nid = NID_rc2_40_cbc,
|
||||
.block_size = 8,
|
||||
.key_len = 5 /* 40 bit */,
|
||||
.iv_len = 8,
|
||||
.ctx_size = sizeof(EVP_RC2_KEY),
|
||||
.flags = EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT,
|
||||
.init = rc2_init_key,
|
||||
.cipher = rc2_cbc_cipher,
|
||||
.ctrl = rc2_ctrl,
|
||||
};
|
||||
|
||||
const EVP_CIPHER *EVP_rc2_40_cbc(void) {
|
||||
return &rc2_40_cbc;
|
||||
}
|
||||
const EVP_CIPHER *EVP_rc2_40_cbc(void) { return &rc2_40_cbc; }
|
||||
|
||||
static const EVP_CIPHER rc2_cbc = {
|
||||
NID_rc2_cbc,
|
||||
8 /* block size */,
|
||||
16 /* 128 bit */,
|
||||
8 /* iv len */,
|
||||
sizeof(EVP_RC2_KEY),
|
||||
EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT,
|
||||
rc2_init_key,
|
||||
rc2_cbc_cipher,
|
||||
NULL,
|
||||
rc2_ctrl,
|
||||
.nid = NID_rc2_cbc,
|
||||
.block_size = 8,
|
||||
.key_len = 16 /* 128 bit */,
|
||||
.iv_len = 8,
|
||||
.ctx_size = sizeof(EVP_RC2_KEY),
|
||||
.flags = EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT,
|
||||
.init = rc2_init_key,
|
||||
.cipher = rc2_cbc_cipher,
|
||||
.ctrl = rc2_ctrl,
|
||||
};
|
||||
|
||||
const EVP_CIPHER *EVP_rc2_cbc(void) {
|
||||
return &rc2_cbc;
|
||||
}
|
||||
const EVP_CIPHER *EVP_rc2_cbc(void) { return &rc2_cbc; }
|
||||
|
||||
@@ -81,10 +81,14 @@ static int rc4_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in,
|
||||
}
|
||||
|
||||
static const EVP_CIPHER rc4 = {
|
||||
NID_rc4, 1 /* block_size */, 16 /* key_size */,
|
||||
0 /* iv_len */, sizeof(RC4_KEY), EVP_CIPH_VARIABLE_LENGTH,
|
||||
rc4_init_key, rc4_cipher, NULL /* cleanup */,
|
||||
NULL /* ctrl */,
|
||||
.nid = NID_rc4,
|
||||
.block_size = 1,
|
||||
.key_len = 16,
|
||||
.iv_len = 0,
|
||||
.ctx_size = sizeof(RC4_KEY),
|
||||
.flags = EVP_CIPH_VARIABLE_LENGTH,
|
||||
.init = rc4_init_key,
|
||||
.cipher = rc4_cipher,
|
||||
};
|
||||
|
||||
const EVP_CIPHER *EVP_rc4(void) { return &rc4; }
|
||||
|
||||
@@ -594,27 +594,36 @@ static int bf_cfb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in,
|
||||
}
|
||||
|
||||
static const EVP_CIPHER bf_ecb = {
|
||||
NID_bf_ecb, BF_BLOCK /* block_size */,
|
||||
16 /* key_size */, BF_BLOCK /* iv_len */,
|
||||
sizeof(BF_KEY), EVP_CIPH_ECB_MODE | EVP_CIPH_VARIABLE_LENGTH,
|
||||
bf_init_key, bf_ecb_cipher,
|
||||
NULL /* cleanup */, NULL /* ctrl */,
|
||||
.nid = NID_bf_ecb,
|
||||
.block_size = BF_BLOCK,
|
||||
.key_len = 16,
|
||||
.iv_len = BF_BLOCK,
|
||||
.ctx_size = sizeof(BF_KEY),
|
||||
.flags = EVP_CIPH_ECB_MODE | EVP_CIPH_VARIABLE_LENGTH,
|
||||
.init = bf_init_key,
|
||||
.cipher = bf_ecb_cipher,
|
||||
};
|
||||
|
||||
static const EVP_CIPHER bf_cbc = {
|
||||
NID_bf_cbc, BF_BLOCK /* block_size */,
|
||||
16 /* key_size */, BF_BLOCK /* iv_len */,
|
||||
sizeof(BF_KEY), EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH,
|
||||
bf_init_key, bf_cbc_cipher,
|
||||
NULL /* cleanup */, NULL /* ctrl */,
|
||||
.nid = NID_bf_cbc,
|
||||
.block_size = BF_BLOCK,
|
||||
.key_len = 16,
|
||||
.iv_len = BF_BLOCK,
|
||||
.ctx_size = sizeof(BF_KEY),
|
||||
.flags = EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH,
|
||||
.init = bf_init_key,
|
||||
.cipher = bf_cbc_cipher,
|
||||
};
|
||||
|
||||
static const EVP_CIPHER bf_cfb = {
|
||||
NID_bf_cfb64, 1 /* block_size */,
|
||||
16 /* key_size */, BF_BLOCK /* iv_len */,
|
||||
sizeof(BF_KEY), EVP_CIPH_CFB_MODE | EVP_CIPH_VARIABLE_LENGTH,
|
||||
bf_init_key, bf_cfb_cipher,
|
||||
NULL /* cleanup */, NULL /* ctrl */,
|
||||
.nid = NID_bf_cfb64,
|
||||
.block_size = 1,
|
||||
.key_len = 16,
|
||||
.iv_len = BF_BLOCK,
|
||||
.ctx_size = sizeof(BF_KEY),
|
||||
.flags = EVP_CIPH_CFB_MODE | EVP_CIPH_VARIABLE_LENGTH,
|
||||
.init = bf_init_key,
|
||||
.cipher = bf_cfb_cipher,
|
||||
};
|
||||
|
||||
const EVP_CIPHER *EVP_bf_ecb(void) { return &bf_ecb; }
|
||||
|
||||
+16
-10
@@ -437,19 +437,25 @@ static int cast_cbc_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in,
|
||||
}
|
||||
|
||||
static const EVP_CIPHER cast5_ecb = {
|
||||
NID_cast5_ecb, CAST_BLOCK,
|
||||
CAST_KEY_LENGTH, CAST_BLOCK /* iv_len */,
|
||||
sizeof(CAST_KEY), EVP_CIPH_ECB_MODE | EVP_CIPH_VARIABLE_LENGTH,
|
||||
cast_init_key, cast_ecb_cipher,
|
||||
NULL /* cleanup */, NULL /* ctrl */,
|
||||
.nid = NID_cast5_ecb,
|
||||
.block_size = CAST_BLOCK,
|
||||
.key_len = CAST_KEY_LENGTH,
|
||||
.iv_len = CAST_BLOCK,
|
||||
.ctx_size = sizeof(CAST_KEY),
|
||||
.flags = EVP_CIPH_ECB_MODE | EVP_CIPH_VARIABLE_LENGTH,
|
||||
.init = cast_init_key,
|
||||
.cipher = cast_ecb_cipher,
|
||||
};
|
||||
|
||||
static const EVP_CIPHER cast5_cbc = {
|
||||
NID_cast5_cbc, CAST_BLOCK,
|
||||
CAST_KEY_LENGTH, CAST_BLOCK /* iv_len */,
|
||||
sizeof(CAST_KEY), EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH,
|
||||
cast_init_key, cast_cbc_cipher,
|
||||
NULL /* cleanup */, NULL /* ctrl */,
|
||||
.nid = NID_cast5_cbc,
|
||||
.block_size = CAST_BLOCK,
|
||||
.key_len = CAST_KEY_LENGTH,
|
||||
.iv_len = CAST_BLOCK,
|
||||
.ctx_size = sizeof(CAST_KEY),
|
||||
.flags = EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH,
|
||||
.init = cast_init_key,
|
||||
.cipher = cast_cbc_cipher,
|
||||
};
|
||||
|
||||
const EVP_CIPHER *EVP_cast5_ecb(void) { return &cast5_ecb; }
|
||||
|
||||
+24
-12
@@ -52,24 +52,36 @@ static int aes_cfb128_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out,
|
||||
}
|
||||
|
||||
static const EVP_CIPHER aes_128_cfb128 = {
|
||||
NID_aes_128_cfb128, 1 /* block_size */, 16 /* key_size */,
|
||||
16 /* iv_len */, sizeof(EVP_CFB_CTX), EVP_CIPH_CFB_MODE,
|
||||
aes_cfb_init_key, aes_cfb128_cipher, NULL /* cleanup */,
|
||||
NULL /* ctrl */,
|
||||
.nid = NID_aes_128_cfb128,
|
||||
.block_size = 1,
|
||||
.key_len = 16,
|
||||
.iv_len = 16,
|
||||
.ctx_size = sizeof(EVP_CFB_CTX),
|
||||
.flags = EVP_CIPH_CFB_MODE,
|
||||
.init = aes_cfb_init_key,
|
||||
.cipher = aes_cfb128_cipher,
|
||||
};
|
||||
|
||||
static const EVP_CIPHER aes_192_cfb128 = {
|
||||
NID_aes_192_cfb128, 1 /* block_size */, 24 /* key_size */,
|
||||
16 /* iv_len */, sizeof(EVP_CFB_CTX), EVP_CIPH_CFB_MODE,
|
||||
aes_cfb_init_key, aes_cfb128_cipher, NULL /* cleanup */,
|
||||
NULL /* ctrl */,
|
||||
.nid = NID_aes_192_cfb128,
|
||||
.block_size = 1,
|
||||
.key_len = 24,
|
||||
.iv_len = 16,
|
||||
.ctx_size = sizeof(EVP_CFB_CTX),
|
||||
.flags = EVP_CIPH_CFB_MODE,
|
||||
.init = aes_cfb_init_key,
|
||||
.cipher = aes_cfb128_cipher,
|
||||
};
|
||||
|
||||
static const EVP_CIPHER aes_256_cfb128 = {
|
||||
NID_aes_256_cfb128, 1 /* block_size */, 32 /* key_size */,
|
||||
16 /* iv_len */, sizeof(EVP_CFB_CTX), EVP_CIPH_CFB_MODE,
|
||||
aes_cfb_init_key, aes_cfb128_cipher, NULL /* cleanup */,
|
||||
NULL /* ctrl */,
|
||||
.nid = NID_aes_256_cfb128,
|
||||
.block_size = 1,
|
||||
.key_len = 32,
|
||||
.iv_len = 16,
|
||||
.ctx_size = sizeof(EVP_CFB_CTX),
|
||||
.flags = EVP_CIPH_CFB_MODE,
|
||||
.init = aes_cfb_init_key,
|
||||
.cipher = aes_cfb128_cipher,
|
||||
};
|
||||
|
||||
const EVP_CIPHER *EVP_aes_128_cfb128(void) { return &aes_128_cfb128; }
|
||||
|
||||
+11
-11
@@ -229,16 +229,16 @@ static int aes_xts_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) {
|
||||
}
|
||||
|
||||
static const EVP_CIPHER aes_256_xts = {
|
||||
NID_aes_256_xts,
|
||||
1 /* block_size */,
|
||||
64 /* key_size (2 AES keys) */,
|
||||
16 /* iv_len */,
|
||||
sizeof(EVP_AES_XTS_CTX),
|
||||
EVP_CIPH_XTS_MODE | EVP_CIPH_CUSTOM_IV | EVP_CIPH_ALWAYS_CALL_INIT |
|
||||
EVP_CIPH_CTRL_INIT | EVP_CIPH_CUSTOM_COPY,
|
||||
aes_xts_init_key,
|
||||
aes_xts_cipher,
|
||||
NULL /* cleanup */,
|
||||
aes_xts_ctrl};
|
||||
.nid = NID_aes_256_xts,
|
||||
.block_size = 1,
|
||||
.key_len = 64 /* 2 AES-256 keys */,
|
||||
.iv_len = 16,
|
||||
.ctx_size = sizeof(EVP_AES_XTS_CTX),
|
||||
.flags = EVP_CIPH_XTS_MODE | EVP_CIPH_CUSTOM_IV |
|
||||
EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CTRL_INIT |
|
||||
EVP_CIPH_CUSTOM_COPY,
|
||||
.init = aes_xts_init_key,
|
||||
.cipher = aes_xts_cipher,
|
||||
.ctrl = aes_xts_ctrl};
|
||||
|
||||
const EVP_CIPHER *EVP_aes_256_xts(void) { return &aes_256_xts; }
|
||||
|
||||
Reference in New Issue
Block a user