Go to the documentation of this file.
57 #include "../../internal.h"
62 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6,
72 if (in_len > INT_MAX - 8 || in_len < 16 || in_len % 8 != 0) {
84 size_t n = in_len / 8;
86 for (
unsigned j = 0; j <
kBound; j++) {
87 for (
size_t i = 1;
i <=
n;
i++) {
93 A[6] ^= (t >> 8) & 0xff;
94 A[5] ^= (t >> 16) & 0xff;
95 A[4] ^= (t >> 24) & 0xff;
101 return (
int)in_len + 8;
113 if (in_len > INT_MAX || in_len < 24 || in_len % 8 != 0) {
121 size_t n = (in_len / 8) - 1;
124 for (
size_t i =
n;
i > 0;
i--) {
127 A[6] ^= (t >> 8) & 0xff;
128 A[5] ^= (t >> 16) & 0xff;
129 A[4] ^= (t >> 24) & 0xff;
154 return (
int)in_len - 8;
162 size_t max_out,
const uint8_t *
in,
size_t in_len) {
166 const size_t padded_len = (in_len + 7) & ~7;
169 if (in_len == 0 || in_len64 > 0xffffffffu || in_len + 7 < in_len ||
170 padded_len + 8 < padded_len || max_out < padded_len + 8) {
176 memcpy(
block + 4, &in_len32_be,
sizeof(in_len32_be));
187 if (padded_in == NULL) {
190 assert(padded_len >= 8);
191 memset(padded_in + padded_len - 8, 0, 8);
203 size_t max_out,
const uint8_t *
in,
size_t in_len) {
218 assert(in_len % 8 == 0);
224 memcpy(&claimed_len32, iv + 4,
sizeof(claimed_len32));
230 for (
size_t i = in_len - 15;
i < in_len - 8;
i++) {
static const uint8_t kDefaultIV[]
return memset(p, 0, total)
int AES_wrap_key(const AES_KEY *key, const uint8_t *iv, uint8_t *out, const uint8_t *in, size_t in_len)
static crypto_word_t constant_time_is_zero_w(crypto_word_t a)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
int AES_wrap_key_padded(const AES_KEY *key, uint8_t *out, size_t *out_len, size_t max_out, const uint8_t *in, size_t in_len)
static uint32_t CRYPTO_bswap4(uint32_t x)
int AES_unwrap_key_padded(const AES_KEY *key, uint8_t *out, size_t *out_len, size_t max_out, const uint8_t *in, size_t in_len)
static int aes_unwrap_key_inner(const AES_KEY *key, uint8_t *out, uint8_t out_iv[8], const uint8_t *in, size_t in_len)
static const uint8_t kPaddingConstant[4]
unsigned __int64 uint64_t
static void * OPENSSL_memcpy(void *dst, const void *src, size_t n)
static uint8_t constant_time_ge_8(crypto_word_t a, crypto_word_t b)
UniquePtr< SSL_SESSION > ret
static void * OPENSSL_memmove(void *dst, const void *src, size_t n)
static crypto_word_t constant_time_eq_int(int a, int b)
static crypto_word_t constant_time_select_w(crypto_word_t mask, crypto_word_t a, crypto_word_t b)
static const unsigned kBound
static crypto_word_t constant_time_eq_w(crypto_word_t a, crypto_word_t b)
int AES_unwrap_key(const AES_KEY *key, const uint8_t *iv, uint8_t *out, const uint8_t *in, size_t in_len)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:14