diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-11-22 10:31:06 -0800 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2012-11-22 10:31:06 -0800 |
commit | 07bb297329b9e9754d09dcb6d70417272a626619 (patch) | |
tree | c1bdcad5f080f8cfe2e876604177670061cdc101 /src/kw_aes_des.h | |
parent | f251dedaa31b48f7c05a4b53c112b40ebca890ef (diff) | |
download | xmlsec1-07bb297329b9e9754d09dcb6d70417272a626619.tar.gz xmlsec1-07bb297329b9e9754d09dcb6d70417272a626619.tar.bz2 xmlsec1-07bb297329b9e9754d09dcb6d70417272a626619.zip |
Imported Upstream version 1.2.14upstream/1.2.14
Diffstat (limited to 'src/kw_aes_des.h')
-rw-r--r-- | src/kw_aes_des.h | 148 |
1 files changed, 0 insertions, 148 deletions
diff --git a/src/kw_aes_des.h b/src/kw_aes_des.h deleted file mode 100644 index 46e85273..00000000 --- a/src/kw_aes_des.h +++ /dev/null @@ -1,148 +0,0 @@ -/** - * XMLSec library - * - * THIS IS A PRIVATE XMLSEC HEADER FILE - * DON'T USE IT IN YOUR APPLICATION - * - * Implementation of AES/DES Key Transport algorithm - * - * This is free software; see Copyright file in the source - * distribution for preciese wording. - * - * Copyright (C) 2010 Aleksey Sanin, All rights reserved. - */ -#ifndef __XMLSEC_KT_AES_DES_H__ -#define __XMLSEC_KT_AES_DES_H__ - -#ifndef XMLSEC_PRIVATE -#error "private.h file contains private xmlsec definitions and should not be used outside xmlsec or xmlsec-<crypto> libraries" -#endif /* XMLSEC_PRIVATE */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#ifndef XMLSEC_NO_DES -/******************************************************************** - * - * KT DES - * - ********************************************************************/ -#define XMLSEC_KW_DES3_KEY_LENGTH 24 -#define XMLSEC_KW_DES3_IV_LENGTH 8 -#define XMLSEC_KW_DES3_BLOCK_LENGTH 8 -#define XMLSEC_KW_DES3_SHA_DIGEST_LENGTH 20 - - -typedef int (*xmlSecKWDes3Sha1Method) (void * context, - const xmlSecByte * in, - xmlSecSize inSize, - xmlSecByte * out, - xmlSecSize outSize); -typedef int (*xmlSecKWDes3GenerateRandomMethod) (void * context, - xmlSecByte * out, - xmlSecSize outSize); -typedef int (*xmlSecKWDes3BlockEncryptMethod) (void * context, - const xmlSecByte * iv, - xmlSecSize ivSize, - const xmlSecByte * in, - xmlSecSize inSize, - xmlSecByte * out, - xmlSecSize outSize); -typedef int (*xmlSecKWDes3BlockDecryptMethod) (void * context, - const xmlSecByte * iv, - xmlSecSize ivSize, - const xmlSecByte * in, - xmlSecSize inSize, - xmlSecByte * out, - xmlSecSize outSize); - - -struct _xmlSecKWDes3Klass { - /* callbacks */ - xmlSecKWDes3GenerateRandomMethod generateRandom; - xmlSecKWDes3Sha1Method sha1; - xmlSecKWDes3BlockEncryptMethod encrypt; - xmlSecKWDes3BlockDecryptMethod decrypt; - - /* for the future */ - void* reserved0; - void* reserved1; -}; -typedef const struct _xmlSecKWDes3Klass xmlSecKWDes3Klass, - *xmlSecKWDes3Id; - -#define xmlSecKWDes3CheckId(id) \ - ( \ - ((id) != NULL) && \ - ((id)->generateRandom != NULL) && \ - ((id)->sha1 != NULL) && \ - ((id)->encrypt != NULL) && \ - ((id)->decrypt != NULL) \ - ) - -XMLSEC_EXPORT int -xmlSecKWDes3Encode(xmlSecKWDes3Id kwDes3Id, void *context, - const xmlSecByte *in, xmlSecSize inSize, - xmlSecByte *out, xmlSecSize outSize); - -XMLSEC_EXPORT int -xmlSecKWDes3Decode(xmlSecKWDes3Id kwDes3Id, void *context, - const xmlSecByte *in, xmlSecSize inSize, - xmlSecByte *out, xmlSecSize outSize); -#endif /* XMLSEC_NO_DES */ - -#ifndef XMLSEC_NO_AES -/******************************************************************** - * - * KT AES - * - ********************************************************************/ -#define XMLSEC_KW_AES_MAGIC_BLOCK_SIZE 8 -#define XMLSEC_KW_AES_BLOCK_SIZE 16 -#define XMLSEC_KW_AES128_KEY_SIZE 16 -#define XMLSEC_KW_AES192_KEY_SIZE 24 -#define XMLSEC_KW_AES256_KEY_SIZE 32 - -typedef int (*xmlSecKWAesBlockEncryptMethod) (const xmlSecByte * in, - xmlSecSize inSize, - xmlSecByte * out, - xmlSecSize outSize, - void * context); -typedef int (*xmlSecKWAesBlockDecryptMethod) (const xmlSecByte * in, - xmlSecSize inSize, - xmlSecByte * out, - xmlSecSize outSize, - void * context); - - -struct _xmlSecKWAesKlass { - /* callbacks */ - xmlSecKWAesBlockEncryptMethod encrypt; - xmlSecKWAesBlockDecryptMethod decrypt; - - /* for the future */ - void* reserved0; - void* reserved1; -}; -typedef const struct _xmlSecKWAesKlass xmlSecKWAesKlass, - *xmlSecKWAesId; - -XMLSEC_EXPORT int -xmlSecKWAesEncode(xmlSecKWAesId kwAesId, void *context, - const xmlSecByte *in, xmlSecSize inSize, - xmlSecByte *out, xmlSecSize outSize); - -XMLSEC_EXPORT int -xmlSecKWAesDecode(xmlSecKWAesId kwAesId, void *context, - const xmlSecByte *in, xmlSecSize inSize, - xmlSecByte *out, xmlSecSize outSize); - -#endif /* XMLSEC_NO_AES */ - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __XMLSEC_KT_AES_DES_H__ */ |