/* $OpenBSD: xform.c,v 1.16 2001/08/28 12:20:43 ben Exp $ */1/*-2* The authors of this code are John Ioannidis ([email protected]),3* Angelos D. Keromytis ([email protected]),4* Niels Provos ([email protected]) and5* Damien Miller ([email protected]).6*7* This code was written by John Ioannidis for BSD/OS in Athens, Greece,8* in November 1995.9*10* Ported to OpenBSD and NetBSD, with additional transforms, in December 1996,11* by Angelos D. Keromytis.12*13* Additional transforms and features in 1997 and 1998 by Angelos D. Keromytis14* and Niels Provos.15*16* Additional features in 1999 by Angelos D. Keromytis.17*18* AES XTS implementation in 2008 by Damien Miller19*20* Copyright (C) 1995, 1996, 1997, 1998, 1999 by John Ioannidis,21* Angelos D. Keromytis and Niels Provos.22*23* Copyright (C) 2001, Angelos D. Keromytis.24*25* Copyright (C) 2008, Damien Miller26* Copyright (c) 2014 The FreeBSD Foundation27* All rights reserved.28*29* Portions of this software were developed by John-Mark Gurney30* under sponsorship of the FreeBSD Foundation and31* Rubicon Communications, LLC (Netgate).32*33* Permission to use, copy, and modify this software with or without fee34* is hereby granted, provided that this entire notice is included in35* all copies of any software which is or includes a copy or36* modification of this software.37* You may use this code under the GNU public license if you so wish. Please38* contribute changes back to the authors under this freer than GPL license39* so that we may further the use of strong encryption without limitations to40* all.41*42* THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR43* IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY44* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE45* MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR46* PURPOSE.47*/4849#include <sys/cdefs.h>50#include <opencrypto/gmac.h>51#include <opencrypto/xform_auth.h>52#include <opencrypto/xform_enc.h>5354/* Encryption instances */55const struct enc_xform enc_xform_aes_nist_gmac = {56.type = CRYPTO_AES_NIST_GMAC,57.name = "AES-GMAC",58.blocksize = AES_ICM_BLOCK_LEN,59.ivsize = AES_GCM_IV_LEN,60.minkey = AES_MIN_KEY,61.maxkey = AES_MAX_KEY,62};6364/* Authentication instances */65const struct auth_hash auth_hash_nist_gmac_aes_128 = {66.type = CRYPTO_AES_NIST_GMAC,67.name = "GMAC-AES-128",68.keysize = AES_128_GMAC_KEY_LEN,69.hashsize = AES_GMAC_HASH_LEN,70.ctxsize = sizeof(struct aes_gmac_ctx),71.blocksize = GMAC_BLOCK_LEN,72.Init = AES_GMAC_Init,73.Setkey = AES_GMAC_Setkey,74.Reinit = AES_GMAC_Reinit,75.Update = AES_GMAC_Update,76.Final = AES_GMAC_Final,77};7879const struct auth_hash auth_hash_nist_gmac_aes_192 = {80.type = CRYPTO_AES_NIST_GMAC,81.name = "GMAC-AES-192",82.keysize = AES_192_GMAC_KEY_LEN,83.hashsize = AES_GMAC_HASH_LEN,84.ctxsize = sizeof(struct aes_gmac_ctx),85.blocksize = GMAC_BLOCK_LEN,86.Init = AES_GMAC_Init,87.Setkey = AES_GMAC_Setkey,88.Reinit = AES_GMAC_Reinit,89.Update = AES_GMAC_Update,90.Final = AES_GMAC_Final,91};9293const struct auth_hash auth_hash_nist_gmac_aes_256 = {94.type = CRYPTO_AES_NIST_GMAC,95.name = "GMAC-AES-256",96.keysize = AES_256_GMAC_KEY_LEN,97.hashsize = AES_GMAC_HASH_LEN,98.ctxsize = sizeof(struct aes_gmac_ctx),99.blocksize = GMAC_BLOCK_LEN,100.Init = AES_GMAC_Init,101.Setkey = AES_GMAC_Setkey,102.Reinit = AES_GMAC_Reinit,103.Update = AES_GMAC_Update,104.Final = AES_GMAC_Final,105};106107108