Blame crypto/aes/aes_wrap.c

Packit c4476c
/*
Packit c4476c
 * Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
 *
Packit c4476c
 * Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
 * this file except in compliance with the License.  You can obtain a copy
Packit c4476c
 * in the file LICENSE in the source distribution or at
Packit c4476c
 * https://www.openssl.org/source/license.html
Packit c4476c
 */
Packit c4476c
Packit c4476c
#include "internal/cryptlib.h"
Packit c4476c
#include <openssl/aes.h>
Packit c4476c
#include <openssl/modes.h>
Packit c4476c
Packit c4476c
int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
Packit c4476c
                 unsigned char *out,
Packit c4476c
                 const unsigned char *in, unsigned int inlen)
Packit c4476c
{
Packit c4476c
    return CRYPTO_128_wrap(key, iv, out, in, inlen, (block128_f) AES_encrypt);
Packit c4476c
}
Packit c4476c
Packit c4476c
int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
Packit c4476c
                   unsigned char *out,
Packit c4476c
                   const unsigned char *in, unsigned int inlen)
Packit c4476c
{
Packit c4476c
    return CRYPTO_128_unwrap(key, iv, out, in, inlen,
Packit c4476c
                             (block128_f) AES_decrypt);
Packit c4476c
}