121259Swollman/* crypto/cmac/cmac.h */ 221259Swollman/* 321259Swollman * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 421259Swollman * project. 521259Swollman */ 621259Swollman/* ==================================================================== 721259Swollman * Copyright (c) 2010 The OpenSSL Project. All rights reserved. 821259Swollman * 921259Swollman * Redistribution and use in source and binary forms, with or without 1021259Swollman * modification, are permitted provided that the following conditions 1121259Swollman * are met: 1221259Swollman * 1321259Swollman * 1. Redistributions of source code must retain the above copyright 1421259Swollman * notice, this list of conditions and the following disclaimer. 1521259Swollman * 1621259Swollman * 2. Redistributions in binary form must reproduce the above copyright 1721259Swollman * notice, this list of conditions and the following disclaimer in 1821259Swollman * the documentation and/or other materials provided with the 1921259Swollman * distribution. 2021259Swollman * 2121259Swollman * 3. All advertising materials mentioning features or use of this 2221259Swollman * software must display the following acknowledgment: 2321259Swollman * "This product includes software developed by the OpenSSL Project 2421259Swollman * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 2521259Swollman * 2621259Swollman * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 2721259Swollman * endorse or promote products derived from this software without 2821259Swollman * prior written permission. For written permission, please contact 2921259Swollman * licensing@OpenSSL.org. 3050477Speter * 3121259Swollman * 5. Products derived from this software may not be called "OpenSSL" 3221259Swollman * nor may "OpenSSL" appear in their names without prior written 3321259Swollman * permission of the OpenSSL Project. 3421259Swollman * 3521259Swollman * 6. Redistributions of any form whatsoever must retain the following 3621259Swollman * acknowledgment: 3721259Swollman * "This product includes software developed by the OpenSSL Project 3821259Swollman * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 3921259Swollman * 4021259Swollman * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 4121259Swollman * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 4221259Swollman * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 4321259Swollman * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 4421259Swollman * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 4521259Swollman * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 4621259Swollman * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 4721259Swollman * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 4821259Swollman * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 4921259Swollman * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 5021259Swollman * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51108533Sschweikh * OF THE POSSIBILITY OF SUCH DAMAGE. 5221259Swollman * ==================================================================== 5321259Swollman */ 5421259Swollman 5521259Swollman#ifndef HEADER_CMAC_H 56108533Sschweikh# define HEADER_CMAC_H 5721259Swollman 5821259Swollman#ifdef __cplusplus 5921259Swollmanextern "C" { 6021259Swollman#endif 6121259Swollman 6221259Swollman# include <openssl/evp.h> 6321259Swollman 6421259Swollman/* Opaque */ 6521259Swollmantypedef struct CMAC_CTX_st CMAC_CTX; 6683366Sjulian 6721259SwollmanCMAC_CTX *CMAC_CTX_new(void); 6885074Sruvoid CMAC_CTX_cleanup(CMAC_CTX *ctx); 6921259Swollmanvoid CMAC_CTX_free(CMAC_CTX *ctx); 7021259SwollmanEVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx); 7121259Swollmanint CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in); 7221259Swollman 7321259Swollmanint CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen, 7421259Swollman const EVP_CIPHER *cipher, ENGINE *impl); 7569224Sjlemonint CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen); 7669152Sjlemonint CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen); 77126264Smlaierint CMAC_resume(CMAC_CTX *ctx); 7869224Sjlemon 7974914Sjhb#ifdef __cplusplus 8074914Sjhb} 8183130Sjlemon#endif 82132712Srwatson#endif 8369152Sjlemon