libosmogsm
0.11.0-dirty
Osmocom GSM library
|
00001 00010 /* 00011 * Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi> 00012 * 00013 * This program is free software; you can redistribute it and/or modify 00014 * it under the terms of the GNU General Public License version 2 as 00015 * published by the Free Software Foundation. 00016 * 00017 * Alternatively, this software may be distributed under the terms of BSD 00018 * license. 00019 * 00020 * SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 00021 * 00022 * See README and COPYING for more details. 00023 */ 00024 00025 #pragma once 00026 00027 int __must_check aes_wrap(const u8 *kek, int n, const u8 *plain, u8 *cipher); 00028 int __must_check aes_unwrap(const u8 *kek, int n, const u8 *cipher, u8 *plain); 00029 int __must_check omac1_aes_128_vector(const u8 *key, size_t num_elem, 00030 const u8 *addr[], const size_t *len, 00031 u8 *mac); 00032 int __must_check omac1_aes_128(const u8 *key, const u8 *data, size_t data_len, 00033 u8 *mac); 00034 int __must_check aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out); 00035 int __must_check aes_128_ctr_encrypt(const u8 *key, const u8 *nonce, 00036 u8 *data, size_t data_len); 00037 int __must_check aes_128_eax_encrypt(const u8 *key, 00038 const u8 *nonce, size_t nonce_len, 00039 const u8 *hdr, size_t hdr_len, 00040 u8 *data, size_t data_len, u8 *tag); 00041 int __must_check aes_128_eax_decrypt(const u8 *key, 00042 const u8 *nonce, size_t nonce_len, 00043 const u8 *hdr, size_t hdr_len, 00044 u8 *data, size_t data_len, const u8 *tag); 00045 int __must_check aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data, 00046 size_t data_len); 00047 int __must_check aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data, 00048 size_t data_len);