2015-01-22 03:40:55 +00:00
|
|
|
/*
|
2016-05-17 19:38:09 +00:00
|
|
|
* Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
|
2008-03-12 21:14:28 +00:00
|
|
|
*
|
2016-05-17 19:38:09 +00:00
|
|
|
* Licensed under the OpenSSL license (the "License"). You may not use
|
|
|
|
* this file except in compliance with the License. You can obtain a copy
|
|
|
|
* in the file LICENSE in the source distribution or at
|
|
|
|
* https://www.openssl.org/source/license.html
|
2008-03-12 21:14:28 +00:00
|
|
|
*/
|
|
|
|
|
2015-05-14 14:56:48 +00:00
|
|
|
#include "internal/cryptlib.h"
|
2008-03-12 21:14:28 +00:00
|
|
|
#include <openssl/aes.h>
|
2013-07-17 13:05:19 +00:00
|
|
|
#include <openssl/modes.h>
|
2008-03-18 01:00:38 +00:00
|
|
|
|
2008-03-12 21:14:28 +00:00
|
|
|
int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
|
2015-01-22 03:40:55 +00:00
|
|
|
unsigned char *out,
|
|
|
|
const unsigned char *in, unsigned int inlen)
|
|
|
|
{
|
|
|
|
return CRYPTO_128_wrap(key, iv, out, in, inlen, (block128_f) AES_encrypt);
|
|
|
|
}
|
2008-03-12 21:14:28 +00:00
|
|
|
|
|
|
|
int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
|
2015-01-22 03:40:55 +00:00
|
|
|
unsigned char *out,
|
|
|
|
const unsigned char *in, unsigned int inlen)
|
|
|
|
{
|
|
|
|
return CRYPTO_128_unwrap(key, iv, out, in, inlen,
|
|
|
|
(block128_f) AES_decrypt);
|
|
|
|
}
|