KAME as of 2001/8/31
This commit is contained in:
parent
89c23ae51c
commit
9e9f5f3086
4
crypto/dist/kame/libipsec/ipsec_set_policy.3
vendored
4
crypto/dist/kame/libipsec/ipsec_set_policy.3
vendored
@ -1,4 +1,4 @@
|
||||
.\" $KAME: ipsec_set_policy.3,v 1.14 2001/04/06 07:00:46 itojun Exp $
|
||||
.\" $KAME: ipsec_set_policy.3,v 1.15 2001/08/17 07:21:36 itojun Exp $
|
||||
.\"
|
||||
.\" Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
|
||||
.\" All rights reserved.
|
||||
@ -61,6 +61,8 @@ of
|
||||
.Fa policy .
|
||||
.Fn ipsec_set_policy
|
||||
will return the buffer of IPsec policy specification structure.
|
||||
The buffer is dynamically allocated, and must be freed by the caller by calling
|
||||
.Xr free 3 .
|
||||
.Pp
|
||||
You may want the length of the generated buffer such when calling
|
||||
.Xr setsockopt 2 .
|
||||
|
5
crypto/dist/kame/libipsec/ipsec_strerror.3
vendored
5
crypto/dist/kame/libipsec/ipsec_strerror.3
vendored
@ -1,4 +1,4 @@
|
||||
.\" $KAME: ipsec_strerror.3,v 1.8 2000/11/20 00:35:14 sakane Exp $
|
||||
.\" $KAME: ipsec_strerror.3,v 1.9 2001/08/17 07:21:36 itojun Exp $
|
||||
.\"
|
||||
.\" Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
|
||||
.\" All rights reserved.
|
||||
@ -79,3 +79,6 @@ first appeared in WIDE/KAME IPv6 protocol stack kit.
|
||||
.Sh BUGS
|
||||
.Fn ipsec_strerror
|
||||
will return its result which may be overwritten by subsequent calls.
|
||||
.Pp
|
||||
.Va ipsec_errcode
|
||||
is not thread safe.
|
||||
|
12
crypto/dist/kame/racoon/Makefile.in
vendored
12
crypto/dist/kame/racoon/Makefile.in
vendored
@ -1,4 +1,4 @@
|
||||
# $KAME: Makefile.in,v 1.33 2001/06/01 10:12:55 sakane Exp $
|
||||
# $KAME: Makefile.in,v 1.35 2001/08/08 22:09:26 sakane Exp $
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir= @srcdir@
|
||||
@ -30,7 +30,7 @@ OBJS= main.o session.o isakmp.o handler.o random.o \
|
||||
policy.o localconf.o remoteconf.o crypto_openssl.o algorithm.o \
|
||||
proposal.o sainfo.o cfparse.o cftoken.o strnames.o \
|
||||
vmbuf.o plog.o logger.o schedule.o str2val.o misc.o sockmisc.o \
|
||||
safefile.o backupsa.o @LIBOBJS@
|
||||
safefile.o backupsa.o @LIBOBJS@ @CRYPTOBJS@
|
||||
# under samples
|
||||
CONF= psk.txt racoon.conf
|
||||
|
||||
@ -47,7 +47,7 @@ pfkey: dummy.o
|
||||
|
||||
eaytest: eaytest.o crypto_openssl_test.o misc_noplog.o vmbuf.o str2val.o
|
||||
$(CC) $(LDFLAGS) -o $@ eaytest.o crypto_openssl_test.o misc_noplog.o \
|
||||
vmbuf.o str2val.o $(LIBS)
|
||||
vmbuf.o str2val.o $(LIBS) @CRYPTOBJS@
|
||||
|
||||
# special object rules
|
||||
crypto_openssl_test.o: crypto_openssl.c
|
||||
@ -66,6 +66,12 @@ getaddrinfo.o: $(srcdir)/missing/getaddrinfo.c
|
||||
$(CC) $(CFLAGS) -c $(srcdir)/missing/$*.c
|
||||
getnameinfo.o: $(srcdir)/missing/getnameinfo.c
|
||||
$(CC) $(CFLAGS) -c $(srcdir)/missing/$*.c
|
||||
rijndael-api-fst.o: $(srcdir)/missing/crypto/rijndael/$*.c
|
||||
$(CC) $(CFLAGS) -c $(srcdir)/missing/crypto/rijndael/$*.c
|
||||
rijndael-alg-fst.o: $(srcdir)/missing/crypto/rijndael/$*.c
|
||||
$(CC) $(CFLAGS) -c $(srcdir)/missing/crypto/rijndael/$*.c
|
||||
sha2.o: $(srcdir)/missing/crypto/sha2/$*.c
|
||||
$(CC) $(CFLAGS) -c $(srcdir)/missing/crypto/sha2/$*.c
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
|
734
crypto/dist/kame/racoon/algorithm.c
vendored
734
crypto/dist/kame/racoon/algorithm.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: algorithm.c,v 1.14 2001/04/03 15:51:54 thorpej Exp $ */
|
||||
/* $KAME: algorithm.c,v 1.20 2001/08/16 06:17:12 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -39,6 +39,8 @@
|
||||
#include "plog.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include "crypto_openssl.h"
|
||||
#include "dhgroup.h"
|
||||
#include "algorithm.h"
|
||||
#include "oakley.h"
|
||||
#include "isakmp_var.h"
|
||||
@ -46,70 +48,625 @@
|
||||
#include "ipsec_doi.h"
|
||||
#include "gcmalloc.h"
|
||||
|
||||
static const int ipsecenc2doi[] = {
|
||||
ALGTYPE_NOTHING,
|
||||
IPSECDOI_ESP_DES_IV64,
|
||||
IPSECDOI_ESP_DES,
|
||||
IPSECDOI_ESP_3DES,
|
||||
IPSECDOI_ESP_RC5,
|
||||
IPSECDOI_ESP_IDEA,
|
||||
IPSECDOI_ESP_CAST,
|
||||
IPSECDOI_ESP_BLOWFISH,
|
||||
IPSECDOI_ESP_3IDEA,
|
||||
IPSECDOI_ESP_DES_IV32,
|
||||
IPSECDOI_ESP_RC4,
|
||||
IPSECDOI_ESP_NULL,
|
||||
IPSECDOI_ESP_RIJNDAEL,
|
||||
IPSECDOI_ESP_TWOFISH,
|
||||
static struct hash_algorithm oakley_hashdef[] = {
|
||||
{ "md5", algtype_md5, OAKLEY_ATTR_HASH_ALG_MD5,
|
||||
eay_md5_init, eay_md5_update,
|
||||
eay_md5_final, eay_md5_hashlen,
|
||||
eay_md5_one, },
|
||||
{ "sha1", algtype_sha1, OAKLEY_ATTR_HASH_ALG_SHA,
|
||||
eay_sha1_init, eay_sha1_update,
|
||||
eay_sha1_final, eay_sha1_hashlen,
|
||||
eay_sha1_one, },
|
||||
{ "sha2_256", algtype_sha2_256, OAKLEY_ATTR_HASH_ALG_SHA2_256,
|
||||
eay_sha2_256_init, eay_sha2_256_update,
|
||||
eay_sha2_256_final, eay_sha2_256_hashlen,
|
||||
eay_sha1_one, },
|
||||
{ "sha2_384", algtype_sha2_384, OAKLEY_ATTR_HASH_ALG_SHA2_384,
|
||||
eay_sha2_384_init, eay_sha2_384_update,
|
||||
eay_sha2_384_final, eay_sha2_384_hashlen,
|
||||
eay_sha1_one, },
|
||||
{ "sha2_512", algtype_sha2_512, OAKLEY_ATTR_HASH_ALG_SHA2_512,
|
||||
eay_sha2_512_init, eay_sha2_512_update,
|
||||
eay_sha2_512_final, eay_sha2_512_hashlen,
|
||||
eay_sha1_one, },
|
||||
};
|
||||
static const int ipsecauth2doi[] = {
|
||||
ALGTYPE_NOTHING,
|
||||
IPSECDOI_ATTR_AUTH_HMAC_MD5,
|
||||
IPSECDOI_ATTR_AUTH_HMAC_SHA1,
|
||||
IPSECDOI_ATTR_AUTH_DES_MAC,
|
||||
IPSECDOI_ATTR_AUTH_KPDK,
|
||||
IPSECDOI_ATTR_AUTH_NONE,
|
||||
|
||||
static struct hmac_algorithm oakley_hmacdef[] = {
|
||||
{ "hmac_md5", algtype_md5, OAKLEY_ATTR_HASH_ALG_MD5,
|
||||
eay_hmacmd5_init, eay_hmacmd5_update,
|
||||
eay_hmacmd5_final, NULL,
|
||||
eay_hmacmd5_one, },
|
||||
{ "hmac_sha1", algtype_sha1, OAKLEY_ATTR_HASH_ALG_SHA,
|
||||
eay_hmacsha1_init, eay_hmacsha1_update,
|
||||
eay_hmacsha1_final, NULL,
|
||||
eay_hmacsha1_one, },
|
||||
{ "hmac_sha2_256", algtype_sha2_256, OAKLEY_ATTR_HASH_ALG_SHA2_256,
|
||||
eay_hmacsha2_256_init, eay_hmacsha2_256_update,
|
||||
eay_hmacsha2_256_final, NULL,
|
||||
eay_hmacsha2_256_one, },
|
||||
{ "hmac_sha2_384", algtype_sha2_384, OAKLEY_ATTR_HASH_ALG_SHA2_384,
|
||||
eay_hmacsha2_384_init, eay_hmacsha2_384_update,
|
||||
eay_hmacsha2_384_final, NULL,
|
||||
eay_hmacsha2_384_one, },
|
||||
{ "hmac_sha2_512", algtype_sha2_512, OAKLEY_ATTR_HASH_ALG_SHA2_512,
|
||||
eay_hmacsha2_512_init, eay_hmacsha2_512_update,
|
||||
eay_hmacsha2_512_final, NULL,
|
||||
eay_hmacsha2_512_one, },
|
||||
};
|
||||
static const int ipseccomp2doi[] = {
|
||||
ALGTYPE_NOTHING,
|
||||
IPSECDOI_IPCOMP_OUI,
|
||||
IPSECDOI_IPCOMP_DEFLATE,
|
||||
IPSECDOI_IPCOMP_LZS,
|
||||
|
||||
static struct enc_algorithm oakley_encdef[] = {
|
||||
{ "des", algtype_des, OAKLEY_ATTR_ENC_ALG_DES, 8,
|
||||
eay_des_encrypt, eay_des_decrypt,
|
||||
eay_des_weakkey, eay_des_keylen, },
|
||||
#ifdef HAVE_OPENSSL_IDEA_H
|
||||
{ "idea", algtype_idea, OAKLEY_ATTR_ENC_ALG_IDEA, 8,
|
||||
eay_idea_encrypt, eay_idea_decrypt,
|
||||
eay_idea_weakkey, eay_idea_keylen, },
|
||||
#endif
|
||||
{ "blowfish", algtype_blowfish, OAKLEY_ATTR_ENC_ALG_BLOWFISH, 8,
|
||||
eay_bf_encrypt, eay_bf_decrypt,
|
||||
eay_bf_weakkey, eay_bf_keylen, },
|
||||
#ifdef HAVE_OPENSSL_RC5_H
|
||||
{ "rc5", algtype_rc5, OAKLEY_ATTR_ENC_ALG_RC5, 8,
|
||||
eay_rc5_encrypt, eay_rc5_decrypt,
|
||||
eay_rc5_weakkey, eay_rc5_keylen, },
|
||||
#endif
|
||||
{ "3des", algtype_3des, OAKLEY_ATTR_ENC_ALG_3DES, 8,
|
||||
eay_3des_encrypt, eay_3des_decrypt,
|
||||
eay_3des_weakkey, eay_3des_keylen, },
|
||||
{ "cast", algtype_cast128, OAKLEY_ATTR_ENC_ALG_CAST, 8,
|
||||
eay_cast_encrypt, eay_cast_decrypt,
|
||||
eay_cast_weakkey, eay_cast_keylen, },
|
||||
{ "aes", algtype_rijndael, OAKLEY_ATTR_ENC_ALG_AES, 16,
|
||||
eay_aes_encrypt, eay_aes_decrypt,
|
||||
eay_aes_weakkey, eay_aes_keylen, },
|
||||
};
|
||||
static const int isakmpenc2doi[] = {
|
||||
ALGTYPE_NOTHING,
|
||||
-1,
|
||||
OAKLEY_ATTR_ENC_ALG_DES,
|
||||
OAKLEY_ATTR_ENC_ALG_3DES,
|
||||
OAKLEY_ATTR_ENC_ALG_RC5,
|
||||
OAKLEY_ATTR_ENC_ALG_IDEA,
|
||||
OAKLEY_ATTR_ENC_ALG_CAST,
|
||||
OAKLEY_ATTR_ENC_ALG_BLOWFISH,
|
||||
|
||||
static struct enc_algorithm ipsec_encdef[] = {
|
||||
{ "des-iv64", algtype_des_iv64, IPSECDOI_ESP_DES_IV64, 8,
|
||||
NULL, NULL,
|
||||
NULL, eay_des_keylen, },
|
||||
{ "des", algtype_des, IPSECDOI_ESP_DES, 8,
|
||||
NULL, NULL,
|
||||
NULL, eay_des_keylen, },
|
||||
{ "3des", algtype_3des, IPSECDOI_ESP_3DES, 8,
|
||||
NULL, NULL,
|
||||
NULL, eay_3des_keylen, },
|
||||
#ifdef HAVE_OPENSSL_RC5_H
|
||||
{ "rc5", algtype_rc5, IPSECDOI_ESP_RC5, 8,
|
||||
NULL, NULL,
|
||||
NULL, eay_rc5_keylen, },
|
||||
#endif
|
||||
{ "cast", algtype_cast128, IPSECDOI_ESP_CAST, 8,
|
||||
NULL, NULL,
|
||||
NULL, eay_cast_keylen, },
|
||||
{ "blowfish", algtype_blowfish, IPSECDOI_ESP_BLOWFISH, 8,
|
||||
NULL, NULL,
|
||||
NULL, eay_bf_keylen, },
|
||||
{ "des-iv32", algtype_des_iv32, IPSECDOI_ESP_DES_IV32, 8,
|
||||
NULL, NULL,
|
||||
NULL, eay_des_keylen, },
|
||||
{ "null", algtype_null_enc, IPSECDOI_ESP_NULL, 8,
|
||||
NULL, NULL,
|
||||
NULL, eay_3des_keylen, },
|
||||
{ "rijndael", algtype_rijndael, IPSECDOI_ESP_RIJNDAEL, 16,
|
||||
NULL, NULL,
|
||||
NULL, eay_aes_keylen, },
|
||||
{ "twofish", algtype_twofish, IPSECDOI_ESP_TWOFISH, 16,
|
||||
NULL, NULL,
|
||||
NULL, eay_twofish_keylen, },
|
||||
#ifdef HAVE_OPENSSL_IDEA_H
|
||||
{ "3idea", algtype_3idea, IPSECDOI_ESP_3IDEA, 8,
|
||||
NULL, NULL,
|
||||
NULL, NULL, },
|
||||
{ "idea", algtype_idea, IPSECDOI_ESP_IDEA, 8,
|
||||
NULL, NULL,
|
||||
NULL, NULL, },
|
||||
#endif
|
||||
{ "rc4", algtype_rc4, IPSECDOI_ESP_RC4, 8,
|
||||
NULL, NULL,
|
||||
NULL, NULL, },
|
||||
};
|
||||
static const int isakmphash2doi[] = {
|
||||
ALGTYPE_NOTHING,
|
||||
OAKLEY_ATTR_HASH_ALG_MD5,
|
||||
OAKLEY_ATTR_HASH_ALG_SHA,
|
||||
OAKLEY_ATTR_HASH_ALG_TIGER,
|
||||
|
||||
static struct hmac_algorithm ipsec_hmacdef[] = {
|
||||
{ "md5", algtype_hmac_md5, IPSECDOI_ATTR_AUTH_HMAC_MD5,
|
||||
NULL, NULL,
|
||||
NULL, eay_md5_hashlen,
|
||||
NULL, },
|
||||
{ "sha1", algtype_hmac_sha1, IPSECDOI_ATTR_AUTH_HMAC_SHA1,
|
||||
NULL, NULL,
|
||||
NULL, eay_sha1_hashlen,
|
||||
NULL, },
|
||||
{ "kpdk", algtype_kpdk, IPSECDOI_ATTR_AUTH_KPDK,
|
||||
NULL, NULL,
|
||||
NULL, eay_kpdk_hashlen,
|
||||
NULL, },
|
||||
{ "null", algtype_non_auth, IPSECDOI_ATTR_AUTH_NONE,
|
||||
NULL, NULL,
|
||||
NULL, eay_null_hashlen,
|
||||
NULL, },
|
||||
{ "hmac_sha2_256", algtype_hmac_sha2_256, IPSECDOI_ATTR_SHA2_256,
|
||||
NULL, NULL,
|
||||
NULL, eay_sha2_256_hashlen,
|
||||
NULL, },
|
||||
{ "hmac_sha2_384", algtype_hmac_sha2_384, IPSECDOI_ATTR_SHA2_384,
|
||||
NULL, NULL,
|
||||
NULL, eay_sha2_384_hashlen,
|
||||
NULL, },
|
||||
{ "hmac_sha2_512", algtype_hmac_sha2_512, IPSECDOI_ATTR_SHA2_512,
|
||||
NULL, NULL,
|
||||
NULL, eay_sha2_512_hashlen,
|
||||
NULL, },
|
||||
};
|
||||
static const int isakmpameth2doi[] = {
|
||||
ALGTYPE_NOTHING,
|
||||
OAKLEY_ATTR_AUTH_METHOD_PSKEY,
|
||||
OAKLEY_ATTR_AUTH_METHOD_DSSSIG,
|
||||
OAKLEY_ATTR_AUTH_METHOD_RSASIG,
|
||||
OAKLEY_ATTR_AUTH_METHOD_RSAENC,
|
||||
OAKLEY_ATTR_AUTH_METHOD_RSAREV,
|
||||
OAKLEY_ATTR_AUTH_METHOD_GSSAPI_KRB,
|
||||
|
||||
static struct misc_algorithm ipsec_compdef[] = {
|
||||
{ "oui", algtype_oui, IPSECDOI_IPCOMP_OUI, },
|
||||
{ "deflate", algtype_deflate, IPSECDOI_IPCOMP_DEFLATE, },
|
||||
{ "lzs", algtype_lzs, IPSECDOI_IPCOMP_LZS, },
|
||||
};
|
||||
static const int isakmpdh2doi[] = {
|
||||
ALGTYPE_NOTHING,
|
||||
OAKLEY_ATTR_GRP_DESC_MODP768,
|
||||
OAKLEY_ATTR_GRP_DESC_MODP1024,
|
||||
OAKLEY_ATTR_GRP_DESC_EC2N155,
|
||||
OAKLEY_ATTR_GRP_DESC_EC2N185,
|
||||
OAKLEY_ATTR_GRP_DESC_MODP1536,
|
||||
|
||||
static struct misc_algorithm oakley_authdef[] = {
|
||||
{ "psk", algtype_psk, OAKLEY_ATTR_AUTH_METHOD_PSKEY, },
|
||||
{ "dsssig", algtype_dsssig, OAKLEY_ATTR_AUTH_METHOD_DSSSIG, },
|
||||
{ "rsasig", algtype_rsasig, OAKLEY_ATTR_AUTH_METHOD_RSASIG, },
|
||||
{ "rsaenc", algtype_rsaenc, OAKLEY_ATTR_AUTH_METHOD_RSAENC, },
|
||||
{ "rsarev", algtype_rsarev, OAKLEY_ATTR_AUTH_METHOD_RSAREV, },
|
||||
{ "gssapi_krb", algtype_gssapikrb, OAKLEY_ATTR_AUTH_METHOD_GSSAPI_KRB, },
|
||||
};
|
||||
|
||||
static struct dh_algorithm oakley_dhdef[] = {
|
||||
{ "modp768", algtype_modp768, OAKLEY_ATTR_GRP_DESC_MODP768,
|
||||
&dh_modp768, },
|
||||
{ "modp1024", algtype_modp1024, OAKLEY_ATTR_GRP_DESC_MODP1024,
|
||||
&dh_modp1024, },
|
||||
{ "modp1536", algtype_modp1536, OAKLEY_ATTR_GRP_DESC_MODP1536,
|
||||
&dh_modp1536, },
|
||||
{ "modp2048", algtype_modp2048, OAKLEY_ATTR_GRP_DESC_MODP2048,
|
||||
&dh_modp2048, },
|
||||
{ "modp3072", algtype_modp3072, OAKLEY_ATTR_GRP_DESC_MODP3072,
|
||||
&dh_modp3072, },
|
||||
{ "modp4096", algtype_modp4096, OAKLEY_ATTR_GRP_DESC_MODP4096,
|
||||
&dh_modp4096, },
|
||||
{ "modp8192", algtype_modp8192, OAKLEY_ATTR_GRP_DESC_MODP8192,
|
||||
&dh_modp8192, },
|
||||
};
|
||||
|
||||
static struct hash_algorithm *alg_oakley_hashdef __P((int));
|
||||
static struct hmac_algorithm *alg_oakley_hmacdef __P((int));
|
||||
static struct enc_algorithm *alg_oakley_encdef __P((int));
|
||||
static struct enc_algorithm *alg_ipsec_encdef __P((int));
|
||||
static struct hmac_algorithm *alg_ipsec_hmacdef __P((int));
|
||||
static struct dh_algorithm *alg_oakley_dhdef __P((int));
|
||||
|
||||
/* oakley hash algorithm */
|
||||
static struct hash_algorithm *
|
||||
alg_oakley_hashdef(doi)
|
||||
int doi;
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAYLEN(oakley_hashdef); i++)
|
||||
if (doi == oakley_hashdef[i].doi) {
|
||||
plog(LLV_DEBUG, LOCATION, NULL, "hash(%s)\n",
|
||||
oakley_hashdef[i].name);
|
||||
return &oakley_hashdef[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
alg_oakley_hashdef_ok(doi)
|
||||
int doi;
|
||||
{
|
||||
struct hash_algorithm *f;
|
||||
|
||||
f = alg_oakley_hashdef(doi);
|
||||
if (f == NULL)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
alg_oakley_hashdef_doi(type)
|
||||
int type;
|
||||
{
|
||||
int i, res = -1;
|
||||
|
||||
for (i = 0; i < ARRAYLEN(oakley_hashdef); i++)
|
||||
if (type == oakley_hashdef[i].type) {
|
||||
res = oakley_hashdef[i].doi;
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int
|
||||
alg_oakley_hashdef_hashlen(doi)
|
||||
int doi;
|
||||
{
|
||||
struct hash_algorithm *f;
|
||||
|
||||
f = alg_oakley_hashdef(doi);
|
||||
if (f == NULL || f->hashlen == NULL)
|
||||
return NULL;
|
||||
|
||||
return (f->hashlen)();
|
||||
}
|
||||
|
||||
vchar_t *
|
||||
alg_oakley_hashdef_one(doi, buf)
|
||||
int doi;
|
||||
vchar_t *buf;
|
||||
{
|
||||
struct hash_algorithm *f;
|
||||
|
||||
f = alg_oakley_hashdef(doi);
|
||||
if (f == NULL || f->hashlen == NULL)
|
||||
return NULL;
|
||||
|
||||
return (f->one)(buf);
|
||||
}
|
||||
|
||||
/* oakley hmac algorithm */
|
||||
static struct hmac_algorithm *
|
||||
alg_oakley_hmacdef(doi)
|
||||
int doi;
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAYLEN(oakley_hmacdef); i++)
|
||||
if (doi == oakley_hmacdef[i].doi) {
|
||||
plog(LLV_DEBUG, LOCATION, NULL, "hmac(%s)\n",
|
||||
oakley_hmacdef[i].name);
|
||||
return &oakley_hmacdef[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
alg_oakley_hmacdef_doi(type)
|
||||
int type;
|
||||
{
|
||||
int i, res = -1;
|
||||
|
||||
for (i = 0; i < ARRAYLEN(oakley_hmacdef); i++)
|
||||
if (type == oakley_hmacdef[i].type) {
|
||||
res = oakley_hmacdef[i].doi;
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
vchar_t *
|
||||
alg_oakley_hmacdef_one(doi, key, buf)
|
||||
int doi;
|
||||
vchar_t *key, *buf;
|
||||
{
|
||||
struct hmac_algorithm *f;
|
||||
vchar_t *res;
|
||||
#ifdef ENABLE_STATS
|
||||
struct timeval start, end;
|
||||
#endif
|
||||
|
||||
f = alg_oakley_hmacdef(doi);
|
||||
if (f == NULL || f->one == NULL)
|
||||
return NULL;
|
||||
|
||||
#ifdef ENABLE_STATS
|
||||
gettimeofday(&start, NULL);
|
||||
#endif
|
||||
|
||||
res = (f->one)(key, buf);
|
||||
|
||||
#ifdef ENABLE_STATS
|
||||
gettimeofday(&end, NULL);
|
||||
syslog(LOG_NOTICE, "%s(%s size=%d): %8.6f", __FUNCTION__,
|
||||
f->name, buf->l, timedelta(&start, &end));
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/* oakley encryption algorithm */
|
||||
static struct enc_algorithm *
|
||||
alg_oakley_encdef(doi)
|
||||
int doi;
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAYLEN(oakley_encdef); i++)
|
||||
if (doi == oakley_encdef[i].doi) {
|
||||
plog(LLV_DEBUG, LOCATION, NULL, "encription(%s)\n",
|
||||
oakley_encdef[i].name);
|
||||
return &oakley_encdef[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
alg_oakley_encdef_ok(doi)
|
||||
int doi;
|
||||
{
|
||||
struct enc_algorithm *f;
|
||||
|
||||
f = alg_oakley_encdef(doi);
|
||||
if (f == NULL)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
alg_oakley_encdef_doi(type)
|
||||
int type;
|
||||
{
|
||||
int i, res = -1;
|
||||
|
||||
for (i = 0; i < ARRAYLEN(oakley_encdef); i++)
|
||||
if (type == oakley_encdef[i].type) {
|
||||
res = oakley_encdef[i].doi;
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int
|
||||
alg_oakley_encdef_keylen(doi, len)
|
||||
int doi, len;
|
||||
{
|
||||
struct enc_algorithm *f;
|
||||
|
||||
f = alg_oakley_encdef(doi);
|
||||
if (f == NULL || f->keylen == NULL)
|
||||
return -1;
|
||||
|
||||
return (f->keylen)(len);
|
||||
}
|
||||
|
||||
int
|
||||
alg_oakley_encdef_blocklen(doi)
|
||||
int doi;
|
||||
{
|
||||
struct enc_algorithm *f;
|
||||
|
||||
f = alg_oakley_encdef(doi);
|
||||
if (f == NULL)
|
||||
return -1;
|
||||
|
||||
return f->blocklen;
|
||||
}
|
||||
|
||||
vchar_t *
|
||||
alg_oakley_encdef_decrypt(doi, buf, key, iv)
|
||||
int doi;
|
||||
vchar_t *buf, *key, *iv;
|
||||
{
|
||||
vchar_t *res;
|
||||
struct enc_algorithm *f;
|
||||
#ifdef ENABLE_STATS
|
||||
struct timeval start, end;
|
||||
#endif
|
||||
|
||||
f = alg_oakley_encdef(doi);
|
||||
if (f == NULL || f->decrypt == NULL)
|
||||
return NULL;
|
||||
|
||||
#ifdef ENABLE_STATS
|
||||
gettimeofday(&start, NULL);
|
||||
#endif
|
||||
|
||||
res = (f->decrypt)(buf, key, iv);
|
||||
|
||||
#ifdef ENABLE_STATS
|
||||
gettimeofday(&end, NULL);
|
||||
syslog(LOG_NOTICE, "%s(%s size=%d): %8.6f", __FUNCTION__,
|
||||
f->name, buf->l, timedelta(&start, &end));
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
vchar_t *
|
||||
alg_oakley_encdef_encrypt(doi, buf, key, iv)
|
||||
int doi;
|
||||
vchar_t *buf, *key, *iv;
|
||||
{
|
||||
vchar_t *res;
|
||||
struct enc_algorithm *f;
|
||||
#ifdef ENABLE_STATS
|
||||
struct timeval start, end;
|
||||
#endif
|
||||
|
||||
f = alg_oakley_encdef(doi);
|
||||
if (f == NULL || f->encrypt == NULL)
|
||||
return NULL;
|
||||
|
||||
#ifdef ENABLE_STATS
|
||||
gettimeofday(&start, NULL);
|
||||
#endif
|
||||
|
||||
res = (f->encrypt)(buf, key, iv);
|
||||
|
||||
#ifdef ENABLE_STATS
|
||||
gettimeofday(&end, NULL);
|
||||
syslog(LOG_NOTICE, "%s(%s size=%d): %8.6f", __FUNCTION__,
|
||||
f->name, buf->l, timedelta(&start, &end));
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
/* ipsec encryption algorithm */
|
||||
static struct enc_algorithm *
|
||||
alg_ipsec_encdef(doi)
|
||||
int doi;
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAYLEN(ipsec_encdef); i++)
|
||||
if (doi == ipsec_encdef[i].doi) {
|
||||
plog(LLV_DEBUG, LOCATION, NULL, "encription(%s)\n",
|
||||
ipsec_encdef[i].name);
|
||||
return &ipsec_encdef[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
alg_ipsec_encdef_doi(type)
|
||||
int type;
|
||||
{
|
||||
int i, res = -1;
|
||||
|
||||
for (i = 0; i < ARRAYLEN(ipsec_encdef); i++)
|
||||
if (type == ipsec_encdef[i].type) {
|
||||
res = ipsec_encdef[i].doi;
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int
|
||||
alg_ipsec_encdef_keylen(doi, len)
|
||||
int doi, len;
|
||||
{
|
||||
struct enc_algorithm *f;
|
||||
|
||||
f = alg_ipsec_encdef(doi);
|
||||
if (f == NULL || f->keylen == NULL)
|
||||
return -1;
|
||||
|
||||
return (f->keylen)(len);
|
||||
}
|
||||
|
||||
/* ipsec hmac algorithm */
|
||||
static struct hmac_algorithm *
|
||||
alg_ipsec_hmacdef(doi)
|
||||
int doi;
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAYLEN(ipsec_hmacdef); i++)
|
||||
if (doi == ipsec_hmacdef[i].doi) {
|
||||
plog(LLV_DEBUG, LOCATION, NULL, "hmac(%s)\n",
|
||||
oakley_hmacdef[i].name);
|
||||
return &ipsec_hmacdef[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
alg_ipsec_hmacdef_doi(type)
|
||||
int type;
|
||||
{
|
||||
int i, res = -1;
|
||||
|
||||
for (i = 0; i < ARRAYLEN(ipsec_hmacdef); i++)
|
||||
if (type == ipsec_hmacdef[i].type) {
|
||||
res = ipsec_hmacdef[i].doi;
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int
|
||||
alg_ipsec_hmacdef_hashlen(doi)
|
||||
int doi;
|
||||
{
|
||||
struct hmac_algorithm *f;
|
||||
|
||||
f = alg_ipsec_hmacdef(doi);
|
||||
if (f == NULL || f->hashlen == NULL)
|
||||
return -1;
|
||||
|
||||
return (f->hashlen)();
|
||||
}
|
||||
|
||||
/* ip compression */
|
||||
int
|
||||
alg_ipsec_compdef_doi(type)
|
||||
int type;
|
||||
{
|
||||
int i, res = -1;
|
||||
|
||||
for (i = 0; i < ARRAYLEN(ipsec_compdef); i++)
|
||||
if (type == ipsec_compdef[i].type) {
|
||||
res = ipsec_compdef[i].doi;
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/* dh algorithm */
|
||||
static struct dh_algorithm *
|
||||
alg_oakley_dhdef(doi)
|
||||
int doi;
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAYLEN(oakley_dhdef); i++)
|
||||
if (doi == oakley_dhdef[i].doi) {
|
||||
plog(LLV_DEBUG, LOCATION, NULL, "hmac(%s)\n",
|
||||
oakley_dhdef[i].name);
|
||||
return &oakley_dhdef[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
alg_oakley_dhdef_ok(doi)
|
||||
int doi;
|
||||
{
|
||||
struct dh_algorithm *f;
|
||||
|
||||
f = alg_oakley_dhdef(doi);
|
||||
if (f == NULL)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
alg_oakley_dhdef_doi(type)
|
||||
int type;
|
||||
{
|
||||
int i, res = -1;
|
||||
|
||||
for (i = 0; i < ARRAYLEN(oakley_dhdef); i++)
|
||||
if (type == oakley_dhdef[i].type) {
|
||||
res = oakley_dhdef[i].doi;
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
struct dhgroup *
|
||||
alg_oakley_dhdef_group(doi)
|
||||
int doi;
|
||||
{
|
||||
struct dh_algorithm *f;
|
||||
|
||||
f = alg_oakley_dhdef(doi);
|
||||
if (f == NULL || f->dhgroup == NULL)
|
||||
return NULL;
|
||||
|
||||
return f->dhgroup;
|
||||
}
|
||||
|
||||
/* authentication method */
|
||||
int
|
||||
alg_oakley_authdef_doi(type)
|
||||
int type;
|
||||
{
|
||||
int i, res = -1;
|
||||
|
||||
for (i = 0; i < ARRAYLEN(oakley_authdef); i++)
|
||||
if (type == oakley_authdef[i].type) {
|
||||
res = oakley_authdef[i].doi;
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* give the default key length
|
||||
* OUT: -1: NG
|
||||
@ -227,37 +784,32 @@ int
|
||||
algtype2doi(class, type)
|
||||
int class, type;
|
||||
{
|
||||
int res = -1;
|
||||
|
||||
switch (class) {
|
||||
case algclass_ipsec_enc:
|
||||
if (ARRAYLEN(ipsecenc2doi) > type)
|
||||
return ipsecenc2doi[type];
|
||||
res = alg_ipsec_encdef_doi(type);
|
||||
break;
|
||||
case algclass_ipsec_auth:
|
||||
if (ARRAYLEN(ipsecauth2doi) > type)
|
||||
return ipsecauth2doi[type];
|
||||
res = alg_ipsec_hmacdef_doi(type);
|
||||
break;
|
||||
case algclass_ipsec_comp:
|
||||
if (ARRAYLEN(ipseccomp2doi) > type)
|
||||
return ipseccomp2doi[type];
|
||||
res = alg_ipsec_compdef_doi(type);
|
||||
break;
|
||||
case algclass_isakmp_enc:
|
||||
if (ARRAYLEN(isakmpenc2doi) > type)
|
||||
return isakmpenc2doi[type];
|
||||
res = alg_oakley_encdef_doi(type);
|
||||
break;
|
||||
case algclass_isakmp_hash:
|
||||
if (ARRAYLEN(isakmphash2doi) > type)
|
||||
return isakmphash2doi[type];
|
||||
res = alg_oakley_hashdef_doi(type);
|
||||
break;
|
||||
case algclass_isakmp_dh:
|
||||
if (ARRAYLEN(isakmpdh2doi) > type)
|
||||
return isakmpdh2doi[type];
|
||||
res = alg_oakley_dhdef_doi(type);
|
||||
break;
|
||||
case algclass_isakmp_ameth:
|
||||
if (ARRAYLEN(isakmpameth2doi) > type)
|
||||
return isakmpameth2doi[type];
|
||||
res = alg_oakley_authdef_doi(type);
|
||||
break;
|
||||
}
|
||||
return -1;
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -290,41 +842,3 @@ algclass2doi(class)
|
||||
/*NOTREACHED*/
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct algorithm_strength **
|
||||
initalgstrength()
|
||||
{
|
||||
struct algorithm_strength **new;
|
||||
int i;
|
||||
|
||||
new = racoon_calloc(1, MAXALGCLASS * sizeof(*new));
|
||||
if (new == NULL) {
|
||||
plog(LLV_ERROR, LOCATION, NULL,
|
||||
"failed to get buffer.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAXALGCLASS; i++) {
|
||||
new[i] = racoon_calloc(1, sizeof(*new[i]));
|
||||
if (new[i] == NULL) {
|
||||
plog(LLV_ERROR, LOCATION, NULL,
|
||||
"failed to get buffer.\n");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return new;
|
||||
}
|
||||
|
||||
void
|
||||
flushalgstrength(head)
|
||||
struct algorithm_strength **head;
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAXALGCLASS; i++)
|
||||
if (head[i])
|
||||
racoon_free(head[i]);
|
||||
|
||||
racoon_free(head);
|
||||
}
|
||||
|
169
crypto/dist/kame/racoon/algorithm.h
vendored
169
crypto/dist/kame/racoon/algorithm.h
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: algorithm.h,v 1.12 2001/03/21 22:38:29 sakane Exp $ */
|
||||
/* $KAME: algorithm.h,v 1.19 2001/08/16 06:17:12 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -29,22 +29,6 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* algorithm strength */
|
||||
enum {
|
||||
algstrength_ehigh,
|
||||
algstrength_high,
|
||||
algstrength_normal,
|
||||
#define MAXALGSTRENGTH 3
|
||||
};
|
||||
|
||||
struct algorithm_strength {
|
||||
/*
|
||||
* algorithm type N is mapped to 1 << (N - 1).
|
||||
* N of 0 is not encoded, that is, it means nothing.
|
||||
*/
|
||||
u_int32_t algtype[MAXALGSTRENGTH];
|
||||
};
|
||||
|
||||
/* algorithm class */
|
||||
enum {
|
||||
algclass_ipsec_enc,
|
||||
@ -63,51 +47,144 @@ enum {
|
||||
|
||||
/* algorithm type */
|
||||
enum {
|
||||
/* enc */
|
||||
algtype_nothing = 0,
|
||||
algtype_des_iv64, algtype_des, algtype_3des,
|
||||
algtype_rc5, algtype_idea, algtype_cast128, algtype_blowfish,
|
||||
algtype_3idea, algtype_des_iv32, algtype_rc4, algtype_null_enc,
|
||||
algtype_rijndael, algtype_twofish,
|
||||
};
|
||||
|
||||
enum {
|
||||
/* enc */
|
||||
algtype_des_iv64,
|
||||
algtype_des,
|
||||
algtype_3des,
|
||||
algtype_rc5,
|
||||
algtype_idea,
|
||||
algtype_cast128,
|
||||
algtype_blowfish,
|
||||
algtype_3idea,
|
||||
algtype_des_iv32,
|
||||
algtype_rc4,
|
||||
algtype_null_enc,
|
||||
algtype_rijndael,
|
||||
algtype_twofish,
|
||||
|
||||
/* ipsec auth */
|
||||
/* 0 is defined as algtype_nothing above. */
|
||||
algtype_hmac_md5 = 1, algtype_hmac_sha1, algtype_des_mac, algtype_kpdk,
|
||||
algtype_hmac_md5,
|
||||
algtype_hmac_sha1,
|
||||
algtype_des_mac,
|
||||
algtype_kpdk,
|
||||
algtype_non_auth,
|
||||
};
|
||||
algtype_hmac_sha2_256,
|
||||
algtype_hmac_sha2_384,
|
||||
algtype_hmac_sha2_512,
|
||||
|
||||
enum {
|
||||
/* ipcomp */
|
||||
/* 0 is defined as algtype_nothing above. */
|
||||
algtype_oui = 1, algtype_deflate, algtype_lzs,
|
||||
};
|
||||
algtype_oui,
|
||||
algtype_deflate,
|
||||
algtype_lzs,
|
||||
|
||||
enum {
|
||||
/* hash */
|
||||
/* 0 is defined as algtype_nothing above. */
|
||||
algtype_md5 = 1, algtype_sha1, algtype_tiger,
|
||||
};
|
||||
algtype_md5,
|
||||
algtype_sha1,
|
||||
algtype_tiger,
|
||||
algtype_sha2_256,
|
||||
algtype_sha2_384,
|
||||
algtype_sha2_512,
|
||||
|
||||
enum {
|
||||
/* dh_group */
|
||||
/* 0 is defined as algtype_nothing above. */
|
||||
algtype_modp768 = 1, algtype_modp1024,
|
||||
algtype_ec2n155, algtype_ec2n185,
|
||||
algtype_modp768,
|
||||
algtype_modp1024,
|
||||
algtype_ec2n155,
|
||||
algtype_ec2n185,
|
||||
algtype_modp1536,
|
||||
algtype_modp2048,
|
||||
algtype_modp3072,
|
||||
algtype_modp4096,
|
||||
algtype_modp8192,
|
||||
|
||||
/* authentication method. */
|
||||
algtype_psk,
|
||||
algtype_dsssig,
|
||||
algtype_rsasig,
|
||||
algtype_rsaenc,
|
||||
algtype_rsarev,
|
||||
algtype_gssapikrb
|
||||
};
|
||||
|
||||
enum {
|
||||
/* authentication method. */
|
||||
/* 0 is defined as algtype_nothing above. */
|
||||
algtype_psk = 1, algtype_dsssig, algtype_rsasig,
|
||||
algtype_rsaenc, algtype_rsarev, algtype_gssapikrb
|
||||
struct hmac_algorithm {
|
||||
char *name;
|
||||
int type;
|
||||
int doi;
|
||||
caddr_t (*init) __P((vchar_t *));
|
||||
void (*update) __P((caddr_t, vchar_t *));
|
||||
vchar_t *(*final) __P((caddr_t));
|
||||
int (*hashlen) __P((void));
|
||||
vchar_t *(*one) __P((vchar_t *, vchar_t *));
|
||||
};
|
||||
|
||||
struct hash_algorithm {
|
||||
char *name;
|
||||
int type;
|
||||
int doi;
|
||||
caddr_t (*init) __P((void));
|
||||
void (*update) __P((caddr_t, vchar_t *));
|
||||
vchar_t *(*final) __P((caddr_t));
|
||||
int (*hashlen) __P((void));
|
||||
vchar_t *(*one) __P((vchar_t *));
|
||||
};
|
||||
|
||||
struct enc_algorithm {
|
||||
char *name;
|
||||
int type;
|
||||
int doi;
|
||||
int blocklen;
|
||||
vchar_t *(*encrypt) __P((vchar_t *, vchar_t *, vchar_t *));
|
||||
vchar_t *(*decrypt) __P((vchar_t *, vchar_t *, vchar_t *));
|
||||
int (*weakkey) __P((vchar_t *));
|
||||
int (*keylen) __P((int));
|
||||
};
|
||||
|
||||
/* dh group */
|
||||
struct dh_algorithm {
|
||||
char *name;
|
||||
int type;
|
||||
int doi;
|
||||
struct dhgroup *dhgroup;
|
||||
};
|
||||
|
||||
/* ipcomp, auth meth, dh group */
|
||||
struct misc_algorithm {
|
||||
char *name;
|
||||
int type;
|
||||
int doi;
|
||||
};
|
||||
|
||||
extern int alg_oakley_hashdef_ok __P((int));
|
||||
extern int alg_oakley_hashdef_doi __P((int));
|
||||
extern int alg_oakley_hashdef_hashlen __P((int));
|
||||
extern vchar_t *alg_oakley_hashdef_one __P((int, vchar_t *));
|
||||
|
||||
extern int alg_oakley_hmacdef_doi __P((int));
|
||||
extern vchar_t *alg_oakley_hmacdef_one __P((int, vchar_t *, vchar_t *));
|
||||
|
||||
extern int alg_oakley_encdef_ok __P((int));
|
||||
extern int alg_oakley_encdef_doi __P((int));
|
||||
extern int alg_oakley_encdef_keylen __P((int, int));
|
||||
extern int alg_oakley_encdef_blocklen __P((int));
|
||||
extern vchar_t *alg_oakley_encdef_decrypt __P((int, vchar_t *, vchar_t *, vchar_t *));
|
||||
extern vchar_t *alg_oakley_encdef_encrypt __P((int, vchar_t *, vchar_t *, vchar_t *));
|
||||
|
||||
extern int alg_ipsec_encdef_doi __P((int));
|
||||
extern int alg_ipsec_encdef_keylen __P((int, int));
|
||||
|
||||
extern int alg_ipsec_hmacdef_doi __P((int));
|
||||
extern int alg_ipsec_hmacdef_hashlen __P((int));
|
||||
|
||||
extern int alg_ipsec_compdef_doi __P((int));
|
||||
|
||||
extern int alg_oakley_dhdef_doi __P((int));
|
||||
extern int alg_oakley_dhdef_ok __P((int));
|
||||
extern struct dhgroup *alg_oakley_dhdef_group __P((int));
|
||||
|
||||
extern int alg_oakley_authdef_doi __P((int));
|
||||
|
||||
extern int default_keylen __P((int, int));
|
||||
extern int check_keylen __P((int, int, int));
|
||||
extern int algtype2doi __P((int, int));
|
||||
extern int algclass2doi __P((int));
|
||||
extern struct algorithm_strength **initalgstrength __P((void));
|
||||
extern void flushalgstrength __P((struct algorithm_strength **));
|
||||
|
220
crypto/dist/kame/racoon/client-puzzle.c
vendored
Normal file
220
crypto/dist/kame/racoon/client-puzzle.c
vendored
Normal file
@ -0,0 +1,220 @@
|
||||
#include <sys/types.h>
|
||||
#include <openssl/sha.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "vmbuf.h"
|
||||
|
||||
vchar_t *mdx __P((const vchar_t *, int));
|
||||
void plusone __P((u_char *, int));
|
||||
int islzero __P((char *, int));
|
||||
|
||||
#ifdef DEBUG
|
||||
#include <sys/time.h>
|
||||
double stats;
|
||||
double timedelta __P((struct timeval *, struct timeval *));
|
||||
double
|
||||
timedelta(t1, t2)
|
||||
struct timeval *t1, *t2;
|
||||
{
|
||||
if (t2->tv_usec >= t1->tv_usec)
|
||||
return t2->tv_sec - t1->tv_sec +
|
||||
(double)(t2->tv_usec - t1->tv_usec) / 1000000;
|
||||
|
||||
return t2->tv_sec - t1->tv_sec - 1 +
|
||||
(double)(1000000 + t2->tv_usec - t1->tv_usec) / 1000000;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
int
|
||||
main(ac, av)
|
||||
int ac;
|
||||
char **av;
|
||||
{
|
||||
int k = 0, n = 1;
|
||||
int datalen = 16; /*XXX*/
|
||||
vchar_t *data, *res;
|
||||
int i, j;
|
||||
|
||||
switch (ac) {
|
||||
default:
|
||||
case 3:
|
||||
n = atoi(*(av + 2));
|
||||
case 2:
|
||||
k = atoi(*(av + 1));
|
||||
break;
|
||||
case 1:
|
||||
printf("Usage: client-puzzle (size) (times)\n");
|
||||
printf("\tsize : the length of MSB to be zero.\n");
|
||||
printf("\ttimes: the number of times of testing.\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
data = vmalloc(16); /*XXX*/
|
||||
if (data == NULL)
|
||||
return -1;
|
||||
|
||||
srandom(time(NULL));
|
||||
for (i = 0; i < n; i++) {
|
||||
for (j = 0; j < datalen; j++)
|
||||
data->v[j] = (char)random();
|
||||
|
||||
res = mdx((const vchar_t *)data, k);
|
||||
if (res == NULL)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
vchar_t *
|
||||
mdx(data, k)
|
||||
const vchar_t *data;
|
||||
int k;
|
||||
{
|
||||
SHA_CTX c;
|
||||
vchar_t *sub, *res;
|
||||
u_long n, max = ~0;
|
||||
int last;
|
||||
|
||||
sub = vmalloc(SHA_DIGEST_LENGTH);
|
||||
if (sub == NULL)
|
||||
return NULL;
|
||||
|
||||
/*XXX how many length should be allocated ?*/
|
||||
res = vmalloc(SHA_DIGEST_LENGTH);
|
||||
if (res == NULL)
|
||||
return NULL;
|
||||
memset(res->v, 0, res->l);
|
||||
|
||||
last = res->l - 1;
|
||||
for (n = 0; n < max; n ++) {
|
||||
|
||||
if (n & 1)
|
||||
res->v[last] |= 1;
|
||||
|
||||
#ifdef DEBUG
|
||||
{
|
||||
struct timeval start, end;
|
||||
gettimeofday(&start, NULL);
|
||||
#endif
|
||||
SHA1_Init(&c);
|
||||
SHA1_Update((SHA_CTX *)&c, data->v, data->l);
|
||||
SHA1_Update((SHA_CTX *)&c, res->v, res->l);
|
||||
SHA1_Final(sub->v, (SHA_CTX *)&c);
|
||||
#ifdef DEBUG
|
||||
gettimeofday(&end, NULL);
|
||||
stats += timedelta(&start, &end);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (islzero(sub->v, k))
|
||||
goto found;
|
||||
if (n & 1) {
|
||||
#ifdef DEBUG2
|
||||
if (n > 0xfffff0) {
|
||||
int j;
|
||||
for (j = 0; j < res->l; j++)
|
||||
printf("%02x", (u_char)res->v[j]);
|
||||
printf("\n");
|
||||
}
|
||||
#endif
|
||||
plusone(res->v, res->l);
|
||||
#ifdef DEBUG2
|
||||
if (n > 0xfffff0) {
|
||||
int j;
|
||||
for (j = 0; j < res->l; j++)
|
||||
printf("%02x", (u_char)res->v[j]);
|
||||
printf("\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
found:
|
||||
#ifdef DEBUG
|
||||
if (n != max)
|
||||
{
|
||||
#ifdef DEBUG2
|
||||
int i;
|
||||
printf("dat=");
|
||||
for (i = 0; i < data->l; i++)
|
||||
printf("%02x", (u_char)(data->v[i] & 0xff));
|
||||
printf("\n");
|
||||
printf("sub=");
|
||||
for (i = 0; i < sub->l; i++)
|
||||
printf("%02x", (u_char)(sub->v[i] & 0xff));
|
||||
printf("\n");
|
||||
printf("res=");
|
||||
for (i = 0; i < res->l; i++)
|
||||
printf("%02x", (u_char)(res->v[i] & 0xff));
|
||||
printf("\n");
|
||||
#endif
|
||||
printf("k=%d\tn=%ld\ttotal=%9.6f(s)\tavg=%9.6f(s)\n",
|
||||
k, n + 1, stats, stats/(n + 1));
|
||||
}
|
||||
#endif
|
||||
vfree(sub);
|
||||
|
||||
return n == max ? NULL : res;
|
||||
}
|
||||
|
||||
/*
|
||||
* d: pointer of the data.
|
||||
* l: the length of bytes.
|
||||
*/
|
||||
void
|
||||
plusone(d, l)
|
||||
u_char *d;
|
||||
int l;
|
||||
{
|
||||
int carry = 0;
|
||||
int i;
|
||||
|
||||
if (l == 0)
|
||||
return;
|
||||
|
||||
if (d[l - 1] == 0xff)
|
||||
carry = 1;
|
||||
d[l - 1]++;
|
||||
|
||||
if (carry && l > 1) {
|
||||
carry = 0;
|
||||
for (i = l - 2; i >= 0; i--) {
|
||||
if (d[i] == 0xff)
|
||||
carry = 1;
|
||||
d[i]++;
|
||||
if (!carry)
|
||||
break;
|
||||
carry = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* d: pointer of the data.
|
||||
* k: the length of most significant bits to be zero.
|
||||
* return value:
|
||||
* 1: match.
|
||||
* 0: not match.
|
||||
*/
|
||||
int
|
||||
islzero(d, k)
|
||||
char *d;
|
||||
int k;
|
||||
{
|
||||
while (k >= 8) {
|
||||
if (*d++ != 0)
|
||||
return 0;
|
||||
k -= 8;
|
||||
}
|
||||
|
||||
if (k > 0) {
|
||||
if (*d != (0xff >> k))
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
417
crypto/dist/kame/racoon/configure
vendored
417
crypto/dist/kame/racoon/configure
vendored
File diff suppressed because it is too large
Load Diff
24
crypto/dist/kame/racoon/configure.in
vendored
24
crypto/dist/kame/racoon/configure.in
vendored
@ -426,6 +426,9 @@ if test "x$crypto_dir" = "x"; then
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
else
|
||||
LIBS="$LIBS -L${crypto_dir}/lib"
|
||||
CFLAGS="-I${crypto_dir}/include $CFLAGS"
|
||||
fi
|
||||
if test "x$krb5_incdir" = "x"; then
|
||||
case $host_os in
|
||||
@ -604,6 +607,7 @@ if test "$liblwres_dir" != "no"; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
AC_CHECK_FUNCS(getrrsetbyname)
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
@ -629,6 +633,20 @@ if test $signing = "yes"; then
|
||||
fi
|
||||
AC_CHECK_HEADERS(openssl/cversion.h openssl/opensslv.h)
|
||||
|
||||
dnl checking rijndael
|
||||
AC_SUBST(CRYPTOBJS)
|
||||
AC_CHECK_HEADER(openssl/rijndael.h, [], [
|
||||
CPPFLAGS="$CPPFLAGS -I./missing"
|
||||
CRYPTOBJS="$CRYPTOBJS rijndael-api-fst.o rijndael-alg-fst.o"
|
||||
])
|
||||
|
||||
dnl checking sha2
|
||||
AC_SUBST(CRYPTOBJS)
|
||||
AC_CHECK_HEADER(openssl/sha2.h, [], [
|
||||
CPPFLAGS="$CPPFLAGS -I./missing"
|
||||
CRYPTOBJS="$CRYPTOBJS sha2.o"
|
||||
])
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_TYPE_PID_T
|
||||
@ -658,7 +676,9 @@ AC_CHECK_FUNCS(getifaddrs)
|
||||
dnl defines package version
|
||||
AC_MSG_CHECKING(if --with-pkgversion option is specified)
|
||||
AC_ARG_WITH(pkgversion, [ --with-pkgversion=VERSION specify package version],
|
||||
[CPPFLAGS="$CPPFLAGS -DRACOON_PKG_VERSION=\"\\\"$withval\\\"\""],
|
||||
[pkgversion=no])
|
||||
[AC_MSG_RESULT($withval)
|
||||
CPPFLAGS="$CPPFLAGS -DRACOON_PKG_VERSION=\"\\\"$withval\\\"\""],
|
||||
[AC_MSG_RESULT(no)
|
||||
pkgversion=no])
|
||||
|
||||
AC_OUTPUT(Makefile samples/psk.txt samples/racoon.conf)
|
||||
|
77
crypto/dist/kame/racoon/crypto_openssl.h
vendored
77
crypto/dist/kame/racoon/crypto_openssl.h
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: crypto_openssl.h,v 1.19 2001/07/11 13:17:53 sakane Exp $ */
|
||||
/* $KAME: crypto_openssl.h,v 1.23 2001/08/14 12:26:06 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -62,36 +62,66 @@ extern char *eay_strerror __P((void));
|
||||
extern void eay_init_error __P((void));
|
||||
|
||||
/* DES */
|
||||
extern vchar_t *eay_des_encrypt __P((vchar_t *, vchar_t *key, caddr_t));
|
||||
extern vchar_t *eay_des_decrypt __P((vchar_t *, vchar_t *key, caddr_t));
|
||||
extern vchar_t *eay_des_encrypt __P((vchar_t *, vchar_t *, vchar_t *));
|
||||
extern vchar_t *eay_des_decrypt __P((vchar_t *, vchar_t *, vchar_t *));
|
||||
extern int eay_des_weakkey __P((vchar_t *));
|
||||
extern int eay_des_keylen __P((int));
|
||||
|
||||
/* IDEA */
|
||||
extern vchar_t *eay_idea_encrypt __P((vchar_t *, vchar_t *key, caddr_t));
|
||||
extern vchar_t *eay_idea_decrypt __P((vchar_t *, vchar_t *key, caddr_t));
|
||||
extern vchar_t *eay_idea_encrypt __P((vchar_t *, vchar_t *, vchar_t *));
|
||||
extern vchar_t *eay_idea_decrypt __P((vchar_t *, vchar_t *, vchar_t *));
|
||||
extern int eay_idea_weakkey __P((vchar_t *));
|
||||
extern int eay_idea_keylen __P((int));
|
||||
|
||||
/* blowfish */
|
||||
extern vchar_t *eay_bf_encrypt __P((vchar_t *, vchar_t *, caddr_t));
|
||||
extern vchar_t *eay_bf_decrypt __P((vchar_t *, vchar_t *, caddr_t));
|
||||
extern vchar_t *eay_bf_encrypt __P((vchar_t *, vchar_t *, vchar_t *));
|
||||
extern vchar_t *eay_bf_decrypt __P((vchar_t *, vchar_t *, vchar_t *));
|
||||
extern int eay_bf_weakkey __P((vchar_t *));
|
||||
extern int eay_bf_keylen __P((int));
|
||||
|
||||
/* RC5 */
|
||||
extern vchar_t *eay_rc5_encrypt __P((vchar_t *, vchar_t *, caddr_t));
|
||||
extern vchar_t *eay_rc5_decrypt __P((vchar_t *, vchar_t *, caddr_t));
|
||||
extern vchar_t *eay_rc5_encrypt __P((vchar_t *, vchar_t *, vchar_t *));
|
||||
extern vchar_t *eay_rc5_decrypt __P((vchar_t *, vchar_t *, vchar_t *));
|
||||
extern int eay_rc5_weakkey __P((vchar_t *));
|
||||
extern int eay_rc5_keylen __P((int));
|
||||
|
||||
/* 3DES */
|
||||
extern vchar_t *eay_3des_encrypt __P((vchar_t *, vchar_t *, caddr_t));
|
||||
extern vchar_t *eay_3des_decrypt __P((vchar_t *, vchar_t *, caddr_t));
|
||||
extern vchar_t *eay_3des_encrypt __P((vchar_t *, vchar_t *, vchar_t *));
|
||||
extern vchar_t *eay_3des_decrypt __P((vchar_t *, vchar_t *, vchar_t *));
|
||||
extern int eay_3des_weakkey __P((vchar_t *));
|
||||
extern int eay_3des_keylen __P((int));
|
||||
|
||||
/* CAST */
|
||||
extern vchar_t *eay_cast_encrypt __P((vchar_t *, vchar_t *, caddr_t));
|
||||
extern vchar_t *eay_cast_decrypt __P((vchar_t *, vchar_t *, caddr_t));
|
||||
extern vchar_t *eay_cast_encrypt __P((vchar_t *, vchar_t *, vchar_t *));
|
||||
extern vchar_t *eay_cast_decrypt __P((vchar_t *, vchar_t *, vchar_t *));
|
||||
extern int eay_cast_weakkey __P((vchar_t *));
|
||||
extern int eay_cast_keylen __P((int));
|
||||
|
||||
/* AES(RIJNDAEL) */
|
||||
extern vchar_t *eay_aes_encrypt __P((vchar_t *, vchar_t *, vchar_t *));
|
||||
extern vchar_t *eay_aes_decrypt __P((vchar_t *, vchar_t *, vchar_t *));
|
||||
extern int eay_aes_weakkey __P((vchar_t *));
|
||||
extern int eay_aes_keylen __P((int));
|
||||
|
||||
/* misc */
|
||||
extern int eay_null_hashlen __P((void));
|
||||
extern int eay_kpdk_hashlen __P((void));
|
||||
extern int eay_twofish_keylen __P((int));
|
||||
|
||||
/* hash */
|
||||
/* HMAC SHA2 */
|
||||
extern vchar_t *eay_hmacsha2_512_one __P((vchar_t *, vchar_t *));
|
||||
extern caddr_t eay_hmacsha2_512_init __P((vchar_t *));
|
||||
extern void eay_hmacsha2_512_update __P((caddr_t, vchar_t *));
|
||||
extern vchar_t *eay_hmacsha2_512_final __P((caddr_t));
|
||||
extern vchar_t *eay_hmacsha2_384_one __P((vchar_t *, vchar_t *));
|
||||
extern caddr_t eay_hmacsha2_384_init __P((vchar_t *));
|
||||
extern void eay_hmacsha2_384_update __P((caddr_t, vchar_t *));
|
||||
extern vchar_t *eay_hmacsha2_384_final __P((caddr_t));
|
||||
extern vchar_t *eay_hmacsha2_256_one __P((vchar_t *, vchar_t *));
|
||||
extern caddr_t eay_hmacsha2_256_init __P((vchar_t *));
|
||||
extern void eay_hmacsha2_256_update __P((caddr_t, vchar_t *));
|
||||
extern vchar_t *eay_hmacsha2_256_final __P((caddr_t));
|
||||
/* HMAC SHA1 */
|
||||
extern vchar_t *eay_hmacsha1_one __P((vchar_t *, vchar_t *));
|
||||
extern caddr_t eay_hmacsha1_init __P((vchar_t *));
|
||||
@ -103,17 +133,38 @@ extern caddr_t eay_hmacmd5_init __P((vchar_t *));
|
||||
extern void eay_hmacmd5_update __P((caddr_t, vchar_t *));
|
||||
extern vchar_t *eay_hmacmd5_final __P((caddr_t));
|
||||
|
||||
/* SHA2 functions */
|
||||
extern caddr_t eay_sha2_512_init __P((void));
|
||||
extern void eay_sha2_512_update __P((caddr_t, vchar_t *));
|
||||
extern vchar_t *eay_sha2_512_final __P((caddr_t));
|
||||
extern vchar_t *eay_sha2_512_one __P((vchar_t *));
|
||||
extern int eay_sha2_512_hashlen __P((void));
|
||||
|
||||
extern caddr_t eay_sha2_384_init __P((void));
|
||||
extern void eay_sha2_384_update __P((caddr_t, vchar_t *));
|
||||
extern vchar_t *eay_sha2_384_final __P((caddr_t));
|
||||
extern vchar_t *eay_sha2_384_one __P((vchar_t *));
|
||||
extern int eay_sha2_384_hashlen __P((void));
|
||||
|
||||
extern caddr_t eay_sha2_256_init __P((void));
|
||||
extern void eay_sha2_256_update __P((caddr_t, vchar_t *));
|
||||
extern vchar_t *eay_sha2_256_final __P((caddr_t));
|
||||
extern vchar_t *eay_sha2_256_one __P((vchar_t *));
|
||||
extern int eay_sha2_256_hashlen __P((void));
|
||||
|
||||
/* SHA functions */
|
||||
extern caddr_t eay_sha1_init __P((void));
|
||||
extern void eay_sha1_update __P((caddr_t, vchar_t *));
|
||||
extern vchar_t *eay_sha1_final __P((caddr_t));
|
||||
extern vchar_t *eay_sha1_one __P((vchar_t *));
|
||||
extern int eay_sha1_hashlen __P((void));
|
||||
|
||||
/* MD5 functions */
|
||||
extern caddr_t eay_md5_init __P((void));
|
||||
extern void eay_md5_update __P((caddr_t, vchar_t *));
|
||||
extern vchar_t *eay_md5_final __P((caddr_t));
|
||||
extern vchar_t *eay_md5_one __P((vchar_t *));
|
||||
extern int eay_md5_hashlen __P((void));
|
||||
|
||||
/* eay_set_random */
|
||||
extern vchar_t *eay_set_random __P((u_int32_t));
|
||||
|
163
crypto/dist/kame/racoon/dhgroup.h
vendored
Normal file
163
crypto/dist/kame/racoon/dhgroup.h
vendored
Normal file
@ -0,0 +1,163 @@
|
||||
/* $KAME: dhgroup.h,v 1.1 2001/08/14 15:00:47 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the project nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#define OAKLEY_PRIME_MODP768 \
|
||||
"FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1" \
|
||||
"29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD" \
|
||||
"EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245" \
|
||||
"E485B576 625E7EC6 F44C42E9 A63A3620 FFFFFFFF FFFFFFFF"
|
||||
|
||||
#define OAKLEY_PRIME_MODP1024 \
|
||||
"FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1" \
|
||||
"29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD" \
|
||||
"EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245" \
|
||||
"E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED" \
|
||||
"EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE65381" \
|
||||
"FFFFFFFF FFFFFFFF"
|
||||
|
||||
#define OAKLEY_PRIME_MODP1536 \
|
||||
"FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1" \
|
||||
"29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD" \
|
||||
"EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245" \
|
||||
"E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED" \
|
||||
"EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE45B3D" \
|
||||
"C2007CB8 A163BF05 98DA4836 1C55D39A 69163FA8 FD24CF5F" \
|
||||
"83655D23 DCA3AD96 1C62F356 208552BB 9ED52907 7096966D" \
|
||||
"670C354E 4ABC9804 F1746C08 CA237327 FFFFFFFF FFFFFFFF"
|
||||
|
||||
/* draft-ietf-ipsec-ike-modp-groups-01.txt */
|
||||
#define OAKLEY_PRIME_MODP2048 \
|
||||
"FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1" \
|
||||
"29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD" \
|
||||
"EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245" \
|
||||
"E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED" \
|
||||
"EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE45B3D" \
|
||||
"C2007CB8 A163BF05 98DA4836 1C55D39A 69163FA8 FD24CF5F" \
|
||||
"83655D23 DCA3AD96 1C62F356 208552BB 9ED52907 7096966D" \
|
||||
"670C354E 4ABC9804 F1746C08 CA18217C 32905E46 2E36CE3B" \
|
||||
"E39E772C 180E8603 9B2783A2 EC07A28F B5C55DF0 6F4C52C9" \
|
||||
"DE2BCBF6 95581718 3995497C EA956AE5 15D22618 98FA0510" \
|
||||
"15728E5A 8AACAA68 FFFFFFFF FFFFFFFF"
|
||||
|
||||
#define OAKLEY_PRIME_MODP3072 \
|
||||
"FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1" \
|
||||
"29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD" \
|
||||
"EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245" \
|
||||
"E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED" \
|
||||
"EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE45B3D" \
|
||||
"C2007CB8 A163BF05 98DA4836 1C55D39A 69163FA8 FD24CF5F" \
|
||||
"83655D23 DCA3AD96 1C62F356 208552BB 9ED52907 7096966D" \
|
||||
"670C354E 4ABC9804 F1746C08 CA18217C 32905E46 2E36CE3B" \
|
||||
"E39E772C 180E8603 9B2783A2 EC07A28F B5C55DF0 6F4C52C9" \
|
||||
"DE2BCBF6 95581718 3995497C EA956AE5 15D22618 98FA0510" \
|
||||
"15728E5A 8AAAC42D AD33170D 04507A33 A85521AB DF1CBA64" \
|
||||
"ECFB8504 58DBEF0A 8AEA7157 5D060C7D B3970F85 A6E1E4C7" \
|
||||
"ABF5AE8C DB0933D7 1E8C94E0 4A25619D CEE3D226 1AD2EE6B" \
|
||||
"F12FFA06 D98A0864 D8760273 3EC86A64 521F2B18 177B200C" \
|
||||
"BBE11757 7A615D6C 770988C0 BAD946E2 08E24FA0 74E5AB31" \
|
||||
"43DB5BFC E0FD108E 4B82D120 A93AD2CA FFFFFFFF FFFFFFFF"
|
||||
|
||||
#define OAKLEY_PRIME_MODP4096 \
|
||||
"FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1" \
|
||||
"29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD" \
|
||||
"EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245" \
|
||||
"E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED" \
|
||||
"EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE45B3D" \
|
||||
"C2007CB8 A163BF05 98DA4836 1C55D39A 69163FA8 FD24CF5F" \
|
||||
"83655D23 DCA3AD96 1C62F356 208552BB 9ED52907 7096966D" \
|
||||
"670C354E 4ABC9804 F1746C08 CA18217C 32905E46 2E36CE3B" \
|
||||
"E39E772C 180E8603 9B2783A2 EC07A28F B5C55DF0 6F4C52C9" \
|
||||
"DE2BCBF6 95581718 3995497C EA956AE5 15D22618 98FA0510" \
|
||||
"15728E5A 8AAAC42D AD33170D 04507A33 A85521AB DF1CBA64" \
|
||||
"ECFB8504 58DBEF0A 8AEA7157 5D060C7D B3970F85 A6E1E4C7" \
|
||||
"ABF5AE8C DB0933D7 1E8C94E0 4A25619D CEE3D226 1AD2EE6B" \
|
||||
"F12FFA06 D98A0864 D8760273 3EC86A64 521F2B18 177B200C" \
|
||||
"BBE11757 7A615D6C 770988C0 BAD946E2 08E24FA0 74E5AB31" \
|
||||
"43DB5BFC E0FD108E 4B82D120 A9210801 1A723C12 A787E6D7" \
|
||||
"88719A10 BDBA5B26 99C32718 6AF4E23C 1A946834 B6150BDA" \
|
||||
"2583E9CA 2AD44CE8 DBBBC2DB 04DE8EF9 2E8EFC14 1FBECAA6" \
|
||||
"287C5947 4E6BC05D 99B2964F A090C3A2 233BA186 515BE7ED" \
|
||||
"1F612970 CEE2D7AF B81BDD76 2170481C D0069127 D5B05AA9" \
|
||||
"93B4EA98 8D8FDDC1 86FFB7DC 90A6C08F 4DF435C9 34063199" \
|
||||
"FFFFFFFF FFFFFFFF"
|
||||
|
||||
#define OAKLEY_PRIME_MODP8192 \
|
||||
"FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1" \
|
||||
"29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD" \
|
||||
"EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245" \
|
||||
"E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED" \
|
||||
"EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE45B3D" \
|
||||
"C2007CB8 A163BF05 98DA4836 1C55D39A 69163FA8 FD24CF5F" \
|
||||
"83655D23 DCA3AD96 1C62F356 208552BB 9ED52907 7096966D" \
|
||||
"670C354E 4ABC9804 F1746C08 CA18217C 32905E46 2E36CE3B" \
|
||||
"E39E772C 180E8603 9B2783A2 EC07A28F B5C55DF0 6F4C52C9" \
|
||||
"DE2BCBF6 95581718 3995497C EA956AE5 15D22618 98FA0510" \
|
||||
"15728E5A 8AAAC42D AD33170D 04507A33 A85521AB DF1CBA64" \
|
||||
"ECFB8504 58DBEF0A 8AEA7157 5D060C7D B3970F85 A6E1E4C7" \
|
||||
"ABF5AE8C DB0933D7 1E8C94E0 4A25619D CEE3D226 1AD2EE6B" \
|
||||
"F12FFA06 D98A0864 D8760273 3EC86A64 521F2B18 177B200C" \
|
||||
"BBE11757 7A615D6C 770988C0 BAD946E2 08E24FA0 74E5AB31" \
|
||||
"43DB5BFC E0FD108E 4B82D120 A9210801 1A723C12 A787E6D7" \
|
||||
"88719A10 BDBA5B26 99C32718 6AF4E23C 1A946834 B6150BDA" \
|
||||
"2583E9CA 2AD44CE8 DBBBC2DB 04DE8EF9 2E8EFC14 1FBECAA6" \
|
||||
"287C5947 4E6BC05D 99B2964F A090C3A2 233BA186 515BE7ED" \
|
||||
"1F612970 CEE2D7AF B81BDD76 2170481C D0069127 D5B05AA9" \
|
||||
"93B4EA98 8D8FDDC1 86FFB7DC 90A6C08F 4DF435C9 34028492" \
|
||||
"36C3FAB4 D27C7026 C1D4DCB2 602646DE C9751E76 3DBA37BD" \
|
||||
"F8FF9406 AD9E530E E5DB382F 413001AE B06A53ED 9027D831" \
|
||||
"179727B0 865A8918 DA3EDBEB CF9B14ED 44CE6CBA CED4BB1B" \
|
||||
"DB7F1447 E6CC254B 33205151 2BD7AF42 6FB8F401 378CD2BF" \
|
||||
"5983CA01 C64B92EC F032EA15 D1721D03 F482D7CE 6E74FEF6" \
|
||||
"D55E702F 46980C82 B5A84031 900B1C9E 59E7C97F BEC7E8F3" \
|
||||
"23A97A7E 36CC88BE 0F1D45B7 FF585AC5 4BD407B2 2B4154AA" \
|
||||
"CC8F6D7E BF48E1D8 14CC5ED2 0F8037E0 A79715EE F29BE328" \
|
||||
"06A1D58B B7C5DA76 F550AA3D 8A1FBFF0 EB19CCB1 A313D55C" \
|
||||
"DA56C9EC 2EF29632 387FE8D7 6E3C0468 043E8F66 3F4860EE" \
|
||||
"12BF2D5B 0B7474D6 E694F91E 6DBE1159 74A3926F 12FEE5E4" \
|
||||
"38777CB6 A932DF8C D8BEC4D0 73B931BA 3BC832B6 8D9DD300" \
|
||||
"741FA7BF 8AFC47ED 2576F693 6BA42466 3AAB639C 5AE4F568" \
|
||||
"3423B474 2BF1C978 238F16CB E39D652D E3FDB8BE FC848AD9" \
|
||||
"22222E04 A4037C07 13EB57A8 1A23F0C7 3473FC64 6CEA306B" \
|
||||
"4BCBC886 2F8385DD FA9D4B7F A2C087E8 79683303 ED5BDD3A" \
|
||||
"062B3CF5 B3A278A6 6D2A13F8 3F44F82D DF310EE0 74AB6A36" \
|
||||
"4597E899 A0255DC1 64F31CC5 0846851D F9AB4819 5DED7EA1" \
|
||||
"B1D510BD 7EE74D73 FAF36BC3 1ECFA268 359046F4 EB879F92" \
|
||||
"4009438B 481C6CD7 889A002E D5EE382B C9190DA6 FC026E47" \
|
||||
"9558E447 5677E9AA 9E3050E2 765694DF C81F56E8 80B96E71" \
|
||||
"60C980DD 98EDD3DF FFFFFFFF FFFFFFFF"
|
||||
|
||||
extern struct dhgroup dh_modp768;
|
||||
extern struct dhgroup dh_modp1024;
|
||||
extern struct dhgroup dh_modp1536;
|
||||
extern struct dhgroup dh_modp2048;
|
||||
extern struct dhgroup dh_modp3072;
|
||||
extern struct dhgroup dh_modp4096;
|
||||
extern struct dhgroup dh_modp8192;
|
533
crypto/dist/kame/racoon/doc/helsinki-result.jp
vendored
Normal file
533
crypto/dist/kame/racoon/doc/helsinki-result.jp
vendored
Normal file
@ -0,0 +1,533 @@
|
||||
Mon Aug 13 2001 - Fri Aug 17 2001
|
||||
$KAME: helsinki-result.jp,v 1.49 2001/08/17 14:33:48 sakane Exp $
|
||||
|
||||
|
||||
generic
|
||||
sec* interface($B<u$1B&$@$1$@$1$I$M(B)$B$O$&$^$/F0$/!#$I$N(BSPD entry$B$H(B
|
||||
$B$I$N%$%s%?%U%'!<%9$,4XO"$E$$$F$$$k$N$+CN$k<jCJ$,I,MW(B(PF_KEY
|
||||
API$B$^$?JQ99(B?)$B!#$H$3$m$G!"(Btunnel/transport$B$O(BSPD entry$B$N(Bproperty$B$G$"$k$H(B
|
||||
$B==J,9g0U$5$l$F$$$k$+(B?
|
||||
|
||||
tunnel mode$B$N(Bproposal$BHf3S!#(Bsee F-Secure
|
||||
|
||||
phase 1$B$G$N(BAES/SHA2 support$BMW!#(B(AES$B$OF0:n3NG':Q(B)
|
||||
Q. $B0E9f2=$7$?7k2L$,(BIV$BD9$h$jC;$$>l9g$O!)$=$s$J$N$"$j$($J$$!)(B
|
||||
|
||||
phase 1$B$G80D9$N%M%4$,$G$-$J$$!#(B($B$G$-$k!#4*0c$$$@$C$?(B)
|
||||
|
||||
IPsec$B$G$N(BSHA2 support$B3NG'(B($BE:IU$9$k(Bbit$B?t(B)$B!#(B
|
||||
|
||||
SSH$B<R$+$i(Btoolkit$B$rGc$C$F;H$C$F$$$k$H$3$m$,BgJQB?$$!#$J$s$+(BSSH$B<R$N(B
|
||||
$B$?$a$K(Bbakeoff$B$7$F$$$k$h$&$J5$$,$7$F$-$?!#$H$$$&$+!"(Bipsec$B<+BN(BSSH$B<R$N(B
|
||||
$BMx1W$N$?$a$N%W%m%H%3%k$8$c$J$$$+$H$$$&5$$9$i$7$F$/$k!#J#;($K$9$l$P(B
|
||||
$B$9$k$[$I(BSSH$B<R$OLY$+$k(B... (conspiracy theory)
|
||||
|
||||
id payload$B$KBP$9$k(Bpolicy database$B8!:w$N8+D>$7!#(Bany$B$N>l9g(Bwildcard$B$@$H(B
|
||||
$B;W$C$F8!:w$9$Y$-!#(Bexactly right!!
|
||||
|
||||
phase 2$B$G!"(Bipsec enc mode$B$,$D$$$F$$$J$+$C$?$H$-$N<h$j07$$(B
|
||||
(transport mode$B$H;W$C$F$h$$$N$G$O$J$$$+(B)$B!#(B($B=$@5:Q(B)
|
||||
|
||||
$BD9$$(BKEYMAT$B$N7W;;$N$H$-!"I,MW80D9$N7W;;$K(Bbug$B$"$j(B ($B=$@5:Q(B)
|
||||
|
||||
DH$B8x3+>pJs$O;vA0$K7W;;$7$H$/J}$,$$$$$+$b(B
|
||||
|
||||
subjectAltName$B$H(BID payload$BHf3S$K$D$$$F$h$/9M$($J$$$H>ZL@=q$O;H$($J$$!#(B
|
||||
$B>ZL@=q$rAw$kA0$K!"$I$N(BID$B$r(BsubjectAltName$B$K;H$&$+7h$a$J$$$H$$$1$J$$$+$i!#(B
|
||||
|
||||
ndp$B$r(Bbypass$B$5$;$k%U%i%0$+%]%j%7$,$"$C$?J}$,$$$$$+$b!#(B
|
||||
$B0l1~(Bipsec_setsocket(NULL)$B$O$7$F$$$k!#(Bip6_output()$B$K%U%i%0EO$9(B?
|
||||
$BH~$7$/$J$$(B... (itojun)
|
||||
|
||||
|
||||
latest isakmpd on KAME
|
||||
Tue Aug 14 01:42:55 JST 2001
|
||||
isakmpd$B$N(Binterface selection$BIt$rD>$7$?$i(Bphase 1$B$O@.8y$7$?!#(B
|
||||
phase 2$B$,$&$^$/$$$+$J$$LOMM!#B?J,@_DjLdBj!#(B
|
||||
|
||||
35:36.982316 130.233.9.166:500 -> 130.233.9.165:500: isakmp 1.0 msgid 00000000:
|
||||
phase 1 ? ident[E]: [encrypted id]
|
||||
2001-08-13 23:35:36: DEBUG: isakmp.c:402:isakmp_main(): malformed cookie receive
|
||||
d or the spi expired.
|
||||
|
||||
|
||||
USAGI linux
|
||||
Tue Aug 14 01:42:55 JST 2001
|
||||
$B$J$s$+:#$O$^$C$F$$$k$i$7$$!#(B
|
||||
|
||||
Wed Aug 15 JST
|
||||
ESP 3des, des$B$N(Bmanual key$B$O@.8y(B
|
||||
|
||||
Thu Aug 16 JST
|
||||
$B$H$j$"$($:(Bpluto$B$@$1F0$+$7$?!#(Bphase 2$B$O40N;$9$k$,7k2L$N80$,0c$&!#(B
|
||||
|
||||
|
||||
Compaq Tru54 UNIX X5.1B-BL4
|
||||
Tue Aug 14 17:09:18 JST 2001
|
||||
IPv4, ESP, tunnel mode
|
||||
phase 1/2$B$H$b(B3DES + SHA1, group 2
|
||||
phase 1 lifetime = 10min, phase 2 lifetime = 5min
|
||||
|
||||
IPv6, ESP + AH, transport tunnel mode
|
||||
phase 1/2$B$H$b(B3DES + SHA1, group 2
|
||||
phase 1 lifetime = 10min, phase 2 lifetime = 5min
|
||||
|
||||
IPv6, IPComp + ESP + AH, transport mode
|
||||
phase 1/2$B$H$b(B3DES + SHA1 + defalte, group 2
|
||||
phase 1 lifetime = 10min, phase 2 lifetime = 5min
|
||||
|
||||
initiator/responder$B$I$A$i$b$d$C$?!#(B
|
||||
|
||||
Compaq$B$,(Binitiator$B$N>l9g$KLdBj$"$j!#(B
|
||||
Compaq$BB&$O(Bphase 2 lifetime$B$N(Bproposal$B:n$jItJ,$K(Bbug$B$,5o$k$h$&$G!"(B
|
||||
GUI$B$G(B5min$B$H8@$C$F$b(B10min$B$H8@$C$F$/$k(B(phase 1 lifetime$B$NCM$r(B
|
||||
$B%3%T!<$7$F$$$k(B?)$B!#(B
|
||||
|
||||
chargen$BCf$N(Brekey$BEy$b;n$7$?!#LdBj$J$7!#(B
|
||||
|
||||
IPv4 over IPv6/IPv6 over IPv4$B$d$m$&$H8@$o$l$?$,$G$-$:!#(Bsec* transition
|
||||
$B=*$o$C$?$i$d$l$k$+$J!#(B
|
||||
|
||||
$BL@F|(B12:00 RSA signature mode$B$G:F@o(B
|
||||
$B$`$`!"(Bauthentication-failed$B$G<:GT!#$3$C$A$NLdBj$+!)(B
|
||||
|
||||
Fitec$B$H8=>]$O0l=o!#(Bopenssl 0.9.6 $B$r;H$&$HLdBj$J$7!#(B
|
||||
openssl$B$N%P!<%8%g%s2<$2$A$c$C$?$N$G(B
|
||||
ipv6 address as subjectAltName $B$O=PMh$:!#(B
|
||||
|
||||
|
||||
Sun
|
||||
Thu Aug 16 16:30 EEST 2001
|
||||
phase1: RSA signature, 3des, sha1, dh5
|
||||
phase2: ESP transport, aes 128, sha1, dh5
|
||||
|
||||
$BLdBj$J$7(B
|
||||
|
||||
Sun$B$O(B phase2$B$N(BAES$B$N80D9$r$D$1$F$J$+$C$?!#(Bdraft$B$K$h$k$H(Bmust$B!#(B
|
||||
racoon$BB&$,(Bdefault$B80D9$r%;%C%H$9$k$h$&$K$7$FBP1~!#(B
|
||||
|
||||
|
||||
IBM AIX 5.1
|
||||
Tue Aug 14 17:33:43 JST 2001
|
||||
IPv6 test$B$7$h$&$H8@$o$l$k$b!"@hJ}$N%^%7%s(B($B1s3VCO(B)$B$K(Bglobal address$B$J$7!#(B
|
||||
|
||||
Thu Aug 16 21:00 ESST 2001
|
||||
IPv6$B$@$1(B
|
||||
phase1 pre-shared-key, 3des, sha1, dh2
|
||||
phase2 esp transport, 3des, sha1, pfs2
|
||||
$B:G=i$N(B1$B2s$OLdBj$J$7!#(B
|
||||
phase2 SA$B$r>C$7$F:F%M%4$9$k$H(Bisakmpd$B$,$@$s$^$j$K$J$k!#(B
|
||||
ibm isakmpd $B$KLdBj$"$k$C$]$$!#(B
|
||||
|
||||
san diego$B$G$d$C$?;~$O(B manual $B$@$C$?$+$J!)(B
|
||||
$B$=$&$G$9(B(itojun)
|
||||
|
||||
prasad$B7/$O%$%s%I$K5"$C$F$k$N$GMh$J$$!#(B
|
||||
|
||||
F-Secure VPN+ 5.40
|
||||
Tue Aug 14 19:44:15 JST 2001
|
||||
IPv4, ESP, tunnel mode
|
||||
phase 1 3DES + SHA1, group 5, lifetime = 10min
|
||||
phase 2 AES + SHA1, group 5, lifetime = 2min
|
||||
|
||||
IPv4, IPComp + ESP, transport mode
|
||||
phase 1 3DES + SHA1, group 5, lifetime = 10min
|
||||
phase 2 AES + SHA1 + deflate, group 5, lifetime = 2min
|
||||
|
||||
$B$I$A$i$bLdBj$J$7!"(Brekey$B$b(BOK$B!#(B
|
||||
|
||||
IPComp + ESP tunnel mode (IP ESP IPComp IP payload)$B$r$d$m$&$H$7$F(B
|
||||
ipcomp/tunnel//use esp/transport//use$B$H%]%j%7$r=q$$$?$i!"(B
|
||||
IKE phase 2$BE*$K(B
|
||||
$B8~$3$&(B: IPComp tunnel, ESP tunnel
|
||||
$B$3$C$A(B: IPComp tunnel, ESP transport
|
||||
$B$N(Bproposal$B$rHf3S$7$F!"(Bno proposal chosen$B$K$J$k!#$3$C$A$NLdBj(B
|
||||
(bundle$B$N<h$j07$$(B)
|
||||
|
||||
$B$G$C$+$$(BDH group$B!"(Bphase 1 SHA2-256/AES$B$b$G$-$k$i$7$$!#8e$G$d$j$?$$!#(B
|
||||
(modp4096, phase 1 aes $B$O(Bok)
|
||||
|
||||
Fri Aug 17 11:00 EEST 2001
|
||||
phase1: aggressive mode modp4096, aes, sha1, rsa signature
|
||||
phase2: pfs 5, esp tunnel, aes, hmac sha1
|
||||
|
||||
aes for phase1 $B$b(BOK.
|
||||
f-secure$B$O(BsubjectAltName$B$K%"%I%l%9=q$+$J$$$H%Q%1%C%H$@$;$J$$!#(B
|
||||
invalid signature$B$G(Bf-secure$B$KE\$i$l$F<:GT!#860xITL@!#(B
|
||||
-> f-secure$B$O(BsubjectAltName$B$r(B1$B$D$7$+<u$1$D$1$J$$!#(B
|
||||
$B>ZL@=q$r:n$jD>$7$F@.8y!#(B
|
||||
|
||||
DH$B8x3+>pJs$O;vA0$K7W;;$7$H$/J}$,$$$$$+$b(B
|
||||
|
||||
SecGo CryptoIP v3
|
||||
Tue Aug 14 21:41:36 JST 2001
|
||||
IPv4, ESP, transport mode
|
||||
phase 1 3DES + SHA1, group 5, lifetime = 10min
|
||||
phase 2 blowfish, group 5, lifetime = 2min
|
||||
|
||||
phase 2 AES$B$b;n$=$&$H$7$?$,<:GT(B(SecGo$BB&$,(B12$B0J30$N(Balgorithm #$B$r(B
|
||||
$B;H$C$F$$$?(B or $B%3%s%Q%$%k$7$F$J$+$C$?(B)$B!#(Brekey$B$b$d$C$F$_$?!#(B
|
||||
|
||||
phase 1 AES$B$b$G$-$k$i$7$$(B(SSH toolkit$B;HMQ(B)$B!#(B
|
||||
|
||||
Wed Aug 15 00:16:35 JST 2001
|
||||
IPv4, ESP, transport mode
|
||||
phase 1 3DES + SHA1, lifetime = 10min
|
||||
phase 2 AES, lifetime = 2min
|
||||
|
||||
tested rekey as well.
|
||||
|
||||
Oullim information technologies SECUREWORKS VPN gateway 3.0
|
||||
Tue Aug 14 21:48:36 JST 2001
|
||||
phase 2 AES/blowfish$B$O$I$&$@$M$H%J%s%Q$7$F$_$k$b!"(Bnot ready$B!#(B
|
||||
$BL@F|$+L@8eF|$M$H$N$3$H!#(B
|
||||
|
||||
Wed Aug 15 17:15:09 JST 2001
|
||||
IPv4, ESP, tunnel mode
|
||||
phase 1 3DES + SHA1, group 2, lifetime = 10min
|
||||
phase 2 AES + SHA1, group 2, lifetime = 2min
|
||||
|
||||
$B<:GT!#@hJ}$,(BAES$B$N$H$-$K(BESP ICV check$B$K<:GT$9$k!#(B
|
||||
|
||||
IPv4, ESP, tunnel mode
|
||||
phase 1 3DES + SHA1, group 2, lifetime = 10min
|
||||
phase 2 AES + MD5, group 2, lifetime = 2min
|
||||
|
||||
$B$*$J$8$/<:GT(B
|
||||
|
||||
IPv4, ESP, tunnel mode
|
||||
phase 1 3DES + SHA1, group 2, lifetime = 10min
|
||||
phase 2 3DES + MD5, group 2, lifetime = 2min
|
||||
|
||||
$B@.8y!#(B
|
||||
|
||||
$B@hJ}$,$3$&$$$&$NEj$2$F$/$k$N$G!"$3$C$A$OE\$k(B(id payload$B$N=g=x$,(B
|
||||
$BIaDL$G$O$J$$(B)$B!#(B
|
||||
|
||||
>11:59.824877 130.233.10.30:500 -> 130.233.9.166:500: isakmp 1.0 msgid 75973360: phase 2/others ? oakley-quick:
|
||||
> (hash: len=20)
|
||||
> (sa: doi=ipsec situation=identity
|
||||
> (p: #1 protoid=ipsec-esp transform=1 spi=6fd60ca5
|
||||
> (t: #1 id=3des (type=lifetype value=sec)(type=life value=0078)(type=enc mode value=tunnel)(type=auth value=hmac-md5)(type=group desc value=modp1024))))
|
||||
> (nonce: n len=16)
|
||||
> (ke: key len=128)
|
||||
> (id: idtype=IPv4 protoid=0 port=0 len=4 130.233.9.166)
|
||||
> (id: idtype=IPv4net protoid=0 port=0 len=8 192.168.10.0/255.255.255.0)
|
||||
|
||||
Wed Aug 15 18:39:11 JST 2001
|
||||
IPv4, ESP, tunnel mode
|
||||
phase 1 3DES + SHA1, group 2, lifetime = 10min
|
||||
phase 2 AES, group 2, lifetime = 2min
|
||||
|
||||
IKE$BE*$K$OBg>fIW!#(BIPsec$BE*$K$^$@BLL\!#(B
|
||||
|
||||
Wed Aug 15 19:09:05 JST 2001
|
||||
IPv4, ESP, tunnel mode
|
||||
phase 1 3DES + SHA1, group 2, lifetime = 10min
|
||||
phase 2 AES, group 2, lifetime = 2min
|
||||
|
||||
IPv4, ESP, tunnel mode
|
||||
phase 1 3DES + SHA1, group 2, lifetime = 10min
|
||||
phase 2 AES + SHA1, group 2, lifetime = 2min
|
||||
|
||||
$B8~$3$&$,(BAES code$B$r=$@5$7$?!#(BIKE$BE*$K$b(BIPsec$BE*$K$bBg>fIW!#(B
|
||||
rekey$B$b0l1~@.8y(B($B8~$3$&$O(Breal lifetime == soft, real * 1.2 == hard$B$H$+$K(B
|
||||
$B@_Dj$7$F$$$k$N$G$A$g$C$H%X%s$@$C$?$1$I(B)$B!#(B
|
||||
|
||||
Thu Aug 16 22:01:57 JST 2001
|
||||
$B$b$&$$$A$I!#$"$H$O(BID payload$B$N=g=x$@$1!#(B
|
||||
|
||||
Fri Aug 17 02:00 JST$B:"(B
|
||||
$B:FD)@o!#@.8y!#(B
|
||||
|
||||
|
||||
Trilogy AdmitOne 2.6
|
||||
Tue Aug 14 21:58:01 JST 2001
|
||||
30$BJ,8e$H8@$o$l$?!#(B
|
||||
|
||||
Wed Aug 15 01:53:42 JST 2001
|
||||
$BL@F|!#(B
|
||||
|
||||
Wed Aug 15 16:09:50 JST 2001
|
||||
IPv4, ESP, transport mode
|
||||
phase 1 3DES + SHA1, group 1, lifetime = 10min
|
||||
phase 2 AES + SHA1, group 1, lifetime = 2min
|
||||
|
||||
Trilogy$BB&$O(BIKE phase 2$B$N(Bkey length$B$,(Bbyte$BC10L$@$H;W$C$F$$$k$i$7$/(B
|
||||
negotiation$B<:GT!#=$@58e:FD)@o!#(B
|
||||
|
||||
Wed Aug 15 17:40:05 JST 2001
|
||||
IPv4, ESP, transport mode
|
||||
phase 1 3DES + SHA1, group 1, lifetime = 10min
|
||||
phase 2 AES + SHA1, group 1, lifetime = 2min
|
||||
|
||||
$B:FD)@o!#$3$A$i$,(Binitiator$B$N$H$-$O$&$^$/$$$/!#$"$A$i$,(Binitiator$B$N(B
|
||||
$B>l9g!"(Bid payload$B$K(Bproto=icmp$B$,Kd$^$C$F$*$j!"$3$A$i$N(Bkernel policy
|
||||
proto=any$B$K(Bmatch$B$;$:(Bno policy found$B$K$J$k!#MW=$@5!#(B
|
||||
|
||||
>spdadd 130.233.9.166 130.233.10.167 any -P out ipsec esp/transport//use;
|
||||
>spdadd 130.233.10.167 130.233.9.166 any -P in ipsec esp/transport//use;
|
||||
|
||||
>35:45.215745 130.233.10.167:500 -> 130.233.9.166:500: isakmp 1.0 msgid dba05304: phase 2/others ? oakley-quick:
|
||||
> (hash: len=20)
|
||||
> (sa: doi=ipsec situation=identity
|
||||
> (p: #1 protoid=ipsec-esp transform=1 spi=dba05304
|
||||
> (t: #1 id=aes (type=lifetype value=sec)(type=life value=7080)(type=lifetype value=kb)(type=life value=2000)(type=
|
||||
>group desc value=modp768)(type=enc mode value=transport)(type=auth value=hmac-sha1)(type=keylen value=0080))))
|
||||
> (nonce: n len=64)
|
||||
> (ke: key len=96)
|
||||
> (id: idtype=IPv4 protoid=icmp port=0 len=4 130.233.10.167)
|
||||
> (id: idtype=IPv4 protoid=icmp port=0 len=4 130.233.9.166)
|
||||
|
||||
>2001-08-15 17:35:45: DEBUG: isakmp_quick.c:1951:get_proposal_r(): get a src address from ID payload 130.233.10.167[0] prefixlen=32 ul_proto=1
|
||||
>2001-08-15 17:35:45: DEBUG: isakmp_quick.c:1956:get_proposal_r(): get dst address from ID payload 130.233.9.166[0] prefixlen=32 ul_proto=1
|
||||
>2001-08-15 17:35:45: DEBUG: policy.c:245:cmpspidxwild(): sub:0xbfbfd350: 130.233.10.167/32[0] 130.233.9.166/32[0] proto=icmp dir=in
|
||||
>2001-08-15 17:35:45: DEBUG: policy.c:246:cmpspidxwild(): db: 0x80ca408: 130.233.10.167/32[0] 130.233.9.166/32[0] proto=any dir=in
|
||||
>2001-08-15 17:35:45: DEBUG: policy.c:245:cmpspidxwild(): sub:0xbfbfd350: 130.233.10.167/32[0] 130.233.9.166/32[0] proto=icmp dir=in
|
||||
>2001-08-15 17:35:45: DEBUG: policy.c:246:cmpspidxwild(): db: 0x80ca808: 130.233.9.166/32[0] 130.233.10.167/32[0] proto=any dir=out
|
||||
>2001-08-15 17:35:45: ERROR: isakmp_quick.c:1979:get_proposal_r(): no policy found: 130.233.10.167/32[0] 130.233.9.166/32[0] proto=icmp dir=in
|
||||
|
||||
|
||||
ZyXEL
|
||||
Tue Aug 14 12:00 ESST 2001
|
||||
phase1 main mode, pre-shared key, des, sha1, dh1
|
||||
phase2 esp, des, sha1, tunnel
|
||||
|
||||
$BLdBj$J$7!#(Bproposal$B$O(B1$B$D$@$1<u$1$D$1$k!#(Brekey$B$O$G$-$J$$!#(B
|
||||
|
||||
|
||||
III
|
||||
Tue Aug 14 14:00 ESST 2001
|
||||
phase1 main mode, pre-shared key, 3des, md5, dh2
|
||||
phase2 esp, des, md5, tunnel
|
||||
|
||||
$BLdBj$J$7!#(Bproposal$B$O(B1$BHVL\$r;H$&!#(Brekey$B$O$G$-$J$$!#(B
|
||||
$BBfOQ$N>e;J$K(BKAME$B$H%F%9%H$7$F$3$$$H8@$o$l$?$i$7$$!#(B
|
||||
|
||||
|
||||
WindowsXP
|
||||
Tue Aug 14 20:00
|
||||
phase1 main mode, pre-shared key, 3des, sha1, modp3072
|
||||
phase2 esp, 3des, sha1, transport
|
||||
|
||||
modp3072$B$d$m$&$h$H%J%s%Q$5$l$k!#(B
|
||||
dh$B$N7W;;(B: fbsd43 P100MHz$B$GLs(B7(s)
|
||||
XP P2 200MHz$B$GLs(B9(s)
|
||||
|
||||
$BL@F|M<J}(B RSA signature mode$B$G:F@o!#(B
|
||||
|
||||
$B5"$C$A$c$C$?$N$G$G$-$J$$!#(B
|
||||
|
||||
Ashley
|
||||
Tue Aug 14 18:00
|
||||
invalid-signature$B$HJ86g$r8@$o$l$k!#(B
|
||||
$B8_$$$K(B ssh-ca1$B$+$i=pL>$7$F$b$i$C$?$H8@$C$F$k$,!"(B
|
||||
$B<B$O(Btest-ca1.ssh.com$B$H(Bbakeoff-ca1.ssh.com$B$N(B2$B$D$"$k;v$,H=L@!D(B
|
||||
|
||||
test-ca1.ssh.com$B$KE}0l$7$F:F@oM=Ls(B
|
||||
|
||||
Fri Aug 17 10:30
|
||||
Ashley$B<BAu$K(Bpkcs#1 padding$B$NLdBj$"$j!#%M%4$G$-$:!#(B
|
||||
|
||||
Netoctave
|
||||
Wed Aug 15 11:00
|
||||
$B$3$C$A$,(B initiate$B$9$k$H(B no-proposal-chosen$B$,5"$C$F$/$k!#(B
|
||||
$BE($+$i(Bping$B$7$F$b$i$&$H(BIKE$B$N%Q%1%C%H$,=P$J$$!#(B
|
||||
|
||||
$B>u673NG'$7$F$b$i$C$F8e$+$i:F@o$9$kM=Dj!#(B
|
||||
|
||||
isakmpd (jakob@openbsd)
|
||||
Tue Aug 14
|
||||
IPv4, ESP, transport mode
|
||||
phase 1 3DES + SHA1, group 2, lifetime = 10min
|
||||
phase 2 AES + SHA1, group 2, lifetime = 2min
|
||||
|
||||
$BLdBj$J$7!#(B
|
||||
|
||||
Wed Aug 15 21:25:49 JST 2001
|
||||
IPv6, ESP, tunnel mode
|
||||
phase 1 3DES + SHA1, group 2, lifetime = 10min
|
||||
phase 2 AES + SHA1, group 2, lifetime = 2min
|
||||
|
||||
$B8~$3$&$O(Bmain mode$B$G(BFQDN$B$r(BID$B$K;H$$$?$,$C$?$,!"$3$&$$$&%(%i!<$GE\$i$l$k!#(B
|
||||
sakane$B$O$3$l$O(Bwg$B$G$N9g0U$H;W$C$F$$$k$,!"MW3NG'!#(B
|
||||
2001-08-15 21:14:41: ERROR: ipsec_doi.c:3063:ipsecdoi_checkid1(): Expecting IP address type in main mode, but FQDN.
|
||||
|
||||
Fri Aug 17 10:00
|
||||
rsa signature.
|
||||
$BLdBj$J$7!#(B
|
||||
|
||||
isakmpd$B$O(B subjectAltName$B$r(B1$B$D$7$+<u$1$D$1$J$$!#(B
|
||||
|
||||
|
||||
Fitec
|
||||
Wed Aug 15 13:00
|
||||
RSA signature
|
||||
invalid-authentication $B$GD7$M$i$l$k!#$$$h$$$h$3$C$A$NLdBj$+(B...
|
||||
|
||||
KeyUsage $B$r(BIKE$B$K$7$H$+$J$$$HE\$i$l$k!#(B
|
||||
$BB>$N<BAu$H$&$^$/$$$+$J$$$N$O!"$3$l$,860x$+!)(B
|
||||
$B$=$&$G$b$J$5$=$&!"(Bopenssl$B$NLdBj$+$b!#(B
|
||||
|
||||
openssl 0.9.6 $B$K$7$?$i@.8y!#0c$$$,J,$+$i$:!#(B
|
||||
|
||||
SSH
|
||||
IPv6$B$@$1$d$C$?(B
|
||||
|
||||
ssh solaris version:
|
||||
ssh$BB&(B: IKE$B$N%Q%1%C%H$,=P$J$$!#(B
|
||||
nd cache$B$NLdBj$+!)(B
|
||||
tcp$B$@$1$N%]%j%7$G$b(BIKE$B$N%Q%1%C%H$,=P$;$J$$!#(B
|
||||
solaris$B$O(Bstatic cache entry$BF~$l$k%3%^%s%I$,$J$$$i$7$$!#(B
|
||||
$B0lC6(Bping6$B$7$F(Bcache$B$r:n$C$?5$$K$J$C$F$b(BNS$B$r=P$=$&$H$9$k!#(B
|
||||
$B860xD4::$9$k$+$i:F@o$7$F$M$H8@$o$l$k!#(B
|
||||
$B:F@o(B. $BLdBj$J$7(B
|
||||
|
||||
$BBt;3$N(Bphase2 proposal(43440B$B$N(BUDP$B%Q%1%C%H(B)$B$r<u$1$k$H(B
|
||||
racoon $B$^$G%Q%1%C%H$,>e$,$C$FMh$J$$!#(B
|
||||
|
||||
500 proposal$B$rEj$2$F$/$k!#(Bproposal#$B$O(B1byte$B$J$N$GCF$/$Y$-!#(B
|
||||
racoon$B$O:G=i$KA4It%Q!<%9$7$F$k$_$?$$!#(B
|
||||
|
||||
RSA signature mode
|
||||
ssh$BB&$K(Bpublic key$B7W;;$KLdBj$"$C$?!#D>$7$F(BOK
|
||||
ssh$B$O(Bssh-test-ca1$B$,%5%$%s$7$?>ZL@=q$r;H$$!"(B
|
||||
racoon$B$O(Bfujixerox$B$,%5%$%s$7$?>ZL@=q$G$b(BOK
|
||||
|
||||
AES phase1 $B$,$&$^$/$$$+$J$$!#4V0c$$$J$/(Bracoon$B$NLdBj!#(B($BD>$7$FF0:n3NG':Q(B)
|
||||
|
||||
phase1 proposal$B$N%Q!<%9$KCn$,$$$k$+$b!#MW3NG'(B
|
||||
|
||||
freeswan
|
||||
IPv4, IPComp + ESP, transport mode
|
||||
phase 1 3DES + SHA1, group 5, lifetime = 10min
|
||||
phase 2 3DES + SHA1 + deflate, group 5, lifetime = 2min
|
||||
|
||||
IPComp$B$K$OLdBj$J$7!#(B
|
||||
|
||||
$B@hJ}$,(Binitiate$B$7$F$-$?$H$-$KLdBj$"$j!#(Bphase 2$B$G!"(Bipcomp enc mode$B$,(B
|
||||
$BL5;XDj$N>l9g!"(Bipcomp$B$N>l9g$@$1$O(Btransport$B$H;W$o$J$1$l$P$J$i$J$$!#(B
|
||||
$B$,!"(Bracoon$B$O8=>u$3$l$r(BRFC2407$BE*$K(B(Any$B$H$7$F(B)$B<h$j07$&!#$N$G!"(Bno
|
||||
proposal chosen$B$K$J$k!#(B
|
||||
RFC2407$B$+$i$9$k$H!"(Benc mode unspecified == transport$B$G$b$h$$$h$&$J(B
|
||||
$B5$$,$9$k$,(B... ("host-dependent"$B$C$F=q$$$F$"$k$+$i(B)
|
||||
|
||||
RFC2407
|
||||
> Encapsulation Mode
|
||||
> RESERVED 0
|
||||
> Tunnel 1
|
||||
> Transport 2
|
||||
>
|
||||
> Values 3-61439 are reserved to IANA. Values 61440-65535 are
|
||||
> for private use.
|
||||
>
|
||||
> If unspecified, the default value shall be assumed to be
|
||||
> unspecified (host-dependent).
|
||||
|
||||
draft-shacham-ippcp-rfc2393bis-08.txt
|
||||
> Encapsulation Mode
|
||||
>
|
||||
> To propose a non-default Encapsulation Mode (such as Tunnel
|
||||
> Mode), an IPComp proposal MUST include an Encapsulation Mode
|
||||
> attribute. If the Encapsulation Mode is unspecified, the
|
||||
> default value of Transport Mode is assumed.
|
||||
|
||||
>42:28.211568 130.233.9.175:500 -> 130.233.9.166:500: isakmp 1.0 msgid 6935cbd8: phase 2/others ? oakley-quick:
|
||||
> (hash: len=20)
|
||||
> (sa: doi=ipsec situation=identity
|
||||
> (p: #0 protoid=ipsec-esp transform=2 spi=3a47a3e7
|
||||
> (t: #0 id=3des (type=group desc value=0005)(type=enc mode value=transport)(type=lifetype value=sec)(type=life value=7080)(type=auth value=hmac-md5))
|
||||
> (t: #1 id=3des (type=group desc value=0005)(type=enc mode value=transport)(type=lifetype value=sec)(type=life value=7080)(type=auth value=hmac-sha1)))
|
||||
> (p: #0 protoid=ipcomp transform=1 spi=ac23
|
||||
> (t: #0 id=deflate (type=lifetype value=sec)(type=life value=7080))))
|
||||
> (nonce: n len=16)
|
||||
> (ke: key len=192)
|
||||
|
||||
>2001-08-15 16:42:28: DEBUG: ipsec_doi.c:1024:get_ph2approvalx(): peer's single bundle:
|
||||
>2001-08-15 16:42:28: DEBUG: proposal.c:814:printsaproto(): (proto_id=ESP spisize=4 spi=3a47a3e7 spi_p=00000000 encmode=Transport reqid=0:0)
|
||||
>2001-08-15 16:42:28: DEBUG: proposal.c:848:printsatrns(): (trns_id=3DES encklen=0 authtype=1)
|
||||
>2001-08-15 16:42:28: DEBUG: proposal.c:848:printsatrns(): (trns_id=3DES encklen=0 authtype=2)
|
||||
>2001-08-15 16:42:28: DEBUG: proposal.c:814:printsaproto(): (proto_id=IPCOMP spisize=2 spi=0000ac23 spi_p=00000000 encmode=Any reqid=0:0)
|
||||
>2001-08-15 16:42:28: DEBUG: proposal.c:855:printsatrns(): (trns_id=DEFLATE)
|
||||
>2001-08-15 16:42:28: DEBUG: ipsec_doi.c:1027:get_ph2approvalx(): my single bundle:
|
||||
>2001-08-15 16:42:28: DEBUG: proposal.c:814:printsaproto(): (proto_id=ESP spisize=4 spi=00000000 spi_p=00000000 encmode=Transport reqid=0:0)
|
||||
>2001-08-15 16:42:28: DEBUG: proposal.c:848:printsatrns(): (trns_id=3DES encklen=0 authtype=2)
|
||||
>2001-08-15 16:42:28: DEBUG: proposal.c:814:printsaproto(): (proto_id=IPCOMP spisize=4 spi=00000000 spi_p=00000000 encmode=Transport reqid=0:0)
|
||||
>2001-08-15 16:42:28: DEBUG: proposal.c:855:printsatrns(): (trns_id=DEFLATE)
|
||||
>2001-08-15 16:42:28: ERROR: proposal.c:497:cmpsatrns(): authtype mismatched: my:1 peer:2
|
||||
>2001-08-15 16:42:28: ERROR: proposal.c:365:cmpsaprop_alloc(): IPComp SPI size promoted from 16bit to 32bit
|
||||
>2001-08-15 16:42:28: ERROR: proposal.c:378:cmpsaprop_alloc(): encmode mismatched: my:2 peer:0 <-----
|
||||
|
||||
Thu Aug 16 16:49:08 JST 2001
|
||||
IPv4, IPComp + ESP, transport mode
|
||||
phase 1 3DES + SHA1, group 5, lifetime = 10min
|
||||
phase 2 3DES + SHA1 + deflate, group 5, lifetime = 2min
|
||||
$B:FD)@o!#=$@5$G$-$?$3$H$r3NG'!#(B
|
||||
|
||||
|
||||
netopia
|
||||
Wed Aug 15 19:00 JST$B:"(B
|
||||
IPv6, ESP, transport mode
|
||||
phase 1 3DES + SHA1, group 2, lifetime = 24h
|
||||
phase 2 3DES + SHA1, group 2, lifetime = 1h
|
||||
|
||||
KAME$B%Y!<%9<BAu!#(BCPU$B$,$7$g$\$$$i$7$/(BD-H$B$K(B5$BIC$/$i$$$+$+$C$F$I$-$I$-$9$k!#(B
|
||||
bug report$B$J$I$"$C$?$iAw$C$F$b$i$&$h$&$*4j$$$9$k!#(B
|
||||
|
||||
|
||||
Ericsson
|
||||
Wed Aug 15 20:30 JST$B:"(B
|
||||
IPv6, ESP, transport mode
|
||||
phase 1 3DES + SHA1, group 2, lifetime = 24h
|
||||
phase 2 AES + SHA1, group 2, lifetime = 1h
|
||||
|
||||
$B@.8y(B
|
||||
|
||||
IPv6, ESP, transport mode
|
||||
phase 1 3DES + SHA1, group 2, lifetime = 24h
|
||||
phase 2 blowfish + SHA1, group 2, lifetime = 1h
|
||||
|
||||
$B<:GT!#(Bblowfish$B!"$3$C$A$,$o$N80$N@8@.$,$*$+$7$$(B(= $BD9$$80$N>l9g(B)$B!#(B
|
||||
|
||||
IPv6, ESP, transport mode
|
||||
phase 1 3DES + SHA1, group 2, lifetime = 24h
|
||||
phase 2 3DES + SHA1, group 2, lifetime = 1h
|
||||
|
||||
$B<:GT!#(Bericsson$BB&!"(BND$B$,$*$+$7$$!#(B
|
||||
|
||||
|
||||
Nokia EPOC
|
||||
Wed Aug 15 20:51:25 JST 2001
|
||||
IPv6, ESP, tunnel mode
|
||||
phase 1 3DES + SHA1, group 2, lifetime = 3600min
|
||||
phase 2 3DES + SHA1 + deflate, group 2, lifetime = 2min
|
||||
|
||||
IPsec key$B$bF~$k$,!"@hJ}$N%]%j%7LdBj$G(Bping$B$OJV$i$J$$!#(B
|
||||
|
||||
Trustworks TrustedClient v3.2
|
||||
Thu Aug 16 20:17:51 JST 2001
|
||||
IPv6, AH + ESP, transport mode
|
||||
phase 1 3DES + SHA1, group 5, lifetime = 3min
|
||||
phase 2 3DES + SHA1, group 5, lifetime = 2min
|
||||
|
||||
$B@hJ}$,(Bresponder$B$N$H$-!"808r49$,=*N;$7$?=V4V@hJ}$N(BIKE daemon$B$,(Bpanic$B!#(B
|
||||
$B$^$"808r49<+BN$O$G$-$F$$$k$h$&$@!#(B
|
||||
|
||||
|
||||
Nortel GatewayController/CallServer 2000 (not released yet)
|
||||
Fri Aug 17 00:16:23 JST 2001
|
||||
IPv4, ESP, transport mode
|
||||
phase 1 3DES + SHA1, group 5, lifetime = 3min
|
||||
phase 2 AES + SHA1, group 5, lifetime = 2min
|
||||
|
||||
Nortel$BB&(Binitiator: round=10$B$H$$$&(Battribute$B$r$D$1$F$/$k$N$G(Bno proposal
|
||||
chosen
|
||||
KAME$BB&(Binitiator: id payload$BH4$-(B(ip address$B;H$((B)$B$@$H(BNortel$BB&$O(B
|
||||
$B$X$/$k$N$GBLL\(B
|
||||
|
||||
IPv4, ESP, transport mode
|
||||
phase 1 3DES + SHA1, group 5, lifetime = 3min
|
||||
phase 2 3DES + SHA1, group 5, lifetime = 2min
|
||||
|
||||
Nortel$BB&(Binitiator: ok
|
||||
KAME$BB&(Binitiator: id payload$BH4$-$@$H(BNortel$BB&$O$X$/$k$N$GBLL\(B
|
124
crypto/dist/kame/racoon/eaytest.c
vendored
124
crypto/dist/kame/racoon/eaytest.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: eaytest.c,v 1.22 2001/07/11 13:17:53 sakane Exp $ */
|
||||
/* $KAME: eaytest.c,v 1.28 2001/08/16 21:44:50 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -45,6 +45,7 @@
|
||||
#include "str2val.h"
|
||||
|
||||
#include "oakley.h"
|
||||
#include "dhgroup.h"
|
||||
#include "crypto_openssl.h"
|
||||
|
||||
#define PVDUMP(var) hexdump((var)->v, (var)->l)
|
||||
@ -159,6 +160,7 @@ char *certs[] = {
|
||||
void certtest __P((void));
|
||||
void ciphertest __P((void));
|
||||
void hmactest __P((void));
|
||||
void sha2test __P((void));
|
||||
void sha1test __P((void));
|
||||
void md5test __P((void));
|
||||
void dhtest __P((int));
|
||||
@ -296,29 +298,37 @@ ciphertest()
|
||||
{
|
||||
vchar_t data;
|
||||
vchar_t key;
|
||||
vchar_t *res1, *res2;
|
||||
char iv[8];
|
||||
vchar_t iv0;
|
||||
vchar_t *res1, *res2, *iv;
|
||||
|
||||
printf("\n**Test for CIPHER.**\n");
|
||||
|
||||
data.v = str2val("a7c3a855 a328a6d4 b1bd9c06 c5bd5c17 b8c5f657 bd8ea245 2a6726d0 ce3689f5", 16, &data.l);
|
||||
key.v = str2val("fadc3844 61d6114e fadc3844 61d6114e fadc3844 61d6114e", 16, &key.l);
|
||||
data.v = str2val("\
|
||||
06000017 03000000 73616b61 6e65406b 616d652e 6e657409 0002c104 308202b8 \
|
||||
04f05a90 \
|
||||
", 16, &data.l);
|
||||
key.v = str2val("f59bd70f 81b9b9cc 2a32c7fd 229a4b37", 16, &key.l);
|
||||
iv0.v = str2val("26b68c90 9467b4ab 7ec29fa0 0b696b55", 16, &iv0.l);
|
||||
|
||||
iv = vmalloc(8);
|
||||
|
||||
/* des */
|
||||
printf("DES\n");
|
||||
printf("data:\n");
|
||||
PVDUMP(&data);
|
||||
|
||||
memset(iv, 0, sizeof(iv));
|
||||
res1 = eay_des_encrypt(&data, &key, (caddr_t)iv);
|
||||
memcpy(iv->v, iv0.v, 8);
|
||||
res1 = eay_des_encrypt(&data, &key, iv);
|
||||
printf("encrypto:\n");
|
||||
PVDUMP(res1);
|
||||
|
||||
memset(iv, 0, sizeof(iv));
|
||||
res2 = eay_des_decrypt(res1, &key, (caddr_t)iv);
|
||||
memcpy(iv->v, iv0.v, 8);
|
||||
res2 = eay_des_decrypt(res1, &key, iv);
|
||||
printf("decrypto:\n");
|
||||
PVDUMP(res2);
|
||||
|
||||
if (memcmp(data.v, res2->v, data.l))
|
||||
printf("XXX NG XXX\n");
|
||||
vfree(res1);
|
||||
vfree(res2);
|
||||
|
||||
@ -328,16 +338,18 @@ ciphertest()
|
||||
printf("data:\n");
|
||||
PVDUMP(&data);
|
||||
|
||||
memset(iv, 0, sizeof(iv));
|
||||
res1 = eay_idea_encrypt(&data, &key, (caddr_t)iv);
|
||||
memcpy(iv->v, iv0.v, 8);
|
||||
res1 = eay_idea_encrypt(&data, &key, iv);
|
||||
printf("encrypto:\n");
|
||||
PVDUMP(res1);
|
||||
|
||||
memset(iv, 0, sizeof(iv));
|
||||
res2 = eay_idea_decrypt(res1, &key, (caddr_t)iv);
|
||||
memcpy(iv->v, iv0.v, 8);
|
||||
res2 = eay_idea_decrypt(res1, &key, iv);
|
||||
printf("decrypto:\n");
|
||||
PVDUMP(res2);
|
||||
|
||||
if (memcmp(data.v, res2->v, data.l))
|
||||
printf("XXX NG XXX\n");
|
||||
vfree(res1);
|
||||
vfree(res2);
|
||||
#endif
|
||||
@ -347,16 +359,18 @@ ciphertest()
|
||||
printf("data:\n");
|
||||
PVDUMP(&data);
|
||||
|
||||
memset(iv, 0, sizeof(iv));
|
||||
res1 = eay_bf_encrypt(&data, &key, (caddr_t)iv);
|
||||
memcpy(iv->v, iv0.v, 8);
|
||||
res1 = eay_bf_encrypt(&data, &key, iv);
|
||||
printf("encrypto:\n");
|
||||
PVDUMP(res1);
|
||||
|
||||
memset(iv, 0, sizeof(iv));
|
||||
res2 = eay_bf_decrypt(res1, &key, (caddr_t)iv);
|
||||
memcpy(iv->v, iv0.v, 8);
|
||||
res2 = eay_bf_decrypt(res1, &key, iv);
|
||||
printf("decrypto:\n");
|
||||
PVDUMP(res2);
|
||||
|
||||
if (memcmp(data.v, res2->v, data.l))
|
||||
printf("XXX NG XXX\n");
|
||||
vfree(res1);
|
||||
vfree(res2);
|
||||
|
||||
@ -366,16 +380,18 @@ ciphertest()
|
||||
printf("data:\n");
|
||||
PVDUMP(&data);
|
||||
|
||||
memset(iv, 0, sizeof(iv));
|
||||
res1 = eay_bf_encrypt(&data, &key, (caddr_t)iv);
|
||||
memcpy(iv->v, iv0.v, 8);
|
||||
res1 = eay_bf_encrypt(&data, &key, iv);
|
||||
printf("encrypto:\n");
|
||||
PVDUMP(res1);
|
||||
|
||||
memset(iv, 0, sizeof(iv));
|
||||
res2 = eay_bf_decrypt(res1, &key, (caddr_t)iv);
|
||||
memcpy(iv->v, iv0.v, 8);
|
||||
res2 = eay_bf_decrypt(res1, &key, iv);
|
||||
printf("decrypto:\n");
|
||||
PVDUMP(res2);
|
||||
|
||||
if (memcmp(data.v, res2->v, data.l))
|
||||
printf("XXX NG XXX\n");
|
||||
vfree(res1);
|
||||
vfree(res2);
|
||||
#endif
|
||||
@ -385,16 +401,20 @@ ciphertest()
|
||||
printf("data:\n");
|
||||
PVDUMP(&data);
|
||||
|
||||
memset(iv, 0, sizeof(iv));
|
||||
res1 = eay_3des_encrypt(&data, &key, (caddr_t)iv);
|
||||
memcpy(iv->v, iv0.v, 8);
|
||||
res1 = eay_3des_encrypt(&data, &key, iv);
|
||||
printf("encrypto:\n");
|
||||
PVDUMP(res1);
|
||||
if (res1)
|
||||
PVDUMP(res1);
|
||||
|
||||
memset(iv, 0, sizeof(iv));
|
||||
res2 = eay_3des_decrypt(res1, &key, (caddr_t)iv);
|
||||
memcpy(iv->v, iv0.v, 8);
|
||||
res2 = eay_3des_decrypt(res1, &key, iv);
|
||||
printf("decrypto:\n");
|
||||
PVDUMP(res2);
|
||||
if (res1)
|
||||
PVDUMP(res2);
|
||||
|
||||
if (res2 && memcmp(data.v, res2->v, data.l))
|
||||
printf("XXX NG XXX\n");
|
||||
vfree(res1);
|
||||
vfree(res2);
|
||||
|
||||
@ -403,18 +423,49 @@ ciphertest()
|
||||
printf("data:\n");
|
||||
PVDUMP(&data);
|
||||
|
||||
memset(iv, 0, sizeof(iv));
|
||||
res1 = eay_cast_encrypt(&data, &key, (caddr_t)iv);
|
||||
memcpy(iv->v, iv0.v, 8);
|
||||
res1 = eay_cast_encrypt(&data, &key, iv);
|
||||
printf("encrypto:\n");
|
||||
PVDUMP(res1);
|
||||
|
||||
memset(iv, 0, sizeof(iv));
|
||||
res2 = eay_cast_decrypt(res1, &key, (caddr_t)iv);
|
||||
memcpy(iv->v, iv0.v, 8);
|
||||
res2 = eay_cast_decrypt(res1, &key, iv);
|
||||
printf("decrypto:\n");
|
||||
PVDUMP(res2);
|
||||
|
||||
if (memcmp(data.v, res2->v, data.l))
|
||||
printf("XXX NG XXX\n");
|
||||
vfree(res1);
|
||||
vfree(res2);
|
||||
|
||||
/* aes */
|
||||
iv = vrealloc(iv, 16);
|
||||
|
||||
printf("AES\n");
|
||||
printf("data:\n");
|
||||
PVDUMP(&data);
|
||||
|
||||
{
|
||||
vchar_t *buf;
|
||||
int padlen = 16 - data.l % 16;
|
||||
buf = vmalloc(data.l + padlen);
|
||||
memcpy(buf->v, data.v, data.l);
|
||||
|
||||
memcpy(iv->v, iv0.v, 16);
|
||||
res1 = eay_aes_encrypt(buf, &key, iv);
|
||||
printf("encrypto:\n");
|
||||
PVDUMP(res1);
|
||||
|
||||
memcpy(iv->v, iv0.v, 16);
|
||||
res2 = eay_aes_decrypt(res1, &key, iv);
|
||||
printf("decrypto:\n");
|
||||
PVDUMP(res2);
|
||||
|
||||
if (memcmp(data.v, res2->v, data.l))
|
||||
printf("XXX NG XXX\n");
|
||||
vfree(res1);
|
||||
vfree(res2);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -426,6 +477,7 @@ hmactest()
|
||||
char *object2 = "8bb74958b9fee94e";
|
||||
char *r_hmd5 = "5702d7d1 fd1bfc7e 210fc9fa cda7d02c";
|
||||
char *r_hsha1 = "309999aa 9779a43e ebdea839 1b4e7ee1 d8646874";
|
||||
char *r_hsha2 = "d47262d8 a5b6f39d d8686939 411b3e79 ed2e27f9 2c4ea89f dd0a06ae 0c0aa396";
|
||||
vchar_t *key, *data, *data1, *data2, *res;
|
||||
vchar_t mod;
|
||||
caddr_t ctx;
|
||||
@ -465,6 +517,16 @@ hmactest()
|
||||
free(mod.v);
|
||||
vfree(res);
|
||||
|
||||
/* HMAC SHA2 */
|
||||
printf("HMAC SHA2 by eay_hmacsha2_256_one()\n");
|
||||
res = eay_hmacsha2_256_one(key, data);
|
||||
PVDUMP(res);
|
||||
mod.v = str2val(r_hsha2, 16, &mod.l);
|
||||
if (memcmp(res->v, mod.v, mod.l))
|
||||
printf(" XXX NG XXX\n");
|
||||
free(mod.v);
|
||||
vfree(res);
|
||||
|
||||
/* HMAC SHA1 */
|
||||
printf("HMAC SHA1 by eay_hmacsha1_one()\n");
|
||||
res = eay_hmacsha1_one(key, data);
|
||||
|
19
crypto/dist/kame/racoon/grabmyaddr.c
vendored
19
crypto/dist/kame/racoon/grabmyaddr.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: grabmyaddr.c,v 1.26 2001/04/03 15:51:55 thorpej Exp $ */
|
||||
/* $KAME: grabmyaddr.c,v 1.27 2001/08/16 14:37:28 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -114,21 +114,16 @@ find_myaddr(db, p)
|
||||
{
|
||||
struct myaddrs *q;
|
||||
char h1[NI_MAXHOST], h2[NI_MAXHOST];
|
||||
#ifdef NI_WITHSCOPEID
|
||||
const int niflags = NI_NUMERICHOST | NI_WITHSCOPEID;
|
||||
#else
|
||||
const int niflags = NI_NUMERICHOST;
|
||||
#endif
|
||||
|
||||
if (getnameinfo(p->addr, p->addr->sa_len, h1, sizeof(h1), NULL, 0,
|
||||
niflags) != 0)
|
||||
NI_NUMERICHOST | niflags) != 0)
|
||||
return NULL;
|
||||
|
||||
for (q = db; q; q = q->next) {
|
||||
if (p->addr->sa_len != q->addr->sa_len)
|
||||
continue;
|
||||
if (getnameinfo(q->addr, q->addr->sa_len, h2, sizeof(h2),
|
||||
NULL, 0, niflags) != 0)
|
||||
NULL, 0, NI_NUMERICHOST | niflags) != 0)
|
||||
return NULL;
|
||||
if (strcmp(h1, h2) == 0)
|
||||
return q;
|
||||
@ -387,7 +382,7 @@ suitable_ifaddr6(ifname, ifaddr)
|
||||
memset(&ifr6, 0, sizeof(ifr6));
|
||||
strncpy(ifr6.ifr_name, ifname, strlen(ifname));
|
||||
|
||||
ifr6.ifr_addr = *(struct sockaddr_in6 *)ifaddr;
|
||||
ifr6.ifr_addr = *(const struct sockaddr_in6 *)ifaddr;
|
||||
|
||||
if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) < 0) {
|
||||
plog(LLV_ERROR, LOCATION, NULL,
|
||||
@ -468,7 +463,7 @@ int
|
||||
autoconf_myaddrsport()
|
||||
{
|
||||
struct myaddrs *p;
|
||||
struct sockaddr_in *sin;
|
||||
struct sockaddr_in *sin4;
|
||||
#ifdef INET6
|
||||
struct sockaddr_in6 *sin6;
|
||||
#endif
|
||||
@ -480,8 +475,8 @@ autoconf_myaddrsport()
|
||||
for (p = lcconf->myaddrs; p; p = p->next) {
|
||||
switch (p->addr->sa_family) {
|
||||
case AF_INET:
|
||||
sin = (struct sockaddr_in *)p->addr;
|
||||
sin->sin_port = htons(lcconf->port_isakmp);
|
||||
sin4 = (struct sockaddr_in *)p->addr;
|
||||
sin4->sin_port = htons(lcconf->port_isakmp);
|
||||
break;
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
|
6
crypto/dist/kame/racoon/ipsec_doi.h
vendored
6
crypto/dist/kame/racoon/ipsec_doi.h
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: ipsec_doi.h,v 1.32 2001/04/06 14:23:48 sakane Exp $ */
|
||||
/* $KAME: ipsec_doi.h,v 1.34 2001/08/16 06:20:35 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -97,7 +97,6 @@
|
||||
#define IPSECDOI_ATTR_GRP_DESC 3 /* B */
|
||||
#define IPSECDOI_ATTR_ENC_MODE 4 /* B */
|
||||
/* default value: host dependent */
|
||||
#define IPSECDOI_ATTR_ENC_MODE_DEFAULT 2 /* NOTE:internal use */
|
||||
#define IPSECDOI_ATTR_ENC_MODE_ANY 0 /* NOTE:internal use */
|
||||
#define IPSECDOI_ATTR_ENC_MODE_TUNNEL 1
|
||||
#define IPSECDOI_ATTR_ENC_MODE_TRNS 2
|
||||
@ -107,6 +106,9 @@
|
||||
#define IPSECDOI_ATTR_AUTH_HMAC_SHA1 2
|
||||
#define IPSECDOI_ATTR_AUTH_DES_MAC 3
|
||||
#define IPSECDOI_ATTR_AUTH_KPDK 4 /*RFC-1826(Key/Pad/Data/Key)*/
|
||||
#define IPSECDOI_ATTR_SHA2_256 5
|
||||
#define IPSECDOI_ATTR_SHA2_384 6
|
||||
#define IPSECDOI_ATTR_SHA2_512 7
|
||||
#define IPSECDOI_ATTR_AUTH_NONE 254 /* NOTE:internal use */
|
||||
/*
|
||||
* When negotiating ESP without authentication, the Auth
|
||||
|
4
crypto/dist/kame/racoon/isakmp_ident.c
vendored
4
crypto/dist/kame/racoon/isakmp_ident.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: isakmp_ident.c,v 1.55 2001/03/27 02:46:05 thorpej Exp $ */
|
||||
/* $KAME: isakmp_ident.c,v 1.56 2001/08/17 06:58:59 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -1207,7 +1207,7 @@ ident_r3recv(iph1, msg0)
|
||||
* payload's.
|
||||
*/
|
||||
|
||||
plog(LLV_DEBUG, LOCATION, iph1->remote, "peer's ID ");
|
||||
plog(LLV_DEBUG, LOCATION, iph1->remote, "peer's ID\n");
|
||||
plogdump(LLV_DEBUG, iph1->id_p->v, iph1->id_p->l);
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
|
16
crypto/dist/kame/racoon/isakmp_inf.c
vendored
16
crypto/dist/kame/racoon/isakmp_inf.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: isakmp_inf.c,v 1.70 2001/04/03 15:51:55 thorpej Exp $ */
|
||||
/* $KAME: isakmp_inf.c,v 1.71 2001/08/07 14:29:50 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -1050,11 +1050,17 @@ info_recv_initialcontact(iph1)
|
||||
}
|
||||
|
||||
/*
|
||||
* If the remote address matchs with src or dst of SA,
|
||||
* then delete the SA.
|
||||
* RFC2407 4.6.3.3 INITIAL-CONTACT is the message that
|
||||
* announces the peer the sender of the message was rebooted.
|
||||
* it is interpreted to delete all SAs which source address
|
||||
* is the sender of the message.
|
||||
* but racoon only deletes SA which is matched both the
|
||||
* source address and the destination accress.
|
||||
*/
|
||||
if (cmpsaddrwop(iph1->remote, src)
|
||||
&& cmpsaddrwop(iph1->remote, dst)) {
|
||||
if ((cmpsaddrwop(iph1->local, src)
|
||||
&& cmpsaddrwop(iph1->remote, dst))
|
||||
|| (cmpsaddrwop(iph1->remote, src)
|
||||
&& cmpsaddrwop(iph1->local, dst))) {
|
||||
msg = next;
|
||||
continue;
|
||||
}
|
||||
|
7
crypto/dist/kame/racoon/localconf.c
vendored
7
crypto/dist/kame/racoon/localconf.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: localconf.c,v 1.32 2001/06/01 08:26:05 sakane Exp $ */
|
||||
/* $KAME: localconf.c,v 1.33 2001/08/09 07:32:19 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -69,10 +69,6 @@ initlcconf()
|
||||
if (lcconf == NULL)
|
||||
errx(1, "failed to allocate local conf.");
|
||||
|
||||
lcconf->algstrength = initalgstrength();
|
||||
if (lcconf->algstrength == NULL)
|
||||
errx(1, "failed to allocate algorithm strength.");
|
||||
|
||||
setdefault();
|
||||
|
||||
lcconf->racoon_conf = LC_DEFAULT_CF;
|
||||
@ -96,7 +92,6 @@ flushlcconf()
|
||||
vfree(lcconf->ident[i]);
|
||||
lcconf->ident[i] = NULL;
|
||||
}
|
||||
flushalgstrength(lcconf->algstrength);
|
||||
}
|
||||
|
||||
static void
|
||||
|
10
crypto/dist/kame/racoon/localconf.h
vendored
10
crypto/dist/kame/racoon/localconf.h
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: localconf.h,v 1.26 2001/03/27 02:39:57 thorpej Exp $ */
|
||||
/* $KAME: localconf.h,v 1.27 2001/08/09 07:32:19 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -31,8 +31,6 @@
|
||||
|
||||
/* local configuration */
|
||||
|
||||
/* must include algstrength.h first. */
|
||||
|
||||
#define LC_DEFAULT_CF SYSCONFDIR "/racoon.conf"
|
||||
|
||||
#define LC_PATHTYPE_INCLUDE 0
|
||||
@ -90,12 +88,6 @@ struct localconf {
|
||||
int secret_size;
|
||||
int strict_address; /* strictly check addresses. */
|
||||
|
||||
struct algorithm_strength **algstrength;
|
||||
/*
|
||||
* There is a different both of the number and the kind of
|
||||
* algorithms between oakley's and ipsec_doi's.
|
||||
*/
|
||||
|
||||
int complex_bundle;
|
||||
/*
|
||||
* If we want to make a packet "IP2 AH ESP IP1 ULP",
|
||||
|
8
crypto/dist/kame/racoon/misc.c
vendored
8
crypto/dist/kame/racoon/misc.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: misc.c,v 1.22 2001/07/14 05:48:33 sakane Exp $ */
|
||||
/* $KAME: misc.c,v 1.23 2001/08/16 14:37:29 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -111,12 +111,12 @@ bit2str(n, bl)
|
||||
|
||||
const char *
|
||||
debug_location(file, line, func)
|
||||
char *file;
|
||||
const char *file;
|
||||
int line;
|
||||
char *func;
|
||||
const char *func;
|
||||
{
|
||||
static char buf[1024];
|
||||
char *p;
|
||||
const char *p;
|
||||
|
||||
/* truncate pathname */
|
||||
p = strrchr(file, '/');
|
||||
|
4
crypto/dist/kame/racoon/misc.h
vendored
4
crypto/dist/kame/racoon/misc.h
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: misc.h,v 1.11 2001/07/14 05:48:33 sakane Exp $ */
|
||||
/* $KAME: misc.h,v 1.12 2001/08/16 14:37:29 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -40,7 +40,7 @@
|
||||
extern int hexdump __P((void *, size_t));
|
||||
extern char *bit2str __P((int, int));
|
||||
extern void *get_newbuf __P((void *, size_t));
|
||||
extern const char *debug_location __P((char *, int, char *));
|
||||
extern const char *debug_location __P((const char *, int, const char *));
|
||||
extern int getfsize __P((char *));
|
||||
struct timeval;
|
||||
extern double timedelta __P((struct timeval *, struct timeval *));
|
||||
|
957
crypto/dist/kame/racoon/missing/crypto/rijndael/boxes-fst.dat
vendored
Normal file
957
crypto/dist/kame/racoon/missing/crypto/rijndael/boxes-fst.dat
vendored
Normal file
@ -0,0 +1,957 @@
|
||||
/* $KAME: boxes-fst.dat,v 1.1.1.1 2001/08/08 09:56:27 sakane Exp $ */
|
||||
|
||||
const word8 S[256] = {
|
||||
99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118,
|
||||
202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192,
|
||||
183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21,
|
||||
4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117,
|
||||
9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132,
|
||||
83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207,
|
||||
208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168,
|
||||
81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210,
|
||||
205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115,
|
||||
96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219,
|
||||
224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121,
|
||||
231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8,
|
||||
186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138,
|
||||
112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158,
|
||||
225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223,
|
||||
140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22
|
||||
};
|
||||
|
||||
#ifdef INTERMEDIATE_VALUE_KAT
|
||||
static const word8 Si[256] = {
|
||||
82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251,
|
||||
124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203,
|
||||
84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78,
|
||||
8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37,
|
||||
114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146,
|
||||
108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132,
|
||||
144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6,
|
||||
208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107,
|
||||
58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115,
|
||||
150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110,
|
||||
71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27,
|
||||
252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244,
|
||||
31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95,
|
||||
96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239,
|
||||
160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97,
|
||||
23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125
|
||||
};
|
||||
#endif /* INTERMEDIATE_VALUE_KAT */
|
||||
|
||||
union xtab {
|
||||
word32 xt32[256];
|
||||
word8 xt8[256][4];
|
||||
};
|
||||
|
||||
static const union xtab xT1 = {
|
||||
.xt8 = {
|
||||
{0xc6,0x63,0x63,0xa5}, {0xf8,0x7c,0x7c,0x84}, {0xee,0x77,0x77,0x99}, {0xf6,0x7b,0x7b,0x8d},
|
||||
{0xff,0xf2,0xf2,0x0d}, {0xd6,0x6b,0x6b,0xbd}, {0xde,0x6f,0x6f,0xb1}, {0x91,0xc5,0xc5,0x54},
|
||||
{0x60,0x30,0x30,0x50}, {0x02,0x01,0x01,0x03}, {0xce,0x67,0x67,0xa9}, {0x56,0x2b,0x2b,0x7d},
|
||||
{0xe7,0xfe,0xfe,0x19}, {0xb5,0xd7,0xd7,0x62}, {0x4d,0xab,0xab,0xe6}, {0xec,0x76,0x76,0x9a},
|
||||
{0x8f,0xca,0xca,0x45}, {0x1f,0x82,0x82,0x9d}, {0x89,0xc9,0xc9,0x40}, {0xfa,0x7d,0x7d,0x87},
|
||||
{0xef,0xfa,0xfa,0x15}, {0xb2,0x59,0x59,0xeb}, {0x8e,0x47,0x47,0xc9}, {0xfb,0xf0,0xf0,0x0b},
|
||||
{0x41,0xad,0xad,0xec}, {0xb3,0xd4,0xd4,0x67}, {0x5f,0xa2,0xa2,0xfd}, {0x45,0xaf,0xaf,0xea},
|
||||
{0x23,0x9c,0x9c,0xbf}, {0x53,0xa4,0xa4,0xf7}, {0xe4,0x72,0x72,0x96}, {0x9b,0xc0,0xc0,0x5b},
|
||||
{0x75,0xb7,0xb7,0xc2}, {0xe1,0xfd,0xfd,0x1c}, {0x3d,0x93,0x93,0xae}, {0x4c,0x26,0x26,0x6a},
|
||||
{0x6c,0x36,0x36,0x5a}, {0x7e,0x3f,0x3f,0x41}, {0xf5,0xf7,0xf7,0x02}, {0x83,0xcc,0xcc,0x4f},
|
||||
{0x68,0x34,0x34,0x5c}, {0x51,0xa5,0xa5,0xf4}, {0xd1,0xe5,0xe5,0x34}, {0xf9,0xf1,0xf1,0x08},
|
||||
{0xe2,0x71,0x71,0x93}, {0xab,0xd8,0xd8,0x73}, {0x62,0x31,0x31,0x53}, {0x2a,0x15,0x15,0x3f},
|
||||
{0x08,0x04,0x04,0x0c}, {0x95,0xc7,0xc7,0x52}, {0x46,0x23,0x23,0x65}, {0x9d,0xc3,0xc3,0x5e},
|
||||
{0x30,0x18,0x18,0x28}, {0x37,0x96,0x96,0xa1}, {0x0a,0x05,0x05,0x0f}, {0x2f,0x9a,0x9a,0xb5},
|
||||
{0x0e,0x07,0x07,0x09}, {0x24,0x12,0x12,0x36}, {0x1b,0x80,0x80,0x9b}, {0xdf,0xe2,0xe2,0x3d},
|
||||
{0xcd,0xeb,0xeb,0x26}, {0x4e,0x27,0x27,0x69}, {0x7f,0xb2,0xb2,0xcd}, {0xea,0x75,0x75,0x9f},
|
||||
{0x12,0x09,0x09,0x1b}, {0x1d,0x83,0x83,0x9e}, {0x58,0x2c,0x2c,0x74}, {0x34,0x1a,0x1a,0x2e},
|
||||
{0x36,0x1b,0x1b,0x2d}, {0xdc,0x6e,0x6e,0xb2}, {0xb4,0x5a,0x5a,0xee}, {0x5b,0xa0,0xa0,0xfb},
|
||||
{0xa4,0x52,0x52,0xf6}, {0x76,0x3b,0x3b,0x4d}, {0xb7,0xd6,0xd6,0x61}, {0x7d,0xb3,0xb3,0xce},
|
||||
{0x52,0x29,0x29,0x7b}, {0xdd,0xe3,0xe3,0x3e}, {0x5e,0x2f,0x2f,0x71}, {0x13,0x84,0x84,0x97},
|
||||
{0xa6,0x53,0x53,0xf5}, {0xb9,0xd1,0xd1,0x68}, {0x00,0x00,0x00,0x00}, {0xc1,0xed,0xed,0x2c},
|
||||
{0x40,0x20,0x20,0x60}, {0xe3,0xfc,0xfc,0x1f}, {0x79,0xb1,0xb1,0xc8}, {0xb6,0x5b,0x5b,0xed},
|
||||
{0xd4,0x6a,0x6a,0xbe}, {0x8d,0xcb,0xcb,0x46}, {0x67,0xbe,0xbe,0xd9}, {0x72,0x39,0x39,0x4b},
|
||||
{0x94,0x4a,0x4a,0xde}, {0x98,0x4c,0x4c,0xd4}, {0xb0,0x58,0x58,0xe8}, {0x85,0xcf,0xcf,0x4a},
|
||||
{0xbb,0xd0,0xd0,0x6b}, {0xc5,0xef,0xef,0x2a}, {0x4f,0xaa,0xaa,0xe5}, {0xed,0xfb,0xfb,0x16},
|
||||
{0x86,0x43,0x43,0xc5}, {0x9a,0x4d,0x4d,0xd7}, {0x66,0x33,0x33,0x55}, {0x11,0x85,0x85,0x94},
|
||||
{0x8a,0x45,0x45,0xcf}, {0xe9,0xf9,0xf9,0x10}, {0x04,0x02,0x02,0x06}, {0xfe,0x7f,0x7f,0x81},
|
||||
{0xa0,0x50,0x50,0xf0}, {0x78,0x3c,0x3c,0x44}, {0x25,0x9f,0x9f,0xba}, {0x4b,0xa8,0xa8,0xe3},
|
||||
{0xa2,0x51,0x51,0xf3}, {0x5d,0xa3,0xa3,0xfe}, {0x80,0x40,0x40,0xc0}, {0x05,0x8f,0x8f,0x8a},
|
||||
{0x3f,0x92,0x92,0xad}, {0x21,0x9d,0x9d,0xbc}, {0x70,0x38,0x38,0x48}, {0xf1,0xf5,0xf5,0x04},
|
||||
{0x63,0xbc,0xbc,0xdf}, {0x77,0xb6,0xb6,0xc1}, {0xaf,0xda,0xda,0x75}, {0x42,0x21,0x21,0x63},
|
||||
{0x20,0x10,0x10,0x30}, {0xe5,0xff,0xff,0x1a}, {0xfd,0xf3,0xf3,0x0e}, {0xbf,0xd2,0xd2,0x6d},
|
||||
{0x81,0xcd,0xcd,0x4c}, {0x18,0x0c,0x0c,0x14}, {0x26,0x13,0x13,0x35}, {0xc3,0xec,0xec,0x2f},
|
||||
{0xbe,0x5f,0x5f,0xe1}, {0x35,0x97,0x97,0xa2}, {0x88,0x44,0x44,0xcc}, {0x2e,0x17,0x17,0x39},
|
||||
{0x93,0xc4,0xc4,0x57}, {0x55,0xa7,0xa7,0xf2}, {0xfc,0x7e,0x7e,0x82}, {0x7a,0x3d,0x3d,0x47},
|
||||
{0xc8,0x64,0x64,0xac}, {0xba,0x5d,0x5d,0xe7}, {0x32,0x19,0x19,0x2b}, {0xe6,0x73,0x73,0x95},
|
||||
{0xc0,0x60,0x60,0xa0}, {0x19,0x81,0x81,0x98}, {0x9e,0x4f,0x4f,0xd1}, {0xa3,0xdc,0xdc,0x7f},
|
||||
{0x44,0x22,0x22,0x66}, {0x54,0x2a,0x2a,0x7e}, {0x3b,0x90,0x90,0xab}, {0x0b,0x88,0x88,0x83},
|
||||
{0x8c,0x46,0x46,0xca}, {0xc7,0xee,0xee,0x29}, {0x6b,0xb8,0xb8,0xd3}, {0x28,0x14,0x14,0x3c},
|
||||
{0xa7,0xde,0xde,0x79}, {0xbc,0x5e,0x5e,0xe2}, {0x16,0x0b,0x0b,0x1d}, {0xad,0xdb,0xdb,0x76},
|
||||
{0xdb,0xe0,0xe0,0x3b}, {0x64,0x32,0x32,0x56}, {0x74,0x3a,0x3a,0x4e}, {0x14,0x0a,0x0a,0x1e},
|
||||
{0x92,0x49,0x49,0xdb}, {0x0c,0x06,0x06,0x0a}, {0x48,0x24,0x24,0x6c}, {0xb8,0x5c,0x5c,0xe4},
|
||||
{0x9f,0xc2,0xc2,0x5d}, {0xbd,0xd3,0xd3,0x6e}, {0x43,0xac,0xac,0xef}, {0xc4,0x62,0x62,0xa6},
|
||||
{0x39,0x91,0x91,0xa8}, {0x31,0x95,0x95,0xa4}, {0xd3,0xe4,0xe4,0x37}, {0xf2,0x79,0x79,0x8b},
|
||||
{0xd5,0xe7,0xe7,0x32}, {0x8b,0xc8,0xc8,0x43}, {0x6e,0x37,0x37,0x59}, {0xda,0x6d,0x6d,0xb7},
|
||||
{0x01,0x8d,0x8d,0x8c}, {0xb1,0xd5,0xd5,0x64}, {0x9c,0x4e,0x4e,0xd2}, {0x49,0xa9,0xa9,0xe0},
|
||||
{0xd8,0x6c,0x6c,0xb4}, {0xac,0x56,0x56,0xfa}, {0xf3,0xf4,0xf4,0x07}, {0xcf,0xea,0xea,0x25},
|
||||
{0xca,0x65,0x65,0xaf}, {0xf4,0x7a,0x7a,0x8e}, {0x47,0xae,0xae,0xe9}, {0x10,0x08,0x08,0x18},
|
||||
{0x6f,0xba,0xba,0xd5}, {0xf0,0x78,0x78,0x88}, {0x4a,0x25,0x25,0x6f}, {0x5c,0x2e,0x2e,0x72},
|
||||
{0x38,0x1c,0x1c,0x24}, {0x57,0xa6,0xa6,0xf1}, {0x73,0xb4,0xb4,0xc7}, {0x97,0xc6,0xc6,0x51},
|
||||
{0xcb,0xe8,0xe8,0x23}, {0xa1,0xdd,0xdd,0x7c}, {0xe8,0x74,0x74,0x9c}, {0x3e,0x1f,0x1f,0x21},
|
||||
{0x96,0x4b,0x4b,0xdd}, {0x61,0xbd,0xbd,0xdc}, {0x0d,0x8b,0x8b,0x86}, {0x0f,0x8a,0x8a,0x85},
|
||||
{0xe0,0x70,0x70,0x90}, {0x7c,0x3e,0x3e,0x42}, {0x71,0xb5,0xb5,0xc4}, {0xcc,0x66,0x66,0xaa},
|
||||
{0x90,0x48,0x48,0xd8}, {0x06,0x03,0x03,0x05}, {0xf7,0xf6,0xf6,0x01}, {0x1c,0x0e,0x0e,0x12},
|
||||
{0xc2,0x61,0x61,0xa3}, {0x6a,0x35,0x35,0x5f}, {0xae,0x57,0x57,0xf9}, {0x69,0xb9,0xb9,0xd0},
|
||||
{0x17,0x86,0x86,0x91}, {0x99,0xc1,0xc1,0x58}, {0x3a,0x1d,0x1d,0x27}, {0x27,0x9e,0x9e,0xb9},
|
||||
{0xd9,0xe1,0xe1,0x38}, {0xeb,0xf8,0xf8,0x13}, {0x2b,0x98,0x98,0xb3}, {0x22,0x11,0x11,0x33},
|
||||
{0xd2,0x69,0x69,0xbb}, {0xa9,0xd9,0xd9,0x70}, {0x07,0x8e,0x8e,0x89}, {0x33,0x94,0x94,0xa7},
|
||||
{0x2d,0x9b,0x9b,0xb6}, {0x3c,0x1e,0x1e,0x22}, {0x15,0x87,0x87,0x92}, {0xc9,0xe9,0xe9,0x20},
|
||||
{0x87,0xce,0xce,0x49}, {0xaa,0x55,0x55,0xff}, {0x50,0x28,0x28,0x78}, {0xa5,0xdf,0xdf,0x7a},
|
||||
{0x03,0x8c,0x8c,0x8f}, {0x59,0xa1,0xa1,0xf8}, {0x09,0x89,0x89,0x80}, {0x1a,0x0d,0x0d,0x17},
|
||||
{0x65,0xbf,0xbf,0xda}, {0xd7,0xe6,0xe6,0x31}, {0x84,0x42,0x42,0xc6}, {0xd0,0x68,0x68,0xb8},
|
||||
{0x82,0x41,0x41,0xc3}, {0x29,0x99,0x99,0xb0}, {0x5a,0x2d,0x2d,0x77}, {0x1e,0x0f,0x0f,0x11},
|
||||
{0x7b,0xb0,0xb0,0xcb}, {0xa8,0x54,0x54,0xfc}, {0x6d,0xbb,0xbb,0xd6}, {0x2c,0x16,0x16,0x3a}
|
||||
}
|
||||
};
|
||||
#define T1 xT1.xt8
|
||||
|
||||
static const union xtab xT2 = {
|
||||
.xt8 = {
|
||||
{0xa5,0xc6,0x63,0x63}, {0x84,0xf8,0x7c,0x7c}, {0x99,0xee,0x77,0x77}, {0x8d,0xf6,0x7b,0x7b},
|
||||
{0x0d,0xff,0xf2,0xf2}, {0xbd,0xd6,0x6b,0x6b}, {0xb1,0xde,0x6f,0x6f}, {0x54,0x91,0xc5,0xc5},
|
||||
{0x50,0x60,0x30,0x30}, {0x03,0x02,0x01,0x01}, {0xa9,0xce,0x67,0x67}, {0x7d,0x56,0x2b,0x2b},
|
||||
{0x19,0xe7,0xfe,0xfe}, {0x62,0xb5,0xd7,0xd7}, {0xe6,0x4d,0xab,0xab}, {0x9a,0xec,0x76,0x76},
|
||||
{0x45,0x8f,0xca,0xca}, {0x9d,0x1f,0x82,0x82}, {0x40,0x89,0xc9,0xc9}, {0x87,0xfa,0x7d,0x7d},
|
||||
{0x15,0xef,0xfa,0xfa}, {0xeb,0xb2,0x59,0x59}, {0xc9,0x8e,0x47,0x47}, {0x0b,0xfb,0xf0,0xf0},
|
||||
{0xec,0x41,0xad,0xad}, {0x67,0xb3,0xd4,0xd4}, {0xfd,0x5f,0xa2,0xa2}, {0xea,0x45,0xaf,0xaf},
|
||||
{0xbf,0x23,0x9c,0x9c}, {0xf7,0x53,0xa4,0xa4}, {0x96,0xe4,0x72,0x72}, {0x5b,0x9b,0xc0,0xc0},
|
||||
{0xc2,0x75,0xb7,0xb7}, {0x1c,0xe1,0xfd,0xfd}, {0xae,0x3d,0x93,0x93}, {0x6a,0x4c,0x26,0x26},
|
||||
{0x5a,0x6c,0x36,0x36}, {0x41,0x7e,0x3f,0x3f}, {0x02,0xf5,0xf7,0xf7}, {0x4f,0x83,0xcc,0xcc},
|
||||
{0x5c,0x68,0x34,0x34}, {0xf4,0x51,0xa5,0xa5}, {0x34,0xd1,0xe5,0xe5}, {0x08,0xf9,0xf1,0xf1},
|
||||
{0x93,0xe2,0x71,0x71}, {0x73,0xab,0xd8,0xd8}, {0x53,0x62,0x31,0x31}, {0x3f,0x2a,0x15,0x15},
|
||||
{0x0c,0x08,0x04,0x04}, {0x52,0x95,0xc7,0xc7}, {0x65,0x46,0x23,0x23}, {0x5e,0x9d,0xc3,0xc3},
|
||||
{0x28,0x30,0x18,0x18}, {0xa1,0x37,0x96,0x96}, {0x0f,0x0a,0x05,0x05}, {0xb5,0x2f,0x9a,0x9a},
|
||||
{0x09,0x0e,0x07,0x07}, {0x36,0x24,0x12,0x12}, {0x9b,0x1b,0x80,0x80}, {0x3d,0xdf,0xe2,0xe2},
|
||||
{0x26,0xcd,0xeb,0xeb}, {0x69,0x4e,0x27,0x27}, {0xcd,0x7f,0xb2,0xb2}, {0x9f,0xea,0x75,0x75},
|
||||
{0x1b,0x12,0x09,0x09}, {0x9e,0x1d,0x83,0x83}, {0x74,0x58,0x2c,0x2c}, {0x2e,0x34,0x1a,0x1a},
|
||||
{0x2d,0x36,0x1b,0x1b}, {0xb2,0xdc,0x6e,0x6e}, {0xee,0xb4,0x5a,0x5a}, {0xfb,0x5b,0xa0,0xa0},
|
||||
{0xf6,0xa4,0x52,0x52}, {0x4d,0x76,0x3b,0x3b}, {0x61,0xb7,0xd6,0xd6}, {0xce,0x7d,0xb3,0xb3},
|
||||
{0x7b,0x52,0x29,0x29}, {0x3e,0xdd,0xe3,0xe3}, {0x71,0x5e,0x2f,0x2f}, {0x97,0x13,0x84,0x84},
|
||||
{0xf5,0xa6,0x53,0x53}, {0x68,0xb9,0xd1,0xd1}, {0x00,0x00,0x00,0x00}, {0x2c,0xc1,0xed,0xed},
|
||||
{0x60,0x40,0x20,0x20}, {0x1f,0xe3,0xfc,0xfc}, {0xc8,0x79,0xb1,0xb1}, {0xed,0xb6,0x5b,0x5b},
|
||||
{0xbe,0xd4,0x6a,0x6a}, {0x46,0x8d,0xcb,0xcb}, {0xd9,0x67,0xbe,0xbe}, {0x4b,0x72,0x39,0x39},
|
||||
{0xde,0x94,0x4a,0x4a}, {0xd4,0x98,0x4c,0x4c}, {0xe8,0xb0,0x58,0x58}, {0x4a,0x85,0xcf,0xcf},
|
||||
{0x6b,0xbb,0xd0,0xd0}, {0x2a,0xc5,0xef,0xef}, {0xe5,0x4f,0xaa,0xaa}, {0x16,0xed,0xfb,0xfb},
|
||||
{0xc5,0x86,0x43,0x43}, {0xd7,0x9a,0x4d,0x4d}, {0x55,0x66,0x33,0x33}, {0x94,0x11,0x85,0x85},
|
||||
{0xcf,0x8a,0x45,0x45}, {0x10,0xe9,0xf9,0xf9}, {0x06,0x04,0x02,0x02}, {0x81,0xfe,0x7f,0x7f},
|
||||
{0xf0,0xa0,0x50,0x50}, {0x44,0x78,0x3c,0x3c}, {0xba,0x25,0x9f,0x9f}, {0xe3,0x4b,0xa8,0xa8},
|
||||
{0xf3,0xa2,0x51,0x51}, {0xfe,0x5d,0xa3,0xa3}, {0xc0,0x80,0x40,0x40}, {0x8a,0x05,0x8f,0x8f},
|
||||
{0xad,0x3f,0x92,0x92}, {0xbc,0x21,0x9d,0x9d}, {0x48,0x70,0x38,0x38}, {0x04,0xf1,0xf5,0xf5},
|
||||
{0xdf,0x63,0xbc,0xbc}, {0xc1,0x77,0xb6,0xb6}, {0x75,0xaf,0xda,0xda}, {0x63,0x42,0x21,0x21},
|
||||
{0x30,0x20,0x10,0x10}, {0x1a,0xe5,0xff,0xff}, {0x0e,0xfd,0xf3,0xf3}, {0x6d,0xbf,0xd2,0xd2},
|
||||
{0x4c,0x81,0xcd,0xcd}, {0x14,0x18,0x0c,0x0c}, {0x35,0x26,0x13,0x13}, {0x2f,0xc3,0xec,0xec},
|
||||
{0xe1,0xbe,0x5f,0x5f}, {0xa2,0x35,0x97,0x97}, {0xcc,0x88,0x44,0x44}, {0x39,0x2e,0x17,0x17},
|
||||
{0x57,0x93,0xc4,0xc4}, {0xf2,0x55,0xa7,0xa7}, {0x82,0xfc,0x7e,0x7e}, {0x47,0x7a,0x3d,0x3d},
|
||||
{0xac,0xc8,0x64,0x64}, {0xe7,0xba,0x5d,0x5d}, {0x2b,0x32,0x19,0x19}, {0x95,0xe6,0x73,0x73},
|
||||
{0xa0,0xc0,0x60,0x60}, {0x98,0x19,0x81,0x81}, {0xd1,0x9e,0x4f,0x4f}, {0x7f,0xa3,0xdc,0xdc},
|
||||
{0x66,0x44,0x22,0x22}, {0x7e,0x54,0x2a,0x2a}, {0xab,0x3b,0x90,0x90}, {0x83,0x0b,0x88,0x88},
|
||||
{0xca,0x8c,0x46,0x46}, {0x29,0xc7,0xee,0xee}, {0xd3,0x6b,0xb8,0xb8}, {0x3c,0x28,0x14,0x14},
|
||||
{0x79,0xa7,0xde,0xde}, {0xe2,0xbc,0x5e,0x5e}, {0x1d,0x16,0x0b,0x0b}, {0x76,0xad,0xdb,0xdb},
|
||||
{0x3b,0xdb,0xe0,0xe0}, {0x56,0x64,0x32,0x32}, {0x4e,0x74,0x3a,0x3a}, {0x1e,0x14,0x0a,0x0a},
|
||||
{0xdb,0x92,0x49,0x49}, {0x0a,0x0c,0x06,0x06}, {0x6c,0x48,0x24,0x24}, {0xe4,0xb8,0x5c,0x5c},
|
||||
{0x5d,0x9f,0xc2,0xc2}, {0x6e,0xbd,0xd3,0xd3}, {0xef,0x43,0xac,0xac}, {0xa6,0xc4,0x62,0x62},
|
||||
{0xa8,0x39,0x91,0x91}, {0xa4,0x31,0x95,0x95}, {0x37,0xd3,0xe4,0xe4}, {0x8b,0xf2,0x79,0x79},
|
||||
{0x32,0xd5,0xe7,0xe7}, {0x43,0x8b,0xc8,0xc8}, {0x59,0x6e,0x37,0x37}, {0xb7,0xda,0x6d,0x6d},
|
||||
{0x8c,0x01,0x8d,0x8d}, {0x64,0xb1,0xd5,0xd5}, {0xd2,0x9c,0x4e,0x4e}, {0xe0,0x49,0xa9,0xa9},
|
||||
{0xb4,0xd8,0x6c,0x6c}, {0xfa,0xac,0x56,0x56}, {0x07,0xf3,0xf4,0xf4}, {0x25,0xcf,0xea,0xea},
|
||||
{0xaf,0xca,0x65,0x65}, {0x8e,0xf4,0x7a,0x7a}, {0xe9,0x47,0xae,0xae}, {0x18,0x10,0x08,0x08},
|
||||
{0xd5,0x6f,0xba,0xba}, {0x88,0xf0,0x78,0x78}, {0x6f,0x4a,0x25,0x25}, {0x72,0x5c,0x2e,0x2e},
|
||||
{0x24,0x38,0x1c,0x1c}, {0xf1,0x57,0xa6,0xa6}, {0xc7,0x73,0xb4,0xb4}, {0x51,0x97,0xc6,0xc6},
|
||||
{0x23,0xcb,0xe8,0xe8}, {0x7c,0xa1,0xdd,0xdd}, {0x9c,0xe8,0x74,0x74}, {0x21,0x3e,0x1f,0x1f},
|
||||
{0xdd,0x96,0x4b,0x4b}, {0xdc,0x61,0xbd,0xbd}, {0x86,0x0d,0x8b,0x8b}, {0x85,0x0f,0x8a,0x8a},
|
||||
{0x90,0xe0,0x70,0x70}, {0x42,0x7c,0x3e,0x3e}, {0xc4,0x71,0xb5,0xb5}, {0xaa,0xcc,0x66,0x66},
|
||||
{0xd8,0x90,0x48,0x48}, {0x05,0x06,0x03,0x03}, {0x01,0xf7,0xf6,0xf6}, {0x12,0x1c,0x0e,0x0e},
|
||||
{0xa3,0xc2,0x61,0x61}, {0x5f,0x6a,0x35,0x35}, {0xf9,0xae,0x57,0x57}, {0xd0,0x69,0xb9,0xb9},
|
||||
{0x91,0x17,0x86,0x86}, {0x58,0x99,0xc1,0xc1}, {0x27,0x3a,0x1d,0x1d}, {0xb9,0x27,0x9e,0x9e},
|
||||
{0x38,0xd9,0xe1,0xe1}, {0x13,0xeb,0xf8,0xf8}, {0xb3,0x2b,0x98,0x98}, {0x33,0x22,0x11,0x11},
|
||||
{0xbb,0xd2,0x69,0x69}, {0x70,0xa9,0xd9,0xd9}, {0x89,0x07,0x8e,0x8e}, {0xa7,0x33,0x94,0x94},
|
||||
{0xb6,0x2d,0x9b,0x9b}, {0x22,0x3c,0x1e,0x1e}, {0x92,0x15,0x87,0x87}, {0x20,0xc9,0xe9,0xe9},
|
||||
{0x49,0x87,0xce,0xce}, {0xff,0xaa,0x55,0x55}, {0x78,0x50,0x28,0x28}, {0x7a,0xa5,0xdf,0xdf},
|
||||
{0x8f,0x03,0x8c,0x8c}, {0xf8,0x59,0xa1,0xa1}, {0x80,0x09,0x89,0x89}, {0x17,0x1a,0x0d,0x0d},
|
||||
{0xda,0x65,0xbf,0xbf}, {0x31,0xd7,0xe6,0xe6}, {0xc6,0x84,0x42,0x42}, {0xb8,0xd0,0x68,0x68},
|
||||
{0xc3,0x82,0x41,0x41}, {0xb0,0x29,0x99,0x99}, {0x77,0x5a,0x2d,0x2d}, {0x11,0x1e,0x0f,0x0f},
|
||||
{0xcb,0x7b,0xb0,0xb0}, {0xfc,0xa8,0x54,0x54}, {0xd6,0x6d,0xbb,0xbb}, {0x3a,0x2c,0x16,0x16}
|
||||
}
|
||||
};
|
||||
#define T2 xT2.xt8
|
||||
|
||||
static const union xtab xT3 = {
|
||||
.xt8 = {
|
||||
{0x63,0xa5,0xc6,0x63}, {0x7c,0x84,0xf8,0x7c}, {0x77,0x99,0xee,0x77}, {0x7b,0x8d,0xf6,0x7b},
|
||||
{0xf2,0x0d,0xff,0xf2}, {0x6b,0xbd,0xd6,0x6b}, {0x6f,0xb1,0xde,0x6f}, {0xc5,0x54,0x91,0xc5},
|
||||
{0x30,0x50,0x60,0x30}, {0x01,0x03,0x02,0x01}, {0x67,0xa9,0xce,0x67}, {0x2b,0x7d,0x56,0x2b},
|
||||
{0xfe,0x19,0xe7,0xfe}, {0xd7,0x62,0xb5,0xd7}, {0xab,0xe6,0x4d,0xab}, {0x76,0x9a,0xec,0x76},
|
||||
{0xca,0x45,0x8f,0xca}, {0x82,0x9d,0x1f,0x82}, {0xc9,0x40,0x89,0xc9}, {0x7d,0x87,0xfa,0x7d},
|
||||
{0xfa,0x15,0xef,0xfa}, {0x59,0xeb,0xb2,0x59}, {0x47,0xc9,0x8e,0x47}, {0xf0,0x0b,0xfb,0xf0},
|
||||
{0xad,0xec,0x41,0xad}, {0xd4,0x67,0xb3,0xd4}, {0xa2,0xfd,0x5f,0xa2}, {0xaf,0xea,0x45,0xaf},
|
||||
{0x9c,0xbf,0x23,0x9c}, {0xa4,0xf7,0x53,0xa4}, {0x72,0x96,0xe4,0x72}, {0xc0,0x5b,0x9b,0xc0},
|
||||
{0xb7,0xc2,0x75,0xb7}, {0xfd,0x1c,0xe1,0xfd}, {0x93,0xae,0x3d,0x93}, {0x26,0x6a,0x4c,0x26},
|
||||
{0x36,0x5a,0x6c,0x36}, {0x3f,0x41,0x7e,0x3f}, {0xf7,0x02,0xf5,0xf7}, {0xcc,0x4f,0x83,0xcc},
|
||||
{0x34,0x5c,0x68,0x34}, {0xa5,0xf4,0x51,0xa5}, {0xe5,0x34,0xd1,0xe5}, {0xf1,0x08,0xf9,0xf1},
|
||||
{0x71,0x93,0xe2,0x71}, {0xd8,0x73,0xab,0xd8}, {0x31,0x53,0x62,0x31}, {0x15,0x3f,0x2a,0x15},
|
||||
{0x04,0x0c,0x08,0x04}, {0xc7,0x52,0x95,0xc7}, {0x23,0x65,0x46,0x23}, {0xc3,0x5e,0x9d,0xc3},
|
||||
{0x18,0x28,0x30,0x18}, {0x96,0xa1,0x37,0x96}, {0x05,0x0f,0x0a,0x05}, {0x9a,0xb5,0x2f,0x9a},
|
||||
{0x07,0x09,0x0e,0x07}, {0x12,0x36,0x24,0x12}, {0x80,0x9b,0x1b,0x80}, {0xe2,0x3d,0xdf,0xe2},
|
||||
{0xeb,0x26,0xcd,0xeb}, {0x27,0x69,0x4e,0x27}, {0xb2,0xcd,0x7f,0xb2}, {0x75,0x9f,0xea,0x75},
|
||||
{0x09,0x1b,0x12,0x09}, {0x83,0x9e,0x1d,0x83}, {0x2c,0x74,0x58,0x2c}, {0x1a,0x2e,0x34,0x1a},
|
||||
{0x1b,0x2d,0x36,0x1b}, {0x6e,0xb2,0xdc,0x6e}, {0x5a,0xee,0xb4,0x5a}, {0xa0,0xfb,0x5b,0xa0},
|
||||
{0x52,0xf6,0xa4,0x52}, {0x3b,0x4d,0x76,0x3b}, {0xd6,0x61,0xb7,0xd6}, {0xb3,0xce,0x7d,0xb3},
|
||||
{0x29,0x7b,0x52,0x29}, {0xe3,0x3e,0xdd,0xe3}, {0x2f,0x71,0x5e,0x2f}, {0x84,0x97,0x13,0x84},
|
||||
{0x53,0xf5,0xa6,0x53}, {0xd1,0x68,0xb9,0xd1}, {0x00,0x00,0x00,0x00}, {0xed,0x2c,0xc1,0xed},
|
||||
{0x20,0x60,0x40,0x20}, {0xfc,0x1f,0xe3,0xfc}, {0xb1,0xc8,0x79,0xb1}, {0x5b,0xed,0xb6,0x5b},
|
||||
{0x6a,0xbe,0xd4,0x6a}, {0xcb,0x46,0x8d,0xcb}, {0xbe,0xd9,0x67,0xbe}, {0x39,0x4b,0x72,0x39},
|
||||
{0x4a,0xde,0x94,0x4a}, {0x4c,0xd4,0x98,0x4c}, {0x58,0xe8,0xb0,0x58}, {0xcf,0x4a,0x85,0xcf},
|
||||
{0xd0,0x6b,0xbb,0xd0}, {0xef,0x2a,0xc5,0xef}, {0xaa,0xe5,0x4f,0xaa}, {0xfb,0x16,0xed,0xfb},
|
||||
{0x43,0xc5,0x86,0x43}, {0x4d,0xd7,0x9a,0x4d}, {0x33,0x55,0x66,0x33}, {0x85,0x94,0x11,0x85},
|
||||
{0x45,0xcf,0x8a,0x45}, {0xf9,0x10,0xe9,0xf9}, {0x02,0x06,0x04,0x02}, {0x7f,0x81,0xfe,0x7f},
|
||||
{0x50,0xf0,0xa0,0x50}, {0x3c,0x44,0x78,0x3c}, {0x9f,0xba,0x25,0x9f}, {0xa8,0xe3,0x4b,0xa8},
|
||||
{0x51,0xf3,0xa2,0x51}, {0xa3,0xfe,0x5d,0xa3}, {0x40,0xc0,0x80,0x40}, {0x8f,0x8a,0x05,0x8f},
|
||||
{0x92,0xad,0x3f,0x92}, {0x9d,0xbc,0x21,0x9d}, {0x38,0x48,0x70,0x38}, {0xf5,0x04,0xf1,0xf5},
|
||||
{0xbc,0xdf,0x63,0xbc}, {0xb6,0xc1,0x77,0xb6}, {0xda,0x75,0xaf,0xda}, {0x21,0x63,0x42,0x21},
|
||||
{0x10,0x30,0x20,0x10}, {0xff,0x1a,0xe5,0xff}, {0xf3,0x0e,0xfd,0xf3}, {0xd2,0x6d,0xbf,0xd2},
|
||||
{0xcd,0x4c,0x81,0xcd}, {0x0c,0x14,0x18,0x0c}, {0x13,0x35,0x26,0x13}, {0xec,0x2f,0xc3,0xec},
|
||||
{0x5f,0xe1,0xbe,0x5f}, {0x97,0xa2,0x35,0x97}, {0x44,0xcc,0x88,0x44}, {0x17,0x39,0x2e,0x17},
|
||||
{0xc4,0x57,0x93,0xc4}, {0xa7,0xf2,0x55,0xa7}, {0x7e,0x82,0xfc,0x7e}, {0x3d,0x47,0x7a,0x3d},
|
||||
{0x64,0xac,0xc8,0x64}, {0x5d,0xe7,0xba,0x5d}, {0x19,0x2b,0x32,0x19}, {0x73,0x95,0xe6,0x73},
|
||||
{0x60,0xa0,0xc0,0x60}, {0x81,0x98,0x19,0x81}, {0x4f,0xd1,0x9e,0x4f}, {0xdc,0x7f,0xa3,0xdc},
|
||||
{0x22,0x66,0x44,0x22}, {0x2a,0x7e,0x54,0x2a}, {0x90,0xab,0x3b,0x90}, {0x88,0x83,0x0b,0x88},
|
||||
{0x46,0xca,0x8c,0x46}, {0xee,0x29,0xc7,0xee}, {0xb8,0xd3,0x6b,0xb8}, {0x14,0x3c,0x28,0x14},
|
||||
{0xde,0x79,0xa7,0xde}, {0x5e,0xe2,0xbc,0x5e}, {0x0b,0x1d,0x16,0x0b}, {0xdb,0x76,0xad,0xdb},
|
||||
{0xe0,0x3b,0xdb,0xe0}, {0x32,0x56,0x64,0x32}, {0x3a,0x4e,0x74,0x3a}, {0x0a,0x1e,0x14,0x0a},
|
||||
{0x49,0xdb,0x92,0x49}, {0x06,0x0a,0x0c,0x06}, {0x24,0x6c,0x48,0x24}, {0x5c,0xe4,0xb8,0x5c},
|
||||
{0xc2,0x5d,0x9f,0xc2}, {0xd3,0x6e,0xbd,0xd3}, {0xac,0xef,0x43,0xac}, {0x62,0xa6,0xc4,0x62},
|
||||
{0x91,0xa8,0x39,0x91}, {0x95,0xa4,0x31,0x95}, {0xe4,0x37,0xd3,0xe4}, {0x79,0x8b,0xf2,0x79},
|
||||
{0xe7,0x32,0xd5,0xe7}, {0xc8,0x43,0x8b,0xc8}, {0x37,0x59,0x6e,0x37}, {0x6d,0xb7,0xda,0x6d},
|
||||
{0x8d,0x8c,0x01,0x8d}, {0xd5,0x64,0xb1,0xd5}, {0x4e,0xd2,0x9c,0x4e}, {0xa9,0xe0,0x49,0xa9},
|
||||
{0x6c,0xb4,0xd8,0x6c}, {0x56,0xfa,0xac,0x56}, {0xf4,0x07,0xf3,0xf4}, {0xea,0x25,0xcf,0xea},
|
||||
{0x65,0xaf,0xca,0x65}, {0x7a,0x8e,0xf4,0x7a}, {0xae,0xe9,0x47,0xae}, {0x08,0x18,0x10,0x08},
|
||||
{0xba,0xd5,0x6f,0xba}, {0x78,0x88,0xf0,0x78}, {0x25,0x6f,0x4a,0x25}, {0x2e,0x72,0x5c,0x2e},
|
||||
{0x1c,0x24,0x38,0x1c}, {0xa6,0xf1,0x57,0xa6}, {0xb4,0xc7,0x73,0xb4}, {0xc6,0x51,0x97,0xc6},
|
||||
{0xe8,0x23,0xcb,0xe8}, {0xdd,0x7c,0xa1,0xdd}, {0x74,0x9c,0xe8,0x74}, {0x1f,0x21,0x3e,0x1f},
|
||||
{0x4b,0xdd,0x96,0x4b}, {0xbd,0xdc,0x61,0xbd}, {0x8b,0x86,0x0d,0x8b}, {0x8a,0x85,0x0f,0x8a},
|
||||
{0x70,0x90,0xe0,0x70}, {0x3e,0x42,0x7c,0x3e}, {0xb5,0xc4,0x71,0xb5}, {0x66,0xaa,0xcc,0x66},
|
||||
{0x48,0xd8,0x90,0x48}, {0x03,0x05,0x06,0x03}, {0xf6,0x01,0xf7,0xf6}, {0x0e,0x12,0x1c,0x0e},
|
||||
{0x61,0xa3,0xc2,0x61}, {0x35,0x5f,0x6a,0x35}, {0x57,0xf9,0xae,0x57}, {0xb9,0xd0,0x69,0xb9},
|
||||
{0x86,0x91,0x17,0x86}, {0xc1,0x58,0x99,0xc1}, {0x1d,0x27,0x3a,0x1d}, {0x9e,0xb9,0x27,0x9e},
|
||||
{0xe1,0x38,0xd9,0xe1}, {0xf8,0x13,0xeb,0xf8}, {0x98,0xb3,0x2b,0x98}, {0x11,0x33,0x22,0x11},
|
||||
{0x69,0xbb,0xd2,0x69}, {0xd9,0x70,0xa9,0xd9}, {0x8e,0x89,0x07,0x8e}, {0x94,0xa7,0x33,0x94},
|
||||
{0x9b,0xb6,0x2d,0x9b}, {0x1e,0x22,0x3c,0x1e}, {0x87,0x92,0x15,0x87}, {0xe9,0x20,0xc9,0xe9},
|
||||
{0xce,0x49,0x87,0xce}, {0x55,0xff,0xaa,0x55}, {0x28,0x78,0x50,0x28}, {0xdf,0x7a,0xa5,0xdf},
|
||||
{0x8c,0x8f,0x03,0x8c}, {0xa1,0xf8,0x59,0xa1}, {0x89,0x80,0x09,0x89}, {0x0d,0x17,0x1a,0x0d},
|
||||
{0xbf,0xda,0x65,0xbf}, {0xe6,0x31,0xd7,0xe6}, {0x42,0xc6,0x84,0x42}, {0x68,0xb8,0xd0,0x68},
|
||||
{0x41,0xc3,0x82,0x41}, {0x99,0xb0,0x29,0x99}, {0x2d,0x77,0x5a,0x2d}, {0x0f,0x11,0x1e,0x0f},
|
||||
{0xb0,0xcb,0x7b,0xb0}, {0x54,0xfc,0xa8,0x54}, {0xbb,0xd6,0x6d,0xbb}, {0x16,0x3a,0x2c,0x16}
|
||||
}
|
||||
};
|
||||
#define T3 xT3.xt8
|
||||
|
||||
static const union xtab xT4 = {
|
||||
.xt8 = {
|
||||
{0x63,0x63,0xa5,0xc6}, {0x7c,0x7c,0x84,0xf8}, {0x77,0x77,0x99,0xee}, {0x7b,0x7b,0x8d,0xf6},
|
||||
{0xf2,0xf2,0x0d,0xff}, {0x6b,0x6b,0xbd,0xd6}, {0x6f,0x6f,0xb1,0xde}, {0xc5,0xc5,0x54,0x91},
|
||||
{0x30,0x30,0x50,0x60}, {0x01,0x01,0x03,0x02}, {0x67,0x67,0xa9,0xce}, {0x2b,0x2b,0x7d,0x56},
|
||||
{0xfe,0xfe,0x19,0xe7}, {0xd7,0xd7,0x62,0xb5}, {0xab,0xab,0xe6,0x4d}, {0x76,0x76,0x9a,0xec},
|
||||
{0xca,0xca,0x45,0x8f}, {0x82,0x82,0x9d,0x1f}, {0xc9,0xc9,0x40,0x89}, {0x7d,0x7d,0x87,0xfa},
|
||||
{0xfa,0xfa,0x15,0xef}, {0x59,0x59,0xeb,0xb2}, {0x47,0x47,0xc9,0x8e}, {0xf0,0xf0,0x0b,0xfb},
|
||||
{0xad,0xad,0xec,0x41}, {0xd4,0xd4,0x67,0xb3}, {0xa2,0xa2,0xfd,0x5f}, {0xaf,0xaf,0xea,0x45},
|
||||
{0x9c,0x9c,0xbf,0x23}, {0xa4,0xa4,0xf7,0x53}, {0x72,0x72,0x96,0xe4}, {0xc0,0xc0,0x5b,0x9b},
|
||||
{0xb7,0xb7,0xc2,0x75}, {0xfd,0xfd,0x1c,0xe1}, {0x93,0x93,0xae,0x3d}, {0x26,0x26,0x6a,0x4c},
|
||||
{0x36,0x36,0x5a,0x6c}, {0x3f,0x3f,0x41,0x7e}, {0xf7,0xf7,0x02,0xf5}, {0xcc,0xcc,0x4f,0x83},
|
||||
{0x34,0x34,0x5c,0x68}, {0xa5,0xa5,0xf4,0x51}, {0xe5,0xe5,0x34,0xd1}, {0xf1,0xf1,0x08,0xf9},
|
||||
{0x71,0x71,0x93,0xe2}, {0xd8,0xd8,0x73,0xab}, {0x31,0x31,0x53,0x62}, {0x15,0x15,0x3f,0x2a},
|
||||
{0x04,0x04,0x0c,0x08}, {0xc7,0xc7,0x52,0x95}, {0x23,0x23,0x65,0x46}, {0xc3,0xc3,0x5e,0x9d},
|
||||
{0x18,0x18,0x28,0x30}, {0x96,0x96,0xa1,0x37}, {0x05,0x05,0x0f,0x0a}, {0x9a,0x9a,0xb5,0x2f},
|
||||
{0x07,0x07,0x09,0x0e}, {0x12,0x12,0x36,0x24}, {0x80,0x80,0x9b,0x1b}, {0xe2,0xe2,0x3d,0xdf},
|
||||
{0xeb,0xeb,0x26,0xcd}, {0x27,0x27,0x69,0x4e}, {0xb2,0xb2,0xcd,0x7f}, {0x75,0x75,0x9f,0xea},
|
||||
{0x09,0x09,0x1b,0x12}, {0x83,0x83,0x9e,0x1d}, {0x2c,0x2c,0x74,0x58}, {0x1a,0x1a,0x2e,0x34},
|
||||
{0x1b,0x1b,0x2d,0x36}, {0x6e,0x6e,0xb2,0xdc}, {0x5a,0x5a,0xee,0xb4}, {0xa0,0xa0,0xfb,0x5b},
|
||||
{0x52,0x52,0xf6,0xa4}, {0x3b,0x3b,0x4d,0x76}, {0xd6,0xd6,0x61,0xb7}, {0xb3,0xb3,0xce,0x7d},
|
||||
{0x29,0x29,0x7b,0x52}, {0xe3,0xe3,0x3e,0xdd}, {0x2f,0x2f,0x71,0x5e}, {0x84,0x84,0x97,0x13},
|
||||
{0x53,0x53,0xf5,0xa6}, {0xd1,0xd1,0x68,0xb9}, {0x00,0x00,0x00,0x00}, {0xed,0xed,0x2c,0xc1},
|
||||
{0x20,0x20,0x60,0x40}, {0xfc,0xfc,0x1f,0xe3}, {0xb1,0xb1,0xc8,0x79}, {0x5b,0x5b,0xed,0xb6},
|
||||
{0x6a,0x6a,0xbe,0xd4}, {0xcb,0xcb,0x46,0x8d}, {0xbe,0xbe,0xd9,0x67}, {0x39,0x39,0x4b,0x72},
|
||||
{0x4a,0x4a,0xde,0x94}, {0x4c,0x4c,0xd4,0x98}, {0x58,0x58,0xe8,0xb0}, {0xcf,0xcf,0x4a,0x85},
|
||||
{0xd0,0xd0,0x6b,0xbb}, {0xef,0xef,0x2a,0xc5}, {0xaa,0xaa,0xe5,0x4f}, {0xfb,0xfb,0x16,0xed},
|
||||
{0x43,0x43,0xc5,0x86}, {0x4d,0x4d,0xd7,0x9a}, {0x33,0x33,0x55,0x66}, {0x85,0x85,0x94,0x11},
|
||||
{0x45,0x45,0xcf,0x8a}, {0xf9,0xf9,0x10,0xe9}, {0x02,0x02,0x06,0x04}, {0x7f,0x7f,0x81,0xfe},
|
||||
{0x50,0x50,0xf0,0xa0}, {0x3c,0x3c,0x44,0x78}, {0x9f,0x9f,0xba,0x25}, {0xa8,0xa8,0xe3,0x4b},
|
||||
{0x51,0x51,0xf3,0xa2}, {0xa3,0xa3,0xfe,0x5d}, {0x40,0x40,0xc0,0x80}, {0x8f,0x8f,0x8a,0x05},
|
||||
{0x92,0x92,0xad,0x3f}, {0x9d,0x9d,0xbc,0x21}, {0x38,0x38,0x48,0x70}, {0xf5,0xf5,0x04,0xf1},
|
||||
{0xbc,0xbc,0xdf,0x63}, {0xb6,0xb6,0xc1,0x77}, {0xda,0xda,0x75,0xaf}, {0x21,0x21,0x63,0x42},
|
||||
{0x10,0x10,0x30,0x20}, {0xff,0xff,0x1a,0xe5}, {0xf3,0xf3,0x0e,0xfd}, {0xd2,0xd2,0x6d,0xbf},
|
||||
{0xcd,0xcd,0x4c,0x81}, {0x0c,0x0c,0x14,0x18}, {0x13,0x13,0x35,0x26}, {0xec,0xec,0x2f,0xc3},
|
||||
{0x5f,0x5f,0xe1,0xbe}, {0x97,0x97,0xa2,0x35}, {0x44,0x44,0xcc,0x88}, {0x17,0x17,0x39,0x2e},
|
||||
{0xc4,0xc4,0x57,0x93}, {0xa7,0xa7,0xf2,0x55}, {0x7e,0x7e,0x82,0xfc}, {0x3d,0x3d,0x47,0x7a},
|
||||
{0x64,0x64,0xac,0xc8}, {0x5d,0x5d,0xe7,0xba}, {0x19,0x19,0x2b,0x32}, {0x73,0x73,0x95,0xe6},
|
||||
{0x60,0x60,0xa0,0xc0}, {0x81,0x81,0x98,0x19}, {0x4f,0x4f,0xd1,0x9e}, {0xdc,0xdc,0x7f,0xa3},
|
||||
{0x22,0x22,0x66,0x44}, {0x2a,0x2a,0x7e,0x54}, {0x90,0x90,0xab,0x3b}, {0x88,0x88,0x83,0x0b},
|
||||
{0x46,0x46,0xca,0x8c}, {0xee,0xee,0x29,0xc7}, {0xb8,0xb8,0xd3,0x6b}, {0x14,0x14,0x3c,0x28},
|
||||
{0xde,0xde,0x79,0xa7}, {0x5e,0x5e,0xe2,0xbc}, {0x0b,0x0b,0x1d,0x16}, {0xdb,0xdb,0x76,0xad},
|
||||
{0xe0,0xe0,0x3b,0xdb}, {0x32,0x32,0x56,0x64}, {0x3a,0x3a,0x4e,0x74}, {0x0a,0x0a,0x1e,0x14},
|
||||
{0x49,0x49,0xdb,0x92}, {0x06,0x06,0x0a,0x0c}, {0x24,0x24,0x6c,0x48}, {0x5c,0x5c,0xe4,0xb8},
|
||||
{0xc2,0xc2,0x5d,0x9f}, {0xd3,0xd3,0x6e,0xbd}, {0xac,0xac,0xef,0x43}, {0x62,0x62,0xa6,0xc4},
|
||||
{0x91,0x91,0xa8,0x39}, {0x95,0x95,0xa4,0x31}, {0xe4,0xe4,0x37,0xd3}, {0x79,0x79,0x8b,0xf2},
|
||||
{0xe7,0xe7,0x32,0xd5}, {0xc8,0xc8,0x43,0x8b}, {0x37,0x37,0x59,0x6e}, {0x6d,0x6d,0xb7,0xda},
|
||||
{0x8d,0x8d,0x8c,0x01}, {0xd5,0xd5,0x64,0xb1}, {0x4e,0x4e,0xd2,0x9c}, {0xa9,0xa9,0xe0,0x49},
|
||||
{0x6c,0x6c,0xb4,0xd8}, {0x56,0x56,0xfa,0xac}, {0xf4,0xf4,0x07,0xf3}, {0xea,0xea,0x25,0xcf},
|
||||
{0x65,0x65,0xaf,0xca}, {0x7a,0x7a,0x8e,0xf4}, {0xae,0xae,0xe9,0x47}, {0x08,0x08,0x18,0x10},
|
||||
{0xba,0xba,0xd5,0x6f}, {0x78,0x78,0x88,0xf0}, {0x25,0x25,0x6f,0x4a}, {0x2e,0x2e,0x72,0x5c},
|
||||
{0x1c,0x1c,0x24,0x38}, {0xa6,0xa6,0xf1,0x57}, {0xb4,0xb4,0xc7,0x73}, {0xc6,0xc6,0x51,0x97},
|
||||
{0xe8,0xe8,0x23,0xcb}, {0xdd,0xdd,0x7c,0xa1}, {0x74,0x74,0x9c,0xe8}, {0x1f,0x1f,0x21,0x3e},
|
||||
{0x4b,0x4b,0xdd,0x96}, {0xbd,0xbd,0xdc,0x61}, {0x8b,0x8b,0x86,0x0d}, {0x8a,0x8a,0x85,0x0f},
|
||||
{0x70,0x70,0x90,0xe0}, {0x3e,0x3e,0x42,0x7c}, {0xb5,0xb5,0xc4,0x71}, {0x66,0x66,0xaa,0xcc},
|
||||
{0x48,0x48,0xd8,0x90}, {0x03,0x03,0x05,0x06}, {0xf6,0xf6,0x01,0xf7}, {0x0e,0x0e,0x12,0x1c},
|
||||
{0x61,0x61,0xa3,0xc2}, {0x35,0x35,0x5f,0x6a}, {0x57,0x57,0xf9,0xae}, {0xb9,0xb9,0xd0,0x69},
|
||||
{0x86,0x86,0x91,0x17}, {0xc1,0xc1,0x58,0x99}, {0x1d,0x1d,0x27,0x3a}, {0x9e,0x9e,0xb9,0x27},
|
||||
{0xe1,0xe1,0x38,0xd9}, {0xf8,0xf8,0x13,0xeb}, {0x98,0x98,0xb3,0x2b}, {0x11,0x11,0x33,0x22},
|
||||
{0x69,0x69,0xbb,0xd2}, {0xd9,0xd9,0x70,0xa9}, {0x8e,0x8e,0x89,0x07}, {0x94,0x94,0xa7,0x33},
|
||||
{0x9b,0x9b,0xb6,0x2d}, {0x1e,0x1e,0x22,0x3c}, {0x87,0x87,0x92,0x15}, {0xe9,0xe9,0x20,0xc9},
|
||||
{0xce,0xce,0x49,0x87}, {0x55,0x55,0xff,0xaa}, {0x28,0x28,0x78,0x50}, {0xdf,0xdf,0x7a,0xa5},
|
||||
{0x8c,0x8c,0x8f,0x03}, {0xa1,0xa1,0xf8,0x59}, {0x89,0x89,0x80,0x09}, {0x0d,0x0d,0x17,0x1a},
|
||||
{0xbf,0xbf,0xda,0x65}, {0xe6,0xe6,0x31,0xd7}, {0x42,0x42,0xc6,0x84}, {0x68,0x68,0xb8,0xd0},
|
||||
{0x41,0x41,0xc3,0x82}, {0x99,0x99,0xb0,0x29}, {0x2d,0x2d,0x77,0x5a}, {0x0f,0x0f,0x11,0x1e},
|
||||
{0xb0,0xb0,0xcb,0x7b}, {0x54,0x54,0xfc,0xa8}, {0xbb,0xbb,0xd6,0x6d}, {0x16,0x16,0x3a,0x2c}
|
||||
}
|
||||
};
|
||||
#define T4 xT4.xt8
|
||||
|
||||
static const union xtab xT5 = {
|
||||
.xt8 = {
|
||||
{0x51,0xf4,0xa7,0x50}, {0x7e,0x41,0x65,0x53}, {0x1a,0x17,0xa4,0xc3}, {0x3a,0x27,0x5e,0x96},
|
||||
{0x3b,0xab,0x6b,0xcb}, {0x1f,0x9d,0x45,0xf1}, {0xac,0xfa,0x58,0xab}, {0x4b,0xe3,0x03,0x93},
|
||||
{0x20,0x30,0xfa,0x55}, {0xad,0x76,0x6d,0xf6}, {0x88,0xcc,0x76,0x91}, {0xf5,0x02,0x4c,0x25},
|
||||
{0x4f,0xe5,0xd7,0xfc}, {0xc5,0x2a,0xcb,0xd7}, {0x26,0x35,0x44,0x80}, {0xb5,0x62,0xa3,0x8f},
|
||||
{0xde,0xb1,0x5a,0x49}, {0x25,0xba,0x1b,0x67}, {0x45,0xea,0x0e,0x98}, {0x5d,0xfe,0xc0,0xe1},
|
||||
{0xc3,0x2f,0x75,0x02}, {0x81,0x4c,0xf0,0x12}, {0x8d,0x46,0x97,0xa3}, {0x6b,0xd3,0xf9,0xc6},
|
||||
{0x03,0x8f,0x5f,0xe7}, {0x15,0x92,0x9c,0x95}, {0xbf,0x6d,0x7a,0xeb}, {0x95,0x52,0x59,0xda},
|
||||
{0xd4,0xbe,0x83,0x2d}, {0x58,0x74,0x21,0xd3}, {0x49,0xe0,0x69,0x29}, {0x8e,0xc9,0xc8,0x44},
|
||||
{0x75,0xc2,0x89,0x6a}, {0xf4,0x8e,0x79,0x78}, {0x99,0x58,0x3e,0x6b}, {0x27,0xb9,0x71,0xdd},
|
||||
{0xbe,0xe1,0x4f,0xb6}, {0xf0,0x88,0xad,0x17}, {0xc9,0x20,0xac,0x66}, {0x7d,0xce,0x3a,0xb4},
|
||||
{0x63,0xdf,0x4a,0x18}, {0xe5,0x1a,0x31,0x82}, {0x97,0x51,0x33,0x60}, {0x62,0x53,0x7f,0x45},
|
||||
{0xb1,0x64,0x77,0xe0}, {0xbb,0x6b,0xae,0x84}, {0xfe,0x81,0xa0,0x1c}, {0xf9,0x08,0x2b,0x94},
|
||||
{0x70,0x48,0x68,0x58}, {0x8f,0x45,0xfd,0x19}, {0x94,0xde,0x6c,0x87}, {0x52,0x7b,0xf8,0xb7},
|
||||
{0xab,0x73,0xd3,0x23}, {0x72,0x4b,0x02,0xe2}, {0xe3,0x1f,0x8f,0x57}, {0x66,0x55,0xab,0x2a},
|
||||
{0xb2,0xeb,0x28,0x07}, {0x2f,0xb5,0xc2,0x03}, {0x86,0xc5,0x7b,0x9a}, {0xd3,0x37,0x08,0xa5},
|
||||
{0x30,0x28,0x87,0xf2}, {0x23,0xbf,0xa5,0xb2}, {0x02,0x03,0x6a,0xba}, {0xed,0x16,0x82,0x5c},
|
||||
{0x8a,0xcf,0x1c,0x2b}, {0xa7,0x79,0xb4,0x92}, {0xf3,0x07,0xf2,0xf0}, {0x4e,0x69,0xe2,0xa1},
|
||||
{0x65,0xda,0xf4,0xcd}, {0x06,0x05,0xbe,0xd5}, {0xd1,0x34,0x62,0x1f}, {0xc4,0xa6,0xfe,0x8a},
|
||||
{0x34,0x2e,0x53,0x9d}, {0xa2,0xf3,0x55,0xa0}, {0x05,0x8a,0xe1,0x32}, {0xa4,0xf6,0xeb,0x75},
|
||||
{0x0b,0x83,0xec,0x39}, {0x40,0x60,0xef,0xaa}, {0x5e,0x71,0x9f,0x06}, {0xbd,0x6e,0x10,0x51},
|
||||
{0x3e,0x21,0x8a,0xf9}, {0x96,0xdd,0x06,0x3d}, {0xdd,0x3e,0x05,0xae}, {0x4d,0xe6,0xbd,0x46},
|
||||
{0x91,0x54,0x8d,0xb5}, {0x71,0xc4,0x5d,0x05}, {0x04,0x06,0xd4,0x6f}, {0x60,0x50,0x15,0xff},
|
||||
{0x19,0x98,0xfb,0x24}, {0xd6,0xbd,0xe9,0x97}, {0x89,0x40,0x43,0xcc}, {0x67,0xd9,0x9e,0x77},
|
||||
{0xb0,0xe8,0x42,0xbd}, {0x07,0x89,0x8b,0x88}, {0xe7,0x19,0x5b,0x38}, {0x79,0xc8,0xee,0xdb},
|
||||
{0xa1,0x7c,0x0a,0x47}, {0x7c,0x42,0x0f,0xe9}, {0xf8,0x84,0x1e,0xc9}, {0x00,0x00,0x00,0x00},
|
||||
{0x09,0x80,0x86,0x83}, {0x32,0x2b,0xed,0x48}, {0x1e,0x11,0x70,0xac}, {0x6c,0x5a,0x72,0x4e},
|
||||
{0xfd,0x0e,0xff,0xfb}, {0x0f,0x85,0x38,0x56}, {0x3d,0xae,0xd5,0x1e}, {0x36,0x2d,0x39,0x27},
|
||||
{0x0a,0x0f,0xd9,0x64}, {0x68,0x5c,0xa6,0x21}, {0x9b,0x5b,0x54,0xd1}, {0x24,0x36,0x2e,0x3a},
|
||||
{0x0c,0x0a,0x67,0xb1}, {0x93,0x57,0xe7,0x0f}, {0xb4,0xee,0x96,0xd2}, {0x1b,0x9b,0x91,0x9e},
|
||||
{0x80,0xc0,0xc5,0x4f}, {0x61,0xdc,0x20,0xa2}, {0x5a,0x77,0x4b,0x69}, {0x1c,0x12,0x1a,0x16},
|
||||
{0xe2,0x93,0xba,0x0a}, {0xc0,0xa0,0x2a,0xe5}, {0x3c,0x22,0xe0,0x43}, {0x12,0x1b,0x17,0x1d},
|
||||
{0x0e,0x09,0x0d,0x0b}, {0xf2,0x8b,0xc7,0xad}, {0x2d,0xb6,0xa8,0xb9}, {0x14,0x1e,0xa9,0xc8},
|
||||
{0x57,0xf1,0x19,0x85}, {0xaf,0x75,0x07,0x4c}, {0xee,0x99,0xdd,0xbb}, {0xa3,0x7f,0x60,0xfd},
|
||||
{0xf7,0x01,0x26,0x9f}, {0x5c,0x72,0xf5,0xbc}, {0x44,0x66,0x3b,0xc5}, {0x5b,0xfb,0x7e,0x34},
|
||||
{0x8b,0x43,0x29,0x76}, {0xcb,0x23,0xc6,0xdc}, {0xb6,0xed,0xfc,0x68}, {0xb8,0xe4,0xf1,0x63},
|
||||
{0xd7,0x31,0xdc,0xca}, {0x42,0x63,0x85,0x10}, {0x13,0x97,0x22,0x40}, {0x84,0xc6,0x11,0x20},
|
||||
{0x85,0x4a,0x24,0x7d}, {0xd2,0xbb,0x3d,0xf8}, {0xae,0xf9,0x32,0x11}, {0xc7,0x29,0xa1,0x6d},
|
||||
{0x1d,0x9e,0x2f,0x4b}, {0xdc,0xb2,0x30,0xf3}, {0x0d,0x86,0x52,0xec}, {0x77,0xc1,0xe3,0xd0},
|
||||
{0x2b,0xb3,0x16,0x6c}, {0xa9,0x70,0xb9,0x99}, {0x11,0x94,0x48,0xfa}, {0x47,0xe9,0x64,0x22},
|
||||
{0xa8,0xfc,0x8c,0xc4}, {0xa0,0xf0,0x3f,0x1a}, {0x56,0x7d,0x2c,0xd8}, {0x22,0x33,0x90,0xef},
|
||||
{0x87,0x49,0x4e,0xc7}, {0xd9,0x38,0xd1,0xc1}, {0x8c,0xca,0xa2,0xfe}, {0x98,0xd4,0x0b,0x36},
|
||||
{0xa6,0xf5,0x81,0xcf}, {0xa5,0x7a,0xde,0x28}, {0xda,0xb7,0x8e,0x26}, {0x3f,0xad,0xbf,0xa4},
|
||||
{0x2c,0x3a,0x9d,0xe4}, {0x50,0x78,0x92,0x0d}, {0x6a,0x5f,0xcc,0x9b}, {0x54,0x7e,0x46,0x62},
|
||||
{0xf6,0x8d,0x13,0xc2}, {0x90,0xd8,0xb8,0xe8}, {0x2e,0x39,0xf7,0x5e}, {0x82,0xc3,0xaf,0xf5},
|
||||
{0x9f,0x5d,0x80,0xbe}, {0x69,0xd0,0x93,0x7c}, {0x6f,0xd5,0x2d,0xa9}, {0xcf,0x25,0x12,0xb3},
|
||||
{0xc8,0xac,0x99,0x3b}, {0x10,0x18,0x7d,0xa7}, {0xe8,0x9c,0x63,0x6e}, {0xdb,0x3b,0xbb,0x7b},
|
||||
{0xcd,0x26,0x78,0x09}, {0x6e,0x59,0x18,0xf4}, {0xec,0x9a,0xb7,0x01}, {0x83,0x4f,0x9a,0xa8},
|
||||
{0xe6,0x95,0x6e,0x65}, {0xaa,0xff,0xe6,0x7e}, {0x21,0xbc,0xcf,0x08}, {0xef,0x15,0xe8,0xe6},
|
||||
{0xba,0xe7,0x9b,0xd9}, {0x4a,0x6f,0x36,0xce}, {0xea,0x9f,0x09,0xd4}, {0x29,0xb0,0x7c,0xd6},
|
||||
{0x31,0xa4,0xb2,0xaf}, {0x2a,0x3f,0x23,0x31}, {0xc6,0xa5,0x94,0x30}, {0x35,0xa2,0x66,0xc0},
|
||||
{0x74,0x4e,0xbc,0x37}, {0xfc,0x82,0xca,0xa6}, {0xe0,0x90,0xd0,0xb0}, {0x33,0xa7,0xd8,0x15},
|
||||
{0xf1,0x04,0x98,0x4a}, {0x41,0xec,0xda,0xf7}, {0x7f,0xcd,0x50,0x0e}, {0x17,0x91,0xf6,0x2f},
|
||||
{0x76,0x4d,0xd6,0x8d}, {0x43,0xef,0xb0,0x4d}, {0xcc,0xaa,0x4d,0x54}, {0xe4,0x96,0x04,0xdf},
|
||||
{0x9e,0xd1,0xb5,0xe3}, {0x4c,0x6a,0x88,0x1b}, {0xc1,0x2c,0x1f,0xb8}, {0x46,0x65,0x51,0x7f},
|
||||
{0x9d,0x5e,0xea,0x04}, {0x01,0x8c,0x35,0x5d}, {0xfa,0x87,0x74,0x73}, {0xfb,0x0b,0x41,0x2e},
|
||||
{0xb3,0x67,0x1d,0x5a}, {0x92,0xdb,0xd2,0x52}, {0xe9,0x10,0x56,0x33}, {0x6d,0xd6,0x47,0x13},
|
||||
{0x9a,0xd7,0x61,0x8c}, {0x37,0xa1,0x0c,0x7a}, {0x59,0xf8,0x14,0x8e}, {0xeb,0x13,0x3c,0x89},
|
||||
{0xce,0xa9,0x27,0xee}, {0xb7,0x61,0xc9,0x35}, {0xe1,0x1c,0xe5,0xed}, {0x7a,0x47,0xb1,0x3c},
|
||||
{0x9c,0xd2,0xdf,0x59}, {0x55,0xf2,0x73,0x3f}, {0x18,0x14,0xce,0x79}, {0x73,0xc7,0x37,0xbf},
|
||||
{0x53,0xf7,0xcd,0xea}, {0x5f,0xfd,0xaa,0x5b}, {0xdf,0x3d,0x6f,0x14}, {0x78,0x44,0xdb,0x86},
|
||||
{0xca,0xaf,0xf3,0x81}, {0xb9,0x68,0xc4,0x3e}, {0x38,0x24,0x34,0x2c}, {0xc2,0xa3,0x40,0x5f},
|
||||
{0x16,0x1d,0xc3,0x72}, {0xbc,0xe2,0x25,0x0c}, {0x28,0x3c,0x49,0x8b}, {0xff,0x0d,0x95,0x41},
|
||||
{0x39,0xa8,0x01,0x71}, {0x08,0x0c,0xb3,0xde}, {0xd8,0xb4,0xe4,0x9c}, {0x64,0x56,0xc1,0x90},
|
||||
{0x7b,0xcb,0x84,0x61}, {0xd5,0x32,0xb6,0x70}, {0x48,0x6c,0x5c,0x74}, {0xd0,0xb8,0x57,0x42}
|
||||
}
|
||||
};
|
||||
#define T5 xT5.xt8
|
||||
|
||||
static const union xtab xT6 = {
|
||||
.xt8 = {
|
||||
{0x50,0x51,0xf4,0xa7}, {0x53,0x7e,0x41,0x65}, {0xc3,0x1a,0x17,0xa4}, {0x96,0x3a,0x27,0x5e},
|
||||
{0xcb,0x3b,0xab,0x6b}, {0xf1,0x1f,0x9d,0x45}, {0xab,0xac,0xfa,0x58}, {0x93,0x4b,0xe3,0x03},
|
||||
{0x55,0x20,0x30,0xfa}, {0xf6,0xad,0x76,0x6d}, {0x91,0x88,0xcc,0x76}, {0x25,0xf5,0x02,0x4c},
|
||||
{0xfc,0x4f,0xe5,0xd7}, {0xd7,0xc5,0x2a,0xcb}, {0x80,0x26,0x35,0x44}, {0x8f,0xb5,0x62,0xa3},
|
||||
{0x49,0xde,0xb1,0x5a}, {0x67,0x25,0xba,0x1b}, {0x98,0x45,0xea,0x0e}, {0xe1,0x5d,0xfe,0xc0},
|
||||
{0x02,0xc3,0x2f,0x75}, {0x12,0x81,0x4c,0xf0}, {0xa3,0x8d,0x46,0x97}, {0xc6,0x6b,0xd3,0xf9},
|
||||
{0xe7,0x03,0x8f,0x5f}, {0x95,0x15,0x92,0x9c}, {0xeb,0xbf,0x6d,0x7a}, {0xda,0x95,0x52,0x59},
|
||||
{0x2d,0xd4,0xbe,0x83}, {0xd3,0x58,0x74,0x21}, {0x29,0x49,0xe0,0x69}, {0x44,0x8e,0xc9,0xc8},
|
||||
{0x6a,0x75,0xc2,0x89}, {0x78,0xf4,0x8e,0x79}, {0x6b,0x99,0x58,0x3e}, {0xdd,0x27,0xb9,0x71},
|
||||
{0xb6,0xbe,0xe1,0x4f}, {0x17,0xf0,0x88,0xad}, {0x66,0xc9,0x20,0xac}, {0xb4,0x7d,0xce,0x3a},
|
||||
{0x18,0x63,0xdf,0x4a}, {0x82,0xe5,0x1a,0x31}, {0x60,0x97,0x51,0x33}, {0x45,0x62,0x53,0x7f},
|
||||
{0xe0,0xb1,0x64,0x77}, {0x84,0xbb,0x6b,0xae}, {0x1c,0xfe,0x81,0xa0}, {0x94,0xf9,0x08,0x2b},
|
||||
{0x58,0x70,0x48,0x68}, {0x19,0x8f,0x45,0xfd}, {0x87,0x94,0xde,0x6c}, {0xb7,0x52,0x7b,0xf8},
|
||||
{0x23,0xab,0x73,0xd3}, {0xe2,0x72,0x4b,0x02}, {0x57,0xe3,0x1f,0x8f}, {0x2a,0x66,0x55,0xab},
|
||||
{0x07,0xb2,0xeb,0x28}, {0x03,0x2f,0xb5,0xc2}, {0x9a,0x86,0xc5,0x7b}, {0xa5,0xd3,0x37,0x08},
|
||||
{0xf2,0x30,0x28,0x87}, {0xb2,0x23,0xbf,0xa5}, {0xba,0x02,0x03,0x6a}, {0x5c,0xed,0x16,0x82},
|
||||
{0x2b,0x8a,0xcf,0x1c}, {0x92,0xa7,0x79,0xb4}, {0xf0,0xf3,0x07,0xf2}, {0xa1,0x4e,0x69,0xe2},
|
||||
{0xcd,0x65,0xda,0xf4}, {0xd5,0x06,0x05,0xbe}, {0x1f,0xd1,0x34,0x62}, {0x8a,0xc4,0xa6,0xfe},
|
||||
{0x9d,0x34,0x2e,0x53}, {0xa0,0xa2,0xf3,0x55}, {0x32,0x05,0x8a,0xe1}, {0x75,0xa4,0xf6,0xeb},
|
||||
{0x39,0x0b,0x83,0xec}, {0xaa,0x40,0x60,0xef}, {0x06,0x5e,0x71,0x9f}, {0x51,0xbd,0x6e,0x10},
|
||||
{0xf9,0x3e,0x21,0x8a}, {0x3d,0x96,0xdd,0x06}, {0xae,0xdd,0x3e,0x05}, {0x46,0x4d,0xe6,0xbd},
|
||||
{0xb5,0x91,0x54,0x8d}, {0x05,0x71,0xc4,0x5d}, {0x6f,0x04,0x06,0xd4}, {0xff,0x60,0x50,0x15},
|
||||
{0x24,0x19,0x98,0xfb}, {0x97,0xd6,0xbd,0xe9}, {0xcc,0x89,0x40,0x43}, {0x77,0x67,0xd9,0x9e},
|
||||
{0xbd,0xb0,0xe8,0x42}, {0x88,0x07,0x89,0x8b}, {0x38,0xe7,0x19,0x5b}, {0xdb,0x79,0xc8,0xee},
|
||||
{0x47,0xa1,0x7c,0x0a}, {0xe9,0x7c,0x42,0x0f}, {0xc9,0xf8,0x84,0x1e}, {0x00,0x00,0x00,0x00},
|
||||
{0x83,0x09,0x80,0x86}, {0x48,0x32,0x2b,0xed}, {0xac,0x1e,0x11,0x70}, {0x4e,0x6c,0x5a,0x72},
|
||||
{0xfb,0xfd,0x0e,0xff}, {0x56,0x0f,0x85,0x38}, {0x1e,0x3d,0xae,0xd5}, {0x27,0x36,0x2d,0x39},
|
||||
{0x64,0x0a,0x0f,0xd9}, {0x21,0x68,0x5c,0xa6}, {0xd1,0x9b,0x5b,0x54}, {0x3a,0x24,0x36,0x2e},
|
||||
{0xb1,0x0c,0x0a,0x67}, {0x0f,0x93,0x57,0xe7}, {0xd2,0xb4,0xee,0x96}, {0x9e,0x1b,0x9b,0x91},
|
||||
{0x4f,0x80,0xc0,0xc5}, {0xa2,0x61,0xdc,0x20}, {0x69,0x5a,0x77,0x4b}, {0x16,0x1c,0x12,0x1a},
|
||||
{0x0a,0xe2,0x93,0xba}, {0xe5,0xc0,0xa0,0x2a}, {0x43,0x3c,0x22,0xe0}, {0x1d,0x12,0x1b,0x17},
|
||||
{0x0b,0x0e,0x09,0x0d}, {0xad,0xf2,0x8b,0xc7}, {0xb9,0x2d,0xb6,0xa8}, {0xc8,0x14,0x1e,0xa9},
|
||||
{0x85,0x57,0xf1,0x19}, {0x4c,0xaf,0x75,0x07}, {0xbb,0xee,0x99,0xdd}, {0xfd,0xa3,0x7f,0x60},
|
||||
{0x9f,0xf7,0x01,0x26}, {0xbc,0x5c,0x72,0xf5}, {0xc5,0x44,0x66,0x3b}, {0x34,0x5b,0xfb,0x7e},
|
||||
{0x76,0x8b,0x43,0x29}, {0xdc,0xcb,0x23,0xc6}, {0x68,0xb6,0xed,0xfc}, {0x63,0xb8,0xe4,0xf1},
|
||||
{0xca,0xd7,0x31,0xdc}, {0x10,0x42,0x63,0x85}, {0x40,0x13,0x97,0x22}, {0x20,0x84,0xc6,0x11},
|
||||
{0x7d,0x85,0x4a,0x24}, {0xf8,0xd2,0xbb,0x3d}, {0x11,0xae,0xf9,0x32}, {0x6d,0xc7,0x29,0xa1},
|
||||
{0x4b,0x1d,0x9e,0x2f}, {0xf3,0xdc,0xb2,0x30}, {0xec,0x0d,0x86,0x52}, {0xd0,0x77,0xc1,0xe3},
|
||||
{0x6c,0x2b,0xb3,0x16}, {0x99,0xa9,0x70,0xb9}, {0xfa,0x11,0x94,0x48}, {0x22,0x47,0xe9,0x64},
|
||||
{0xc4,0xa8,0xfc,0x8c}, {0x1a,0xa0,0xf0,0x3f}, {0xd8,0x56,0x7d,0x2c}, {0xef,0x22,0x33,0x90},
|
||||
{0xc7,0x87,0x49,0x4e}, {0xc1,0xd9,0x38,0xd1}, {0xfe,0x8c,0xca,0xa2}, {0x36,0x98,0xd4,0x0b},
|
||||
{0xcf,0xa6,0xf5,0x81}, {0x28,0xa5,0x7a,0xde}, {0x26,0xda,0xb7,0x8e}, {0xa4,0x3f,0xad,0xbf},
|
||||
{0xe4,0x2c,0x3a,0x9d}, {0x0d,0x50,0x78,0x92}, {0x9b,0x6a,0x5f,0xcc}, {0x62,0x54,0x7e,0x46},
|
||||
{0xc2,0xf6,0x8d,0x13}, {0xe8,0x90,0xd8,0xb8}, {0x5e,0x2e,0x39,0xf7}, {0xf5,0x82,0xc3,0xaf},
|
||||
{0xbe,0x9f,0x5d,0x80}, {0x7c,0x69,0xd0,0x93}, {0xa9,0x6f,0xd5,0x2d}, {0xb3,0xcf,0x25,0x12},
|
||||
{0x3b,0xc8,0xac,0x99}, {0xa7,0x10,0x18,0x7d}, {0x6e,0xe8,0x9c,0x63}, {0x7b,0xdb,0x3b,0xbb},
|
||||
{0x09,0xcd,0x26,0x78}, {0xf4,0x6e,0x59,0x18}, {0x01,0xec,0x9a,0xb7}, {0xa8,0x83,0x4f,0x9a},
|
||||
{0x65,0xe6,0x95,0x6e}, {0x7e,0xaa,0xff,0xe6}, {0x08,0x21,0xbc,0xcf}, {0xe6,0xef,0x15,0xe8},
|
||||
{0xd9,0xba,0xe7,0x9b}, {0xce,0x4a,0x6f,0x36}, {0xd4,0xea,0x9f,0x09}, {0xd6,0x29,0xb0,0x7c},
|
||||
{0xaf,0x31,0xa4,0xb2}, {0x31,0x2a,0x3f,0x23}, {0x30,0xc6,0xa5,0x94}, {0xc0,0x35,0xa2,0x66},
|
||||
{0x37,0x74,0x4e,0xbc}, {0xa6,0xfc,0x82,0xca}, {0xb0,0xe0,0x90,0xd0}, {0x15,0x33,0xa7,0xd8},
|
||||
{0x4a,0xf1,0x04,0x98}, {0xf7,0x41,0xec,0xda}, {0x0e,0x7f,0xcd,0x50}, {0x2f,0x17,0x91,0xf6},
|
||||
{0x8d,0x76,0x4d,0xd6}, {0x4d,0x43,0xef,0xb0}, {0x54,0xcc,0xaa,0x4d}, {0xdf,0xe4,0x96,0x04},
|
||||
{0xe3,0x9e,0xd1,0xb5}, {0x1b,0x4c,0x6a,0x88}, {0xb8,0xc1,0x2c,0x1f}, {0x7f,0x46,0x65,0x51},
|
||||
{0x04,0x9d,0x5e,0xea}, {0x5d,0x01,0x8c,0x35}, {0x73,0xfa,0x87,0x74}, {0x2e,0xfb,0x0b,0x41},
|
||||
{0x5a,0xb3,0x67,0x1d}, {0x52,0x92,0xdb,0xd2}, {0x33,0xe9,0x10,0x56}, {0x13,0x6d,0xd6,0x47},
|
||||
{0x8c,0x9a,0xd7,0x61}, {0x7a,0x37,0xa1,0x0c}, {0x8e,0x59,0xf8,0x14}, {0x89,0xeb,0x13,0x3c},
|
||||
{0xee,0xce,0xa9,0x27}, {0x35,0xb7,0x61,0xc9}, {0xed,0xe1,0x1c,0xe5}, {0x3c,0x7a,0x47,0xb1},
|
||||
{0x59,0x9c,0xd2,0xdf}, {0x3f,0x55,0xf2,0x73}, {0x79,0x18,0x14,0xce}, {0xbf,0x73,0xc7,0x37},
|
||||
{0xea,0x53,0xf7,0xcd}, {0x5b,0x5f,0xfd,0xaa}, {0x14,0xdf,0x3d,0x6f}, {0x86,0x78,0x44,0xdb},
|
||||
{0x81,0xca,0xaf,0xf3}, {0x3e,0xb9,0x68,0xc4}, {0x2c,0x38,0x24,0x34}, {0x5f,0xc2,0xa3,0x40},
|
||||
{0x72,0x16,0x1d,0xc3}, {0x0c,0xbc,0xe2,0x25}, {0x8b,0x28,0x3c,0x49}, {0x41,0xff,0x0d,0x95},
|
||||
{0x71,0x39,0xa8,0x01}, {0xde,0x08,0x0c,0xb3}, {0x9c,0xd8,0xb4,0xe4}, {0x90,0x64,0x56,0xc1},
|
||||
{0x61,0x7b,0xcb,0x84}, {0x70,0xd5,0x32,0xb6}, {0x74,0x48,0x6c,0x5c}, {0x42,0xd0,0xb8,0x57}
|
||||
}
|
||||
};
|
||||
#define T6 xT6.xt8
|
||||
|
||||
static const union xtab xT7 = {
|
||||
.xt8 = {
|
||||
{0xa7,0x50,0x51,0xf4}, {0x65,0x53,0x7e,0x41}, {0xa4,0xc3,0x1a,0x17}, {0x5e,0x96,0x3a,0x27},
|
||||
{0x6b,0xcb,0x3b,0xab}, {0x45,0xf1,0x1f,0x9d}, {0x58,0xab,0xac,0xfa}, {0x03,0x93,0x4b,0xe3},
|
||||
{0xfa,0x55,0x20,0x30}, {0x6d,0xf6,0xad,0x76}, {0x76,0x91,0x88,0xcc}, {0x4c,0x25,0xf5,0x02},
|
||||
{0xd7,0xfc,0x4f,0xe5}, {0xcb,0xd7,0xc5,0x2a}, {0x44,0x80,0x26,0x35}, {0xa3,0x8f,0xb5,0x62},
|
||||
{0x5a,0x49,0xde,0xb1}, {0x1b,0x67,0x25,0xba}, {0x0e,0x98,0x45,0xea}, {0xc0,0xe1,0x5d,0xfe},
|
||||
{0x75,0x02,0xc3,0x2f}, {0xf0,0x12,0x81,0x4c}, {0x97,0xa3,0x8d,0x46}, {0xf9,0xc6,0x6b,0xd3},
|
||||
{0x5f,0xe7,0x03,0x8f}, {0x9c,0x95,0x15,0x92}, {0x7a,0xeb,0xbf,0x6d}, {0x59,0xda,0x95,0x52},
|
||||
{0x83,0x2d,0xd4,0xbe}, {0x21,0xd3,0x58,0x74}, {0x69,0x29,0x49,0xe0}, {0xc8,0x44,0x8e,0xc9},
|
||||
{0x89,0x6a,0x75,0xc2}, {0x79,0x78,0xf4,0x8e}, {0x3e,0x6b,0x99,0x58}, {0x71,0xdd,0x27,0xb9},
|
||||
{0x4f,0xb6,0xbe,0xe1}, {0xad,0x17,0xf0,0x88}, {0xac,0x66,0xc9,0x20}, {0x3a,0xb4,0x7d,0xce},
|
||||
{0x4a,0x18,0x63,0xdf}, {0x31,0x82,0xe5,0x1a}, {0x33,0x60,0x97,0x51}, {0x7f,0x45,0x62,0x53},
|
||||
{0x77,0xe0,0xb1,0x64}, {0xae,0x84,0xbb,0x6b}, {0xa0,0x1c,0xfe,0x81}, {0x2b,0x94,0xf9,0x08},
|
||||
{0x68,0x58,0x70,0x48}, {0xfd,0x19,0x8f,0x45}, {0x6c,0x87,0x94,0xde}, {0xf8,0xb7,0x52,0x7b},
|
||||
{0xd3,0x23,0xab,0x73}, {0x02,0xe2,0x72,0x4b}, {0x8f,0x57,0xe3,0x1f}, {0xab,0x2a,0x66,0x55},
|
||||
{0x28,0x07,0xb2,0xeb}, {0xc2,0x03,0x2f,0xb5}, {0x7b,0x9a,0x86,0xc5}, {0x08,0xa5,0xd3,0x37},
|
||||
{0x87,0xf2,0x30,0x28}, {0xa5,0xb2,0x23,0xbf}, {0x6a,0xba,0x02,0x03}, {0x82,0x5c,0xed,0x16},
|
||||
{0x1c,0x2b,0x8a,0xcf}, {0xb4,0x92,0xa7,0x79}, {0xf2,0xf0,0xf3,0x07}, {0xe2,0xa1,0x4e,0x69},
|
||||
{0xf4,0xcd,0x65,0xda}, {0xbe,0xd5,0x06,0x05}, {0x62,0x1f,0xd1,0x34}, {0xfe,0x8a,0xc4,0xa6},
|
||||
{0x53,0x9d,0x34,0x2e}, {0x55,0xa0,0xa2,0xf3}, {0xe1,0x32,0x05,0x8a}, {0xeb,0x75,0xa4,0xf6},
|
||||
{0xec,0x39,0x0b,0x83}, {0xef,0xaa,0x40,0x60}, {0x9f,0x06,0x5e,0x71}, {0x10,0x51,0xbd,0x6e},
|
||||
{0x8a,0xf9,0x3e,0x21}, {0x06,0x3d,0x96,0xdd}, {0x05,0xae,0xdd,0x3e}, {0xbd,0x46,0x4d,0xe6},
|
||||
{0x8d,0xb5,0x91,0x54}, {0x5d,0x05,0x71,0xc4}, {0xd4,0x6f,0x04,0x06}, {0x15,0xff,0x60,0x50},
|
||||
{0xfb,0x24,0x19,0x98}, {0xe9,0x97,0xd6,0xbd}, {0x43,0xcc,0x89,0x40}, {0x9e,0x77,0x67,0xd9},
|
||||
{0x42,0xbd,0xb0,0xe8}, {0x8b,0x88,0x07,0x89}, {0x5b,0x38,0xe7,0x19}, {0xee,0xdb,0x79,0xc8},
|
||||
{0x0a,0x47,0xa1,0x7c}, {0x0f,0xe9,0x7c,0x42}, {0x1e,0xc9,0xf8,0x84}, {0x00,0x00,0x00,0x00},
|
||||
{0x86,0x83,0x09,0x80}, {0xed,0x48,0x32,0x2b}, {0x70,0xac,0x1e,0x11}, {0x72,0x4e,0x6c,0x5a},
|
||||
{0xff,0xfb,0xfd,0x0e}, {0x38,0x56,0x0f,0x85}, {0xd5,0x1e,0x3d,0xae}, {0x39,0x27,0x36,0x2d},
|
||||
{0xd9,0x64,0x0a,0x0f}, {0xa6,0x21,0x68,0x5c}, {0x54,0xd1,0x9b,0x5b}, {0x2e,0x3a,0x24,0x36},
|
||||
{0x67,0xb1,0x0c,0x0a}, {0xe7,0x0f,0x93,0x57}, {0x96,0xd2,0xb4,0xee}, {0x91,0x9e,0x1b,0x9b},
|
||||
{0xc5,0x4f,0x80,0xc0}, {0x20,0xa2,0x61,0xdc}, {0x4b,0x69,0x5a,0x77}, {0x1a,0x16,0x1c,0x12},
|
||||
{0xba,0x0a,0xe2,0x93}, {0x2a,0xe5,0xc0,0xa0}, {0xe0,0x43,0x3c,0x22}, {0x17,0x1d,0x12,0x1b},
|
||||
{0x0d,0x0b,0x0e,0x09}, {0xc7,0xad,0xf2,0x8b}, {0xa8,0xb9,0x2d,0xb6}, {0xa9,0xc8,0x14,0x1e},
|
||||
{0x19,0x85,0x57,0xf1}, {0x07,0x4c,0xaf,0x75}, {0xdd,0xbb,0xee,0x99}, {0x60,0xfd,0xa3,0x7f},
|
||||
{0x26,0x9f,0xf7,0x01}, {0xf5,0xbc,0x5c,0x72}, {0x3b,0xc5,0x44,0x66}, {0x7e,0x34,0x5b,0xfb},
|
||||
{0x29,0x76,0x8b,0x43}, {0xc6,0xdc,0xcb,0x23}, {0xfc,0x68,0xb6,0xed}, {0xf1,0x63,0xb8,0xe4},
|
||||
{0xdc,0xca,0xd7,0x31}, {0x85,0x10,0x42,0x63}, {0x22,0x40,0x13,0x97}, {0x11,0x20,0x84,0xc6},
|
||||
{0x24,0x7d,0x85,0x4a}, {0x3d,0xf8,0xd2,0xbb}, {0x32,0x11,0xae,0xf9}, {0xa1,0x6d,0xc7,0x29},
|
||||
{0x2f,0x4b,0x1d,0x9e}, {0x30,0xf3,0xdc,0xb2}, {0x52,0xec,0x0d,0x86}, {0xe3,0xd0,0x77,0xc1},
|
||||
{0x16,0x6c,0x2b,0xb3}, {0xb9,0x99,0xa9,0x70}, {0x48,0xfa,0x11,0x94}, {0x64,0x22,0x47,0xe9},
|
||||
{0x8c,0xc4,0xa8,0xfc}, {0x3f,0x1a,0xa0,0xf0}, {0x2c,0xd8,0x56,0x7d}, {0x90,0xef,0x22,0x33},
|
||||
{0x4e,0xc7,0x87,0x49}, {0xd1,0xc1,0xd9,0x38}, {0xa2,0xfe,0x8c,0xca}, {0x0b,0x36,0x98,0xd4},
|
||||
{0x81,0xcf,0xa6,0xf5}, {0xde,0x28,0xa5,0x7a}, {0x8e,0x26,0xda,0xb7}, {0xbf,0xa4,0x3f,0xad},
|
||||
{0x9d,0xe4,0x2c,0x3a}, {0x92,0x0d,0x50,0x78}, {0xcc,0x9b,0x6a,0x5f}, {0x46,0x62,0x54,0x7e},
|
||||
{0x13,0xc2,0xf6,0x8d}, {0xb8,0xe8,0x90,0xd8}, {0xf7,0x5e,0x2e,0x39}, {0xaf,0xf5,0x82,0xc3},
|
||||
{0x80,0xbe,0x9f,0x5d}, {0x93,0x7c,0x69,0xd0}, {0x2d,0xa9,0x6f,0xd5}, {0x12,0xb3,0xcf,0x25},
|
||||
{0x99,0x3b,0xc8,0xac}, {0x7d,0xa7,0x10,0x18}, {0x63,0x6e,0xe8,0x9c}, {0xbb,0x7b,0xdb,0x3b},
|
||||
{0x78,0x09,0xcd,0x26}, {0x18,0xf4,0x6e,0x59}, {0xb7,0x01,0xec,0x9a}, {0x9a,0xa8,0x83,0x4f},
|
||||
{0x6e,0x65,0xe6,0x95}, {0xe6,0x7e,0xaa,0xff}, {0xcf,0x08,0x21,0xbc}, {0xe8,0xe6,0xef,0x15},
|
||||
{0x9b,0xd9,0xba,0xe7}, {0x36,0xce,0x4a,0x6f}, {0x09,0xd4,0xea,0x9f}, {0x7c,0xd6,0x29,0xb0},
|
||||
{0xb2,0xaf,0x31,0xa4}, {0x23,0x31,0x2a,0x3f}, {0x94,0x30,0xc6,0xa5}, {0x66,0xc0,0x35,0xa2},
|
||||
{0xbc,0x37,0x74,0x4e}, {0xca,0xa6,0xfc,0x82}, {0xd0,0xb0,0xe0,0x90}, {0xd8,0x15,0x33,0xa7},
|
||||
{0x98,0x4a,0xf1,0x04}, {0xda,0xf7,0x41,0xec}, {0x50,0x0e,0x7f,0xcd}, {0xf6,0x2f,0x17,0x91},
|
||||
{0xd6,0x8d,0x76,0x4d}, {0xb0,0x4d,0x43,0xef}, {0x4d,0x54,0xcc,0xaa}, {0x04,0xdf,0xe4,0x96},
|
||||
{0xb5,0xe3,0x9e,0xd1}, {0x88,0x1b,0x4c,0x6a}, {0x1f,0xb8,0xc1,0x2c}, {0x51,0x7f,0x46,0x65},
|
||||
{0xea,0x04,0x9d,0x5e}, {0x35,0x5d,0x01,0x8c}, {0x74,0x73,0xfa,0x87}, {0x41,0x2e,0xfb,0x0b},
|
||||
{0x1d,0x5a,0xb3,0x67}, {0xd2,0x52,0x92,0xdb}, {0x56,0x33,0xe9,0x10}, {0x47,0x13,0x6d,0xd6},
|
||||
{0x61,0x8c,0x9a,0xd7}, {0x0c,0x7a,0x37,0xa1}, {0x14,0x8e,0x59,0xf8}, {0x3c,0x89,0xeb,0x13},
|
||||
{0x27,0xee,0xce,0xa9}, {0xc9,0x35,0xb7,0x61}, {0xe5,0xed,0xe1,0x1c}, {0xb1,0x3c,0x7a,0x47},
|
||||
{0xdf,0x59,0x9c,0xd2}, {0x73,0x3f,0x55,0xf2}, {0xce,0x79,0x18,0x14}, {0x37,0xbf,0x73,0xc7},
|
||||
{0xcd,0xea,0x53,0xf7}, {0xaa,0x5b,0x5f,0xfd}, {0x6f,0x14,0xdf,0x3d}, {0xdb,0x86,0x78,0x44},
|
||||
{0xf3,0x81,0xca,0xaf}, {0xc4,0x3e,0xb9,0x68}, {0x34,0x2c,0x38,0x24}, {0x40,0x5f,0xc2,0xa3},
|
||||
{0xc3,0x72,0x16,0x1d}, {0x25,0x0c,0xbc,0xe2}, {0x49,0x8b,0x28,0x3c}, {0x95,0x41,0xff,0x0d},
|
||||
{0x01,0x71,0x39,0xa8}, {0xb3,0xde,0x08,0x0c}, {0xe4,0x9c,0xd8,0xb4}, {0xc1,0x90,0x64,0x56},
|
||||
{0x84,0x61,0x7b,0xcb}, {0xb6,0x70,0xd5,0x32}, {0x5c,0x74,0x48,0x6c}, {0x57,0x42,0xd0,0xb8}
|
||||
}
|
||||
};
|
||||
#define T7 xT7.xt8
|
||||
|
||||
static const union xtab xT8 = {
|
||||
.xt8 = {
|
||||
{0xf4,0xa7,0x50,0x51}, {0x41,0x65,0x53,0x7e}, {0x17,0xa4,0xc3,0x1a}, {0x27,0x5e,0x96,0x3a},
|
||||
{0xab,0x6b,0xcb,0x3b}, {0x9d,0x45,0xf1,0x1f}, {0xfa,0x58,0xab,0xac}, {0xe3,0x03,0x93,0x4b},
|
||||
{0x30,0xfa,0x55,0x20}, {0x76,0x6d,0xf6,0xad}, {0xcc,0x76,0x91,0x88}, {0x02,0x4c,0x25,0xf5},
|
||||
{0xe5,0xd7,0xfc,0x4f}, {0x2a,0xcb,0xd7,0xc5}, {0x35,0x44,0x80,0x26}, {0x62,0xa3,0x8f,0xb5},
|
||||
{0xb1,0x5a,0x49,0xde}, {0xba,0x1b,0x67,0x25}, {0xea,0x0e,0x98,0x45}, {0xfe,0xc0,0xe1,0x5d},
|
||||
{0x2f,0x75,0x02,0xc3}, {0x4c,0xf0,0x12,0x81}, {0x46,0x97,0xa3,0x8d}, {0xd3,0xf9,0xc6,0x6b},
|
||||
{0x8f,0x5f,0xe7,0x03}, {0x92,0x9c,0x95,0x15}, {0x6d,0x7a,0xeb,0xbf}, {0x52,0x59,0xda,0x95},
|
||||
{0xbe,0x83,0x2d,0xd4}, {0x74,0x21,0xd3,0x58}, {0xe0,0x69,0x29,0x49}, {0xc9,0xc8,0x44,0x8e},
|
||||
{0xc2,0x89,0x6a,0x75}, {0x8e,0x79,0x78,0xf4}, {0x58,0x3e,0x6b,0x99}, {0xb9,0x71,0xdd,0x27},
|
||||
{0xe1,0x4f,0xb6,0xbe}, {0x88,0xad,0x17,0xf0}, {0x20,0xac,0x66,0xc9}, {0xce,0x3a,0xb4,0x7d},
|
||||
{0xdf,0x4a,0x18,0x63}, {0x1a,0x31,0x82,0xe5}, {0x51,0x33,0x60,0x97}, {0x53,0x7f,0x45,0x62},
|
||||
{0x64,0x77,0xe0,0xb1}, {0x6b,0xae,0x84,0xbb}, {0x81,0xa0,0x1c,0xfe}, {0x08,0x2b,0x94,0xf9},
|
||||
{0x48,0x68,0x58,0x70}, {0x45,0xfd,0x19,0x8f}, {0xde,0x6c,0x87,0x94}, {0x7b,0xf8,0xb7,0x52},
|
||||
{0x73,0xd3,0x23,0xab}, {0x4b,0x02,0xe2,0x72}, {0x1f,0x8f,0x57,0xe3}, {0x55,0xab,0x2a,0x66},
|
||||
{0xeb,0x28,0x07,0xb2}, {0xb5,0xc2,0x03,0x2f}, {0xc5,0x7b,0x9a,0x86}, {0x37,0x08,0xa5,0xd3},
|
||||
{0x28,0x87,0xf2,0x30}, {0xbf,0xa5,0xb2,0x23}, {0x03,0x6a,0xba,0x02}, {0x16,0x82,0x5c,0xed},
|
||||
{0xcf,0x1c,0x2b,0x8a}, {0x79,0xb4,0x92,0xa7}, {0x07,0xf2,0xf0,0xf3}, {0x69,0xe2,0xa1,0x4e},
|
||||
{0xda,0xf4,0xcd,0x65}, {0x05,0xbe,0xd5,0x06}, {0x34,0x62,0x1f,0xd1}, {0xa6,0xfe,0x8a,0xc4},
|
||||
{0x2e,0x53,0x9d,0x34}, {0xf3,0x55,0xa0,0xa2}, {0x8a,0xe1,0x32,0x05}, {0xf6,0xeb,0x75,0xa4},
|
||||
{0x83,0xec,0x39,0x0b}, {0x60,0xef,0xaa,0x40}, {0x71,0x9f,0x06,0x5e}, {0x6e,0x10,0x51,0xbd},
|
||||
{0x21,0x8a,0xf9,0x3e}, {0xdd,0x06,0x3d,0x96}, {0x3e,0x05,0xae,0xdd}, {0xe6,0xbd,0x46,0x4d},
|
||||
{0x54,0x8d,0xb5,0x91}, {0xc4,0x5d,0x05,0x71}, {0x06,0xd4,0x6f,0x04}, {0x50,0x15,0xff,0x60},
|
||||
{0x98,0xfb,0x24,0x19}, {0xbd,0xe9,0x97,0xd6}, {0x40,0x43,0xcc,0x89}, {0xd9,0x9e,0x77,0x67},
|
||||
{0xe8,0x42,0xbd,0xb0}, {0x89,0x8b,0x88,0x07}, {0x19,0x5b,0x38,0xe7}, {0xc8,0xee,0xdb,0x79},
|
||||
{0x7c,0x0a,0x47,0xa1}, {0x42,0x0f,0xe9,0x7c}, {0x84,0x1e,0xc9,0xf8}, {0x00,0x00,0x00,0x00},
|
||||
{0x80,0x86,0x83,0x09}, {0x2b,0xed,0x48,0x32}, {0x11,0x70,0xac,0x1e}, {0x5a,0x72,0x4e,0x6c},
|
||||
{0x0e,0xff,0xfb,0xfd}, {0x85,0x38,0x56,0x0f}, {0xae,0xd5,0x1e,0x3d}, {0x2d,0x39,0x27,0x36},
|
||||
{0x0f,0xd9,0x64,0x0a}, {0x5c,0xa6,0x21,0x68}, {0x5b,0x54,0xd1,0x9b}, {0x36,0x2e,0x3a,0x24},
|
||||
{0x0a,0x67,0xb1,0x0c}, {0x57,0xe7,0x0f,0x93}, {0xee,0x96,0xd2,0xb4}, {0x9b,0x91,0x9e,0x1b},
|
||||
{0xc0,0xc5,0x4f,0x80}, {0xdc,0x20,0xa2,0x61}, {0x77,0x4b,0x69,0x5a}, {0x12,0x1a,0x16,0x1c},
|
||||
{0x93,0xba,0x0a,0xe2}, {0xa0,0x2a,0xe5,0xc0}, {0x22,0xe0,0x43,0x3c}, {0x1b,0x17,0x1d,0x12},
|
||||
{0x09,0x0d,0x0b,0x0e}, {0x8b,0xc7,0xad,0xf2}, {0xb6,0xa8,0xb9,0x2d}, {0x1e,0xa9,0xc8,0x14},
|
||||
{0xf1,0x19,0x85,0x57}, {0x75,0x07,0x4c,0xaf}, {0x99,0xdd,0xbb,0xee}, {0x7f,0x60,0xfd,0xa3},
|
||||
{0x01,0x26,0x9f,0xf7}, {0x72,0xf5,0xbc,0x5c}, {0x66,0x3b,0xc5,0x44}, {0xfb,0x7e,0x34,0x5b},
|
||||
{0x43,0x29,0x76,0x8b}, {0x23,0xc6,0xdc,0xcb}, {0xed,0xfc,0x68,0xb6}, {0xe4,0xf1,0x63,0xb8},
|
||||
{0x31,0xdc,0xca,0xd7}, {0x63,0x85,0x10,0x42}, {0x97,0x22,0x40,0x13}, {0xc6,0x11,0x20,0x84},
|
||||
{0x4a,0x24,0x7d,0x85}, {0xbb,0x3d,0xf8,0xd2}, {0xf9,0x32,0x11,0xae}, {0x29,0xa1,0x6d,0xc7},
|
||||
{0x9e,0x2f,0x4b,0x1d}, {0xb2,0x30,0xf3,0xdc}, {0x86,0x52,0xec,0x0d}, {0xc1,0xe3,0xd0,0x77},
|
||||
{0xb3,0x16,0x6c,0x2b}, {0x70,0xb9,0x99,0xa9}, {0x94,0x48,0xfa,0x11}, {0xe9,0x64,0x22,0x47},
|
||||
{0xfc,0x8c,0xc4,0xa8}, {0xf0,0x3f,0x1a,0xa0}, {0x7d,0x2c,0xd8,0x56}, {0x33,0x90,0xef,0x22},
|
||||
{0x49,0x4e,0xc7,0x87}, {0x38,0xd1,0xc1,0xd9}, {0xca,0xa2,0xfe,0x8c}, {0xd4,0x0b,0x36,0x98},
|
||||
{0xf5,0x81,0xcf,0xa6}, {0x7a,0xde,0x28,0xa5}, {0xb7,0x8e,0x26,0xda}, {0xad,0xbf,0xa4,0x3f},
|
||||
{0x3a,0x9d,0xe4,0x2c}, {0x78,0x92,0x0d,0x50}, {0x5f,0xcc,0x9b,0x6a}, {0x7e,0x46,0x62,0x54},
|
||||
{0x8d,0x13,0xc2,0xf6}, {0xd8,0xb8,0xe8,0x90}, {0x39,0xf7,0x5e,0x2e}, {0xc3,0xaf,0xf5,0x82},
|
||||
{0x5d,0x80,0xbe,0x9f}, {0xd0,0x93,0x7c,0x69}, {0xd5,0x2d,0xa9,0x6f}, {0x25,0x12,0xb3,0xcf},
|
||||
{0xac,0x99,0x3b,0xc8}, {0x18,0x7d,0xa7,0x10}, {0x9c,0x63,0x6e,0xe8}, {0x3b,0xbb,0x7b,0xdb},
|
||||
{0x26,0x78,0x09,0xcd}, {0x59,0x18,0xf4,0x6e}, {0x9a,0xb7,0x01,0xec}, {0x4f,0x9a,0xa8,0x83},
|
||||
{0x95,0x6e,0x65,0xe6}, {0xff,0xe6,0x7e,0xaa}, {0xbc,0xcf,0x08,0x21}, {0x15,0xe8,0xe6,0xef},
|
||||
{0xe7,0x9b,0xd9,0xba}, {0x6f,0x36,0xce,0x4a}, {0x9f,0x09,0xd4,0xea}, {0xb0,0x7c,0xd6,0x29},
|
||||
{0xa4,0xb2,0xaf,0x31}, {0x3f,0x23,0x31,0x2a}, {0xa5,0x94,0x30,0xc6}, {0xa2,0x66,0xc0,0x35},
|
||||
{0x4e,0xbc,0x37,0x74}, {0x82,0xca,0xa6,0xfc}, {0x90,0xd0,0xb0,0xe0}, {0xa7,0xd8,0x15,0x33},
|
||||
{0x04,0x98,0x4a,0xf1}, {0xec,0xda,0xf7,0x41}, {0xcd,0x50,0x0e,0x7f}, {0x91,0xf6,0x2f,0x17},
|
||||
{0x4d,0xd6,0x8d,0x76}, {0xef,0xb0,0x4d,0x43}, {0xaa,0x4d,0x54,0xcc}, {0x96,0x04,0xdf,0xe4},
|
||||
{0xd1,0xb5,0xe3,0x9e}, {0x6a,0x88,0x1b,0x4c}, {0x2c,0x1f,0xb8,0xc1}, {0x65,0x51,0x7f,0x46},
|
||||
{0x5e,0xea,0x04,0x9d}, {0x8c,0x35,0x5d,0x01}, {0x87,0x74,0x73,0xfa}, {0x0b,0x41,0x2e,0xfb},
|
||||
{0x67,0x1d,0x5a,0xb3}, {0xdb,0xd2,0x52,0x92}, {0x10,0x56,0x33,0xe9}, {0xd6,0x47,0x13,0x6d},
|
||||
{0xd7,0x61,0x8c,0x9a}, {0xa1,0x0c,0x7a,0x37}, {0xf8,0x14,0x8e,0x59}, {0x13,0x3c,0x89,0xeb},
|
||||
{0xa9,0x27,0xee,0xce}, {0x61,0xc9,0x35,0xb7}, {0x1c,0xe5,0xed,0xe1}, {0x47,0xb1,0x3c,0x7a},
|
||||
{0xd2,0xdf,0x59,0x9c}, {0xf2,0x73,0x3f,0x55}, {0x14,0xce,0x79,0x18}, {0xc7,0x37,0xbf,0x73},
|
||||
{0xf7,0xcd,0xea,0x53}, {0xfd,0xaa,0x5b,0x5f}, {0x3d,0x6f,0x14,0xdf}, {0x44,0xdb,0x86,0x78},
|
||||
{0xaf,0xf3,0x81,0xca}, {0x68,0xc4,0x3e,0xb9}, {0x24,0x34,0x2c,0x38}, {0xa3,0x40,0x5f,0xc2},
|
||||
{0x1d,0xc3,0x72,0x16}, {0xe2,0x25,0x0c,0xbc}, {0x3c,0x49,0x8b,0x28}, {0x0d,0x95,0x41,0xff},
|
||||
{0xa8,0x01,0x71,0x39}, {0x0c,0xb3,0xde,0x08}, {0xb4,0xe4,0x9c,0xd8}, {0x56,0xc1,0x90,0x64},
|
||||
{0xcb,0x84,0x61,0x7b}, {0x32,0xb6,0x70,0xd5}, {0x6c,0x5c,0x74,0x48}, {0xb8,0x57,0x42,0xd0}
|
||||
}
|
||||
};
|
||||
#define T8 xT8.xt8
|
||||
|
||||
static const word8 S5[256] = {
|
||||
0x52,0x09,0x6a,0xd5,
|
||||
0x30,0x36,0xa5,0x38,
|
||||
0xbf,0x40,0xa3,0x9e,
|
||||
0x81,0xf3,0xd7,0xfb,
|
||||
0x7c,0xe3,0x39,0x82,
|
||||
0x9b,0x2f,0xff,0x87,
|
||||
0x34,0x8e,0x43,0x44,
|
||||
0xc4,0xde,0xe9,0xcb,
|
||||
0x54,0x7b,0x94,0x32,
|
||||
0xa6,0xc2,0x23,0x3d,
|
||||
0xee,0x4c,0x95,0x0b,
|
||||
0x42,0xfa,0xc3,0x4e,
|
||||
0x08,0x2e,0xa1,0x66,
|
||||
0x28,0xd9,0x24,0xb2,
|
||||
0x76,0x5b,0xa2,0x49,
|
||||
0x6d,0x8b,0xd1,0x25,
|
||||
0x72,0xf8,0xf6,0x64,
|
||||
0x86,0x68,0x98,0x16,
|
||||
0xd4,0xa4,0x5c,0xcc,
|
||||
0x5d,0x65,0xb6,0x92,
|
||||
0x6c,0x70,0x48,0x50,
|
||||
0xfd,0xed,0xb9,0xda,
|
||||
0x5e,0x15,0x46,0x57,
|
||||
0xa7,0x8d,0x9d,0x84,
|
||||
0x90,0xd8,0xab,0x00,
|
||||
0x8c,0xbc,0xd3,0x0a,
|
||||
0xf7,0xe4,0x58,0x05,
|
||||
0xb8,0xb3,0x45,0x06,
|
||||
0xd0,0x2c,0x1e,0x8f,
|
||||
0xca,0x3f,0x0f,0x02,
|
||||
0xc1,0xaf,0xbd,0x03,
|
||||
0x01,0x13,0x8a,0x6b,
|
||||
0x3a,0x91,0x11,0x41,
|
||||
0x4f,0x67,0xdc,0xea,
|
||||
0x97,0xf2,0xcf,0xce,
|
||||
0xf0,0xb4,0xe6,0x73,
|
||||
0x96,0xac,0x74,0x22,
|
||||
0xe7,0xad,0x35,0x85,
|
||||
0xe2,0xf9,0x37,0xe8,
|
||||
0x1c,0x75,0xdf,0x6e,
|
||||
0x47,0xf1,0x1a,0x71,
|
||||
0x1d,0x29,0xc5,0x89,
|
||||
0x6f,0xb7,0x62,0x0e,
|
||||
0xaa,0x18,0xbe,0x1b,
|
||||
0xfc,0x56,0x3e,0x4b,
|
||||
0xc6,0xd2,0x79,0x20,
|
||||
0x9a,0xdb,0xc0,0xfe,
|
||||
0x78,0xcd,0x5a,0xf4,
|
||||
0x1f,0xdd,0xa8,0x33,
|
||||
0x88,0x07,0xc7,0x31,
|
||||
0xb1,0x12,0x10,0x59,
|
||||
0x27,0x80,0xec,0x5f,
|
||||
0x60,0x51,0x7f,0xa9,
|
||||
0x19,0xb5,0x4a,0x0d,
|
||||
0x2d,0xe5,0x7a,0x9f,
|
||||
0x93,0xc9,0x9c,0xef,
|
||||
0xa0,0xe0,0x3b,0x4d,
|
||||
0xae,0x2a,0xf5,0xb0,
|
||||
0xc8,0xeb,0xbb,0x3c,
|
||||
0x83,0x53,0x99,0x61,
|
||||
0x17,0x2b,0x04,0x7e,
|
||||
0xba,0x77,0xd6,0x26,
|
||||
0xe1,0x69,0x14,0x63,
|
||||
0x55,0x21,0x0c,0x7d
|
||||
};
|
||||
|
||||
static const union xtab xU1 = {
|
||||
.xt8 = {
|
||||
{0x00,0x00,0x00,0x00}, {0x0e,0x09,0x0d,0x0b}, {0x1c,0x12,0x1a,0x16}, {0x12,0x1b,0x17,0x1d},
|
||||
{0x38,0x24,0x34,0x2c}, {0x36,0x2d,0x39,0x27}, {0x24,0x36,0x2e,0x3a}, {0x2a,0x3f,0x23,0x31},
|
||||
{0x70,0x48,0x68,0x58}, {0x7e,0x41,0x65,0x53}, {0x6c,0x5a,0x72,0x4e}, {0x62,0x53,0x7f,0x45},
|
||||
{0x48,0x6c,0x5c,0x74}, {0x46,0x65,0x51,0x7f}, {0x54,0x7e,0x46,0x62}, {0x5a,0x77,0x4b,0x69},
|
||||
{0xe0,0x90,0xd0,0xb0}, {0xee,0x99,0xdd,0xbb}, {0xfc,0x82,0xca,0xa6}, {0xf2,0x8b,0xc7,0xad},
|
||||
{0xd8,0xb4,0xe4,0x9c}, {0xd6,0xbd,0xe9,0x97}, {0xc4,0xa6,0xfe,0x8a}, {0xca,0xaf,0xf3,0x81},
|
||||
{0x90,0xd8,0xb8,0xe8}, {0x9e,0xd1,0xb5,0xe3}, {0x8c,0xca,0xa2,0xfe}, {0x82,0xc3,0xaf,0xf5},
|
||||
{0xa8,0xfc,0x8c,0xc4}, {0xa6,0xf5,0x81,0xcf}, {0xb4,0xee,0x96,0xd2}, {0xba,0xe7,0x9b,0xd9},
|
||||
{0xdb,0x3b,0xbb,0x7b}, {0xd5,0x32,0xb6,0x70}, {0xc7,0x29,0xa1,0x6d}, {0xc9,0x20,0xac,0x66},
|
||||
{0xe3,0x1f,0x8f,0x57}, {0xed,0x16,0x82,0x5c}, {0xff,0x0d,0x95,0x41}, {0xf1,0x04,0x98,0x4a},
|
||||
{0xab,0x73,0xd3,0x23}, {0xa5,0x7a,0xde,0x28}, {0xb7,0x61,0xc9,0x35}, {0xb9,0x68,0xc4,0x3e},
|
||||
{0x93,0x57,0xe7,0x0f}, {0x9d,0x5e,0xea,0x04}, {0x8f,0x45,0xfd,0x19}, {0x81,0x4c,0xf0,0x12},
|
||||
{0x3b,0xab,0x6b,0xcb}, {0x35,0xa2,0x66,0xc0}, {0x27,0xb9,0x71,0xdd}, {0x29,0xb0,0x7c,0xd6},
|
||||
{0x03,0x8f,0x5f,0xe7}, {0x0d,0x86,0x52,0xec}, {0x1f,0x9d,0x45,0xf1}, {0x11,0x94,0x48,0xfa},
|
||||
{0x4b,0xe3,0x03,0x93}, {0x45,0xea,0x0e,0x98}, {0x57,0xf1,0x19,0x85}, {0x59,0xf8,0x14,0x8e},
|
||||
{0x73,0xc7,0x37,0xbf}, {0x7d,0xce,0x3a,0xb4}, {0x6f,0xd5,0x2d,0xa9}, {0x61,0xdc,0x20,0xa2},
|
||||
{0xad,0x76,0x6d,0xf6}, {0xa3,0x7f,0x60,0xfd}, {0xb1,0x64,0x77,0xe0}, {0xbf,0x6d,0x7a,0xeb},
|
||||
{0x95,0x52,0x59,0xda}, {0x9b,0x5b,0x54,0xd1}, {0x89,0x40,0x43,0xcc}, {0x87,0x49,0x4e,0xc7},
|
||||
{0xdd,0x3e,0x05,0xae}, {0xd3,0x37,0x08,0xa5}, {0xc1,0x2c,0x1f,0xb8}, {0xcf,0x25,0x12,0xb3},
|
||||
{0xe5,0x1a,0x31,0x82}, {0xeb,0x13,0x3c,0x89}, {0xf9,0x08,0x2b,0x94}, {0xf7,0x01,0x26,0x9f},
|
||||
{0x4d,0xe6,0xbd,0x46}, {0x43,0xef,0xb0,0x4d}, {0x51,0xf4,0xa7,0x50}, {0x5f,0xfd,0xaa,0x5b},
|
||||
{0x75,0xc2,0x89,0x6a}, {0x7b,0xcb,0x84,0x61}, {0x69,0xd0,0x93,0x7c}, {0x67,0xd9,0x9e,0x77},
|
||||
{0x3d,0xae,0xd5,0x1e}, {0x33,0xa7,0xd8,0x15}, {0x21,0xbc,0xcf,0x08}, {0x2f,0xb5,0xc2,0x03},
|
||||
{0x05,0x8a,0xe1,0x32}, {0x0b,0x83,0xec,0x39}, {0x19,0x98,0xfb,0x24}, {0x17,0x91,0xf6,0x2f},
|
||||
{0x76,0x4d,0xd6,0x8d}, {0x78,0x44,0xdb,0x86}, {0x6a,0x5f,0xcc,0x9b}, {0x64,0x56,0xc1,0x90},
|
||||
{0x4e,0x69,0xe2,0xa1}, {0x40,0x60,0xef,0xaa}, {0x52,0x7b,0xf8,0xb7}, {0x5c,0x72,0xf5,0xbc},
|
||||
{0x06,0x05,0xbe,0xd5}, {0x08,0x0c,0xb3,0xde}, {0x1a,0x17,0xa4,0xc3}, {0x14,0x1e,0xa9,0xc8},
|
||||
{0x3e,0x21,0x8a,0xf9}, {0x30,0x28,0x87,0xf2}, {0x22,0x33,0x90,0xef}, {0x2c,0x3a,0x9d,0xe4},
|
||||
{0x96,0xdd,0x06,0x3d}, {0x98,0xd4,0x0b,0x36}, {0x8a,0xcf,0x1c,0x2b}, {0x84,0xc6,0x11,0x20},
|
||||
{0xae,0xf9,0x32,0x11}, {0xa0,0xf0,0x3f,0x1a}, {0xb2,0xeb,0x28,0x07}, {0xbc,0xe2,0x25,0x0c},
|
||||
{0xe6,0x95,0x6e,0x65}, {0xe8,0x9c,0x63,0x6e}, {0xfa,0x87,0x74,0x73}, {0xf4,0x8e,0x79,0x78},
|
||||
{0xde,0xb1,0x5a,0x49}, {0xd0,0xb8,0x57,0x42}, {0xc2,0xa3,0x40,0x5f}, {0xcc,0xaa,0x4d,0x54},
|
||||
{0x41,0xec,0xda,0xf7}, {0x4f,0xe5,0xd7,0xfc}, {0x5d,0xfe,0xc0,0xe1}, {0x53,0xf7,0xcd,0xea},
|
||||
{0x79,0xc8,0xee,0xdb}, {0x77,0xc1,0xe3,0xd0}, {0x65,0xda,0xf4,0xcd}, {0x6b,0xd3,0xf9,0xc6},
|
||||
{0x31,0xa4,0xb2,0xaf}, {0x3f,0xad,0xbf,0xa4}, {0x2d,0xb6,0xa8,0xb9}, {0x23,0xbf,0xa5,0xb2},
|
||||
{0x09,0x80,0x86,0x83}, {0x07,0x89,0x8b,0x88}, {0x15,0x92,0x9c,0x95}, {0x1b,0x9b,0x91,0x9e},
|
||||
{0xa1,0x7c,0x0a,0x47}, {0xaf,0x75,0x07,0x4c}, {0xbd,0x6e,0x10,0x51}, {0xb3,0x67,0x1d,0x5a},
|
||||
{0x99,0x58,0x3e,0x6b}, {0x97,0x51,0x33,0x60}, {0x85,0x4a,0x24,0x7d}, {0x8b,0x43,0x29,0x76},
|
||||
{0xd1,0x34,0x62,0x1f}, {0xdf,0x3d,0x6f,0x14}, {0xcd,0x26,0x78,0x09}, {0xc3,0x2f,0x75,0x02},
|
||||
{0xe9,0x10,0x56,0x33}, {0xe7,0x19,0x5b,0x38}, {0xf5,0x02,0x4c,0x25}, {0xfb,0x0b,0x41,0x2e},
|
||||
{0x9a,0xd7,0x61,0x8c}, {0x94,0xde,0x6c,0x87}, {0x86,0xc5,0x7b,0x9a}, {0x88,0xcc,0x76,0x91},
|
||||
{0xa2,0xf3,0x55,0xa0}, {0xac,0xfa,0x58,0xab}, {0xbe,0xe1,0x4f,0xb6}, {0xb0,0xe8,0x42,0xbd},
|
||||
{0xea,0x9f,0x09,0xd4}, {0xe4,0x96,0x04,0xdf}, {0xf6,0x8d,0x13,0xc2}, {0xf8,0x84,0x1e,0xc9},
|
||||
{0xd2,0xbb,0x3d,0xf8}, {0xdc,0xb2,0x30,0xf3}, {0xce,0xa9,0x27,0xee}, {0xc0,0xa0,0x2a,0xe5},
|
||||
{0x7a,0x47,0xb1,0x3c}, {0x74,0x4e,0xbc,0x37}, {0x66,0x55,0xab,0x2a}, {0x68,0x5c,0xa6,0x21},
|
||||
{0x42,0x63,0x85,0x10}, {0x4c,0x6a,0x88,0x1b}, {0x5e,0x71,0x9f,0x06}, {0x50,0x78,0x92,0x0d},
|
||||
{0x0a,0x0f,0xd9,0x64}, {0x04,0x06,0xd4,0x6f}, {0x16,0x1d,0xc3,0x72}, {0x18,0x14,0xce,0x79},
|
||||
{0x32,0x2b,0xed,0x48}, {0x3c,0x22,0xe0,0x43}, {0x2e,0x39,0xf7,0x5e}, {0x20,0x30,0xfa,0x55},
|
||||
{0xec,0x9a,0xb7,0x01}, {0xe2,0x93,0xba,0x0a}, {0xf0,0x88,0xad,0x17}, {0xfe,0x81,0xa0,0x1c},
|
||||
{0xd4,0xbe,0x83,0x2d}, {0xda,0xb7,0x8e,0x26}, {0xc8,0xac,0x99,0x3b}, {0xc6,0xa5,0x94,0x30},
|
||||
{0x9c,0xd2,0xdf,0x59}, {0x92,0xdb,0xd2,0x52}, {0x80,0xc0,0xc5,0x4f}, {0x8e,0xc9,0xc8,0x44},
|
||||
{0xa4,0xf6,0xeb,0x75}, {0xaa,0xff,0xe6,0x7e}, {0xb8,0xe4,0xf1,0x63}, {0xb6,0xed,0xfc,0x68},
|
||||
{0x0c,0x0a,0x67,0xb1}, {0x02,0x03,0x6a,0xba}, {0x10,0x18,0x7d,0xa7}, {0x1e,0x11,0x70,0xac},
|
||||
{0x34,0x2e,0x53,0x9d}, {0x3a,0x27,0x5e,0x96}, {0x28,0x3c,0x49,0x8b}, {0x26,0x35,0x44,0x80},
|
||||
{0x7c,0x42,0x0f,0xe9}, {0x72,0x4b,0x02,0xe2}, {0x60,0x50,0x15,0xff}, {0x6e,0x59,0x18,0xf4},
|
||||
{0x44,0x66,0x3b,0xc5}, {0x4a,0x6f,0x36,0xce}, {0x58,0x74,0x21,0xd3}, {0x56,0x7d,0x2c,0xd8},
|
||||
{0x37,0xa1,0x0c,0x7a}, {0x39,0xa8,0x01,0x71}, {0x2b,0xb3,0x16,0x6c}, {0x25,0xba,0x1b,0x67},
|
||||
{0x0f,0x85,0x38,0x56}, {0x01,0x8c,0x35,0x5d}, {0x13,0x97,0x22,0x40}, {0x1d,0x9e,0x2f,0x4b},
|
||||
{0x47,0xe9,0x64,0x22}, {0x49,0xe0,0x69,0x29}, {0x5b,0xfb,0x7e,0x34}, {0x55,0xf2,0x73,0x3f},
|
||||
{0x7f,0xcd,0x50,0x0e}, {0x71,0xc4,0x5d,0x05}, {0x63,0xdf,0x4a,0x18}, {0x6d,0xd6,0x47,0x13},
|
||||
{0xd7,0x31,0xdc,0xca}, {0xd9,0x38,0xd1,0xc1}, {0xcb,0x23,0xc6,0xdc}, {0xc5,0x2a,0xcb,0xd7},
|
||||
{0xef,0x15,0xe8,0xe6}, {0xe1,0x1c,0xe5,0xed}, {0xf3,0x07,0xf2,0xf0}, {0xfd,0x0e,0xff,0xfb},
|
||||
{0xa7,0x79,0xb4,0x92}, {0xa9,0x70,0xb9,0x99}, {0xbb,0x6b,0xae,0x84}, {0xb5,0x62,0xa3,0x8f},
|
||||
{0x9f,0x5d,0x80,0xbe}, {0x91,0x54,0x8d,0xb5}, {0x83,0x4f,0x9a,0xa8}, {0x8d,0x46,0x97,0xa3}
|
||||
}
|
||||
};
|
||||
#define U1 xU1.xt8
|
||||
|
||||
static const union xtab xU2 = {
|
||||
.xt8 = {
|
||||
{0x00,0x00,0x00,0x00}, {0x0b,0x0e,0x09,0x0d}, {0x16,0x1c,0x12,0x1a}, {0x1d,0x12,0x1b,0x17},
|
||||
{0x2c,0x38,0x24,0x34}, {0x27,0x36,0x2d,0x39}, {0x3a,0x24,0x36,0x2e}, {0x31,0x2a,0x3f,0x23},
|
||||
{0x58,0x70,0x48,0x68}, {0x53,0x7e,0x41,0x65}, {0x4e,0x6c,0x5a,0x72}, {0x45,0x62,0x53,0x7f},
|
||||
{0x74,0x48,0x6c,0x5c}, {0x7f,0x46,0x65,0x51}, {0x62,0x54,0x7e,0x46}, {0x69,0x5a,0x77,0x4b},
|
||||
{0xb0,0xe0,0x90,0xd0}, {0xbb,0xee,0x99,0xdd}, {0xa6,0xfc,0x82,0xca}, {0xad,0xf2,0x8b,0xc7},
|
||||
{0x9c,0xd8,0xb4,0xe4}, {0x97,0xd6,0xbd,0xe9}, {0x8a,0xc4,0xa6,0xfe}, {0x81,0xca,0xaf,0xf3},
|
||||
{0xe8,0x90,0xd8,0xb8}, {0xe3,0x9e,0xd1,0xb5}, {0xfe,0x8c,0xca,0xa2}, {0xf5,0x82,0xc3,0xaf},
|
||||
{0xc4,0xa8,0xfc,0x8c}, {0xcf,0xa6,0xf5,0x81}, {0xd2,0xb4,0xee,0x96}, {0xd9,0xba,0xe7,0x9b},
|
||||
{0x7b,0xdb,0x3b,0xbb}, {0x70,0xd5,0x32,0xb6}, {0x6d,0xc7,0x29,0xa1}, {0x66,0xc9,0x20,0xac},
|
||||
{0x57,0xe3,0x1f,0x8f}, {0x5c,0xed,0x16,0x82}, {0x41,0xff,0x0d,0x95}, {0x4a,0xf1,0x04,0x98},
|
||||
{0x23,0xab,0x73,0xd3}, {0x28,0xa5,0x7a,0xde}, {0x35,0xb7,0x61,0xc9}, {0x3e,0xb9,0x68,0xc4},
|
||||
{0x0f,0x93,0x57,0xe7}, {0x04,0x9d,0x5e,0xea}, {0x19,0x8f,0x45,0xfd}, {0x12,0x81,0x4c,0xf0},
|
||||
{0xcb,0x3b,0xab,0x6b}, {0xc0,0x35,0xa2,0x66}, {0xdd,0x27,0xb9,0x71}, {0xd6,0x29,0xb0,0x7c},
|
||||
{0xe7,0x03,0x8f,0x5f}, {0xec,0x0d,0x86,0x52}, {0xf1,0x1f,0x9d,0x45}, {0xfa,0x11,0x94,0x48},
|
||||
{0x93,0x4b,0xe3,0x03}, {0x98,0x45,0xea,0x0e}, {0x85,0x57,0xf1,0x19}, {0x8e,0x59,0xf8,0x14},
|
||||
{0xbf,0x73,0xc7,0x37}, {0xb4,0x7d,0xce,0x3a}, {0xa9,0x6f,0xd5,0x2d}, {0xa2,0x61,0xdc,0x20},
|
||||
{0xf6,0xad,0x76,0x6d}, {0xfd,0xa3,0x7f,0x60}, {0xe0,0xb1,0x64,0x77}, {0xeb,0xbf,0x6d,0x7a},
|
||||
{0xda,0x95,0x52,0x59}, {0xd1,0x9b,0x5b,0x54}, {0xcc,0x89,0x40,0x43}, {0xc7,0x87,0x49,0x4e},
|
||||
{0xae,0xdd,0x3e,0x05}, {0xa5,0xd3,0x37,0x08}, {0xb8,0xc1,0x2c,0x1f}, {0xb3,0xcf,0x25,0x12},
|
||||
{0x82,0xe5,0x1a,0x31}, {0x89,0xeb,0x13,0x3c}, {0x94,0xf9,0x08,0x2b}, {0x9f,0xf7,0x01,0x26},
|
||||
{0x46,0x4d,0xe6,0xbd}, {0x4d,0x43,0xef,0xb0}, {0x50,0x51,0xf4,0xa7}, {0x5b,0x5f,0xfd,0xaa},
|
||||
{0x6a,0x75,0xc2,0x89}, {0x61,0x7b,0xcb,0x84}, {0x7c,0x69,0xd0,0x93}, {0x77,0x67,0xd9,0x9e},
|
||||
{0x1e,0x3d,0xae,0xd5}, {0x15,0x33,0xa7,0xd8}, {0x08,0x21,0xbc,0xcf}, {0x03,0x2f,0xb5,0xc2},
|
||||
{0x32,0x05,0x8a,0xe1}, {0x39,0x0b,0x83,0xec}, {0x24,0x19,0x98,0xfb}, {0x2f,0x17,0x91,0xf6},
|
||||
{0x8d,0x76,0x4d,0xd6}, {0x86,0x78,0x44,0xdb}, {0x9b,0x6a,0x5f,0xcc}, {0x90,0x64,0x56,0xc1},
|
||||
{0xa1,0x4e,0x69,0xe2}, {0xaa,0x40,0x60,0xef}, {0xb7,0x52,0x7b,0xf8}, {0xbc,0x5c,0x72,0xf5},
|
||||
{0xd5,0x06,0x05,0xbe}, {0xde,0x08,0x0c,0xb3}, {0xc3,0x1a,0x17,0xa4}, {0xc8,0x14,0x1e,0xa9},
|
||||
{0xf9,0x3e,0x21,0x8a}, {0xf2,0x30,0x28,0x87}, {0xef,0x22,0x33,0x90}, {0xe4,0x2c,0x3a,0x9d},
|
||||
{0x3d,0x96,0xdd,0x06}, {0x36,0x98,0xd4,0x0b}, {0x2b,0x8a,0xcf,0x1c}, {0x20,0x84,0xc6,0x11},
|
||||
{0x11,0xae,0xf9,0x32}, {0x1a,0xa0,0xf0,0x3f}, {0x07,0xb2,0xeb,0x28}, {0x0c,0xbc,0xe2,0x25},
|
||||
{0x65,0xe6,0x95,0x6e}, {0x6e,0xe8,0x9c,0x63}, {0x73,0xfa,0x87,0x74}, {0x78,0xf4,0x8e,0x79},
|
||||
{0x49,0xde,0xb1,0x5a}, {0x42,0xd0,0xb8,0x57}, {0x5f,0xc2,0xa3,0x40}, {0x54,0xcc,0xaa,0x4d},
|
||||
{0xf7,0x41,0xec,0xda}, {0xfc,0x4f,0xe5,0xd7}, {0xe1,0x5d,0xfe,0xc0}, {0xea,0x53,0xf7,0xcd},
|
||||
{0xdb,0x79,0xc8,0xee}, {0xd0,0x77,0xc1,0xe3}, {0xcd,0x65,0xda,0xf4}, {0xc6,0x6b,0xd3,0xf9},
|
||||
{0xaf,0x31,0xa4,0xb2}, {0xa4,0x3f,0xad,0xbf}, {0xb9,0x2d,0xb6,0xa8}, {0xb2,0x23,0xbf,0xa5},
|
||||
{0x83,0x09,0x80,0x86}, {0x88,0x07,0x89,0x8b}, {0x95,0x15,0x92,0x9c}, {0x9e,0x1b,0x9b,0x91},
|
||||
{0x47,0xa1,0x7c,0x0a}, {0x4c,0xaf,0x75,0x07}, {0x51,0xbd,0x6e,0x10}, {0x5a,0xb3,0x67,0x1d},
|
||||
{0x6b,0x99,0x58,0x3e}, {0x60,0x97,0x51,0x33}, {0x7d,0x85,0x4a,0x24}, {0x76,0x8b,0x43,0x29},
|
||||
{0x1f,0xd1,0x34,0x62}, {0x14,0xdf,0x3d,0x6f}, {0x09,0xcd,0x26,0x78}, {0x02,0xc3,0x2f,0x75},
|
||||
{0x33,0xe9,0x10,0x56}, {0x38,0xe7,0x19,0x5b}, {0x25,0xf5,0x02,0x4c}, {0x2e,0xfb,0x0b,0x41},
|
||||
{0x8c,0x9a,0xd7,0x61}, {0x87,0x94,0xde,0x6c}, {0x9a,0x86,0xc5,0x7b}, {0x91,0x88,0xcc,0x76},
|
||||
{0xa0,0xa2,0xf3,0x55}, {0xab,0xac,0xfa,0x58}, {0xb6,0xbe,0xe1,0x4f}, {0xbd,0xb0,0xe8,0x42},
|
||||
{0xd4,0xea,0x9f,0x09}, {0xdf,0xe4,0x96,0x04}, {0xc2,0xf6,0x8d,0x13}, {0xc9,0xf8,0x84,0x1e},
|
||||
{0xf8,0xd2,0xbb,0x3d}, {0xf3,0xdc,0xb2,0x30}, {0xee,0xce,0xa9,0x27}, {0xe5,0xc0,0xa0,0x2a},
|
||||
{0x3c,0x7a,0x47,0xb1}, {0x37,0x74,0x4e,0xbc}, {0x2a,0x66,0x55,0xab}, {0x21,0x68,0x5c,0xa6},
|
||||
{0x10,0x42,0x63,0x85}, {0x1b,0x4c,0x6a,0x88}, {0x06,0x5e,0x71,0x9f}, {0x0d,0x50,0x78,0x92},
|
||||
{0x64,0x0a,0x0f,0xd9}, {0x6f,0x04,0x06,0xd4}, {0x72,0x16,0x1d,0xc3}, {0x79,0x18,0x14,0xce},
|
||||
{0x48,0x32,0x2b,0xed}, {0x43,0x3c,0x22,0xe0}, {0x5e,0x2e,0x39,0xf7}, {0x55,0x20,0x30,0xfa},
|
||||
{0x01,0xec,0x9a,0xb7}, {0x0a,0xe2,0x93,0xba}, {0x17,0xf0,0x88,0xad}, {0x1c,0xfe,0x81,0xa0},
|
||||
{0x2d,0xd4,0xbe,0x83}, {0x26,0xda,0xb7,0x8e}, {0x3b,0xc8,0xac,0x99}, {0x30,0xc6,0xa5,0x94},
|
||||
{0x59,0x9c,0xd2,0xdf}, {0x52,0x92,0xdb,0xd2}, {0x4f,0x80,0xc0,0xc5}, {0x44,0x8e,0xc9,0xc8},
|
||||
{0x75,0xa4,0xf6,0xeb}, {0x7e,0xaa,0xff,0xe6}, {0x63,0xb8,0xe4,0xf1}, {0x68,0xb6,0xed,0xfc},
|
||||
{0xb1,0x0c,0x0a,0x67}, {0xba,0x02,0x03,0x6a}, {0xa7,0x10,0x18,0x7d}, {0xac,0x1e,0x11,0x70},
|
||||
{0x9d,0x34,0x2e,0x53}, {0x96,0x3a,0x27,0x5e}, {0x8b,0x28,0x3c,0x49}, {0x80,0x26,0x35,0x44},
|
||||
{0xe9,0x7c,0x42,0x0f}, {0xe2,0x72,0x4b,0x02}, {0xff,0x60,0x50,0x15}, {0xf4,0x6e,0x59,0x18},
|
||||
{0xc5,0x44,0x66,0x3b}, {0xce,0x4a,0x6f,0x36}, {0xd3,0x58,0x74,0x21}, {0xd8,0x56,0x7d,0x2c},
|
||||
{0x7a,0x37,0xa1,0x0c}, {0x71,0x39,0xa8,0x01}, {0x6c,0x2b,0xb3,0x16}, {0x67,0x25,0xba,0x1b},
|
||||
{0x56,0x0f,0x85,0x38}, {0x5d,0x01,0x8c,0x35}, {0x40,0x13,0x97,0x22}, {0x4b,0x1d,0x9e,0x2f},
|
||||
{0x22,0x47,0xe9,0x64}, {0x29,0x49,0xe0,0x69}, {0x34,0x5b,0xfb,0x7e}, {0x3f,0x55,0xf2,0x73},
|
||||
{0x0e,0x7f,0xcd,0x50}, {0x05,0x71,0xc4,0x5d}, {0x18,0x63,0xdf,0x4a}, {0x13,0x6d,0xd6,0x47},
|
||||
{0xca,0xd7,0x31,0xdc}, {0xc1,0xd9,0x38,0xd1}, {0xdc,0xcb,0x23,0xc6}, {0xd7,0xc5,0x2a,0xcb},
|
||||
{0xe6,0xef,0x15,0xe8}, {0xed,0xe1,0x1c,0xe5}, {0xf0,0xf3,0x07,0xf2}, {0xfb,0xfd,0x0e,0xff},
|
||||
{0x92,0xa7,0x79,0xb4}, {0x99,0xa9,0x70,0xb9}, {0x84,0xbb,0x6b,0xae}, {0x8f,0xb5,0x62,0xa3},
|
||||
{0xbe,0x9f,0x5d,0x80}, {0xb5,0x91,0x54,0x8d}, {0xa8,0x83,0x4f,0x9a}, {0xa3,0x8d,0x46,0x97}
|
||||
}
|
||||
};
|
||||
#define U2 xU2.xt8
|
||||
|
||||
static const union xtab xU3 = {
|
||||
.xt8 = {
|
||||
{0x00,0x00,0x00,0x00}, {0x0d,0x0b,0x0e,0x09}, {0x1a,0x16,0x1c,0x12}, {0x17,0x1d,0x12,0x1b},
|
||||
{0x34,0x2c,0x38,0x24}, {0x39,0x27,0x36,0x2d}, {0x2e,0x3a,0x24,0x36}, {0x23,0x31,0x2a,0x3f},
|
||||
{0x68,0x58,0x70,0x48}, {0x65,0x53,0x7e,0x41}, {0x72,0x4e,0x6c,0x5a}, {0x7f,0x45,0x62,0x53},
|
||||
{0x5c,0x74,0x48,0x6c}, {0x51,0x7f,0x46,0x65}, {0x46,0x62,0x54,0x7e}, {0x4b,0x69,0x5a,0x77},
|
||||
{0xd0,0xb0,0xe0,0x90}, {0xdd,0xbb,0xee,0x99}, {0xca,0xa6,0xfc,0x82}, {0xc7,0xad,0xf2,0x8b},
|
||||
{0xe4,0x9c,0xd8,0xb4}, {0xe9,0x97,0xd6,0xbd}, {0xfe,0x8a,0xc4,0xa6}, {0xf3,0x81,0xca,0xaf},
|
||||
{0xb8,0xe8,0x90,0xd8}, {0xb5,0xe3,0x9e,0xd1}, {0xa2,0xfe,0x8c,0xca}, {0xaf,0xf5,0x82,0xc3},
|
||||
{0x8c,0xc4,0xa8,0xfc}, {0x81,0xcf,0xa6,0xf5}, {0x96,0xd2,0xb4,0xee}, {0x9b,0xd9,0xba,0xe7},
|
||||
{0xbb,0x7b,0xdb,0x3b}, {0xb6,0x70,0xd5,0x32}, {0xa1,0x6d,0xc7,0x29}, {0xac,0x66,0xc9,0x20},
|
||||
{0x8f,0x57,0xe3,0x1f}, {0x82,0x5c,0xed,0x16}, {0x95,0x41,0xff,0x0d}, {0x98,0x4a,0xf1,0x04},
|
||||
{0xd3,0x23,0xab,0x73}, {0xde,0x28,0xa5,0x7a}, {0xc9,0x35,0xb7,0x61}, {0xc4,0x3e,0xb9,0x68},
|
||||
{0xe7,0x0f,0x93,0x57}, {0xea,0x04,0x9d,0x5e}, {0xfd,0x19,0x8f,0x45}, {0xf0,0x12,0x81,0x4c},
|
||||
{0x6b,0xcb,0x3b,0xab}, {0x66,0xc0,0x35,0xa2}, {0x71,0xdd,0x27,0xb9}, {0x7c,0xd6,0x29,0xb0},
|
||||
{0x5f,0xe7,0x03,0x8f}, {0x52,0xec,0x0d,0x86}, {0x45,0xf1,0x1f,0x9d}, {0x48,0xfa,0x11,0x94},
|
||||
{0x03,0x93,0x4b,0xe3}, {0x0e,0x98,0x45,0xea}, {0x19,0x85,0x57,0xf1}, {0x14,0x8e,0x59,0xf8},
|
||||
{0x37,0xbf,0x73,0xc7}, {0x3a,0xb4,0x7d,0xce}, {0x2d,0xa9,0x6f,0xd5}, {0x20,0xa2,0x61,0xdc},
|
||||
{0x6d,0xf6,0xad,0x76}, {0x60,0xfd,0xa3,0x7f}, {0x77,0xe0,0xb1,0x64}, {0x7a,0xeb,0xbf,0x6d},
|
||||
{0x59,0xda,0x95,0x52}, {0x54,0xd1,0x9b,0x5b}, {0x43,0xcc,0x89,0x40}, {0x4e,0xc7,0x87,0x49},
|
||||
{0x05,0xae,0xdd,0x3e}, {0x08,0xa5,0xd3,0x37}, {0x1f,0xb8,0xc1,0x2c}, {0x12,0xb3,0xcf,0x25},
|
||||
{0x31,0x82,0xe5,0x1a}, {0x3c,0x89,0xeb,0x13}, {0x2b,0x94,0xf9,0x08}, {0x26,0x9f,0xf7,0x01},
|
||||
{0xbd,0x46,0x4d,0xe6}, {0xb0,0x4d,0x43,0xef}, {0xa7,0x50,0x51,0xf4}, {0xaa,0x5b,0x5f,0xfd},
|
||||
{0x89,0x6a,0x75,0xc2}, {0x84,0x61,0x7b,0xcb}, {0x93,0x7c,0x69,0xd0}, {0x9e,0x77,0x67,0xd9},
|
||||
{0xd5,0x1e,0x3d,0xae}, {0xd8,0x15,0x33,0xa7}, {0xcf,0x08,0x21,0xbc}, {0xc2,0x03,0x2f,0xb5},
|
||||
{0xe1,0x32,0x05,0x8a}, {0xec,0x39,0x0b,0x83}, {0xfb,0x24,0x19,0x98}, {0xf6,0x2f,0x17,0x91},
|
||||
{0xd6,0x8d,0x76,0x4d}, {0xdb,0x86,0x78,0x44}, {0xcc,0x9b,0x6a,0x5f}, {0xc1,0x90,0x64,0x56},
|
||||
{0xe2,0xa1,0x4e,0x69}, {0xef,0xaa,0x40,0x60}, {0xf8,0xb7,0x52,0x7b}, {0xf5,0xbc,0x5c,0x72},
|
||||
{0xbe,0xd5,0x06,0x05}, {0xb3,0xde,0x08,0x0c}, {0xa4,0xc3,0x1a,0x17}, {0xa9,0xc8,0x14,0x1e},
|
||||
{0x8a,0xf9,0x3e,0x21}, {0x87,0xf2,0x30,0x28}, {0x90,0xef,0x22,0x33}, {0x9d,0xe4,0x2c,0x3a},
|
||||
{0x06,0x3d,0x96,0xdd}, {0x0b,0x36,0x98,0xd4}, {0x1c,0x2b,0x8a,0xcf}, {0x11,0x20,0x84,0xc6},
|
||||
{0x32,0x11,0xae,0xf9}, {0x3f,0x1a,0xa0,0xf0}, {0x28,0x07,0xb2,0xeb}, {0x25,0x0c,0xbc,0xe2},
|
||||
{0x6e,0x65,0xe6,0x95}, {0x63,0x6e,0xe8,0x9c}, {0x74,0x73,0xfa,0x87}, {0x79,0x78,0xf4,0x8e},
|
||||
{0x5a,0x49,0xde,0xb1}, {0x57,0x42,0xd0,0xb8}, {0x40,0x5f,0xc2,0xa3}, {0x4d,0x54,0xcc,0xaa},
|
||||
{0xda,0xf7,0x41,0xec}, {0xd7,0xfc,0x4f,0xe5}, {0xc0,0xe1,0x5d,0xfe}, {0xcd,0xea,0x53,0xf7},
|
||||
{0xee,0xdb,0x79,0xc8}, {0xe3,0xd0,0x77,0xc1}, {0xf4,0xcd,0x65,0xda}, {0xf9,0xc6,0x6b,0xd3},
|
||||
{0xb2,0xaf,0x31,0xa4}, {0xbf,0xa4,0x3f,0xad}, {0xa8,0xb9,0x2d,0xb6}, {0xa5,0xb2,0x23,0xbf},
|
||||
{0x86,0x83,0x09,0x80}, {0x8b,0x88,0x07,0x89}, {0x9c,0x95,0x15,0x92}, {0x91,0x9e,0x1b,0x9b},
|
||||
{0x0a,0x47,0xa1,0x7c}, {0x07,0x4c,0xaf,0x75}, {0x10,0x51,0xbd,0x6e}, {0x1d,0x5a,0xb3,0x67},
|
||||
{0x3e,0x6b,0x99,0x58}, {0x33,0x60,0x97,0x51}, {0x24,0x7d,0x85,0x4a}, {0x29,0x76,0x8b,0x43},
|
||||
{0x62,0x1f,0xd1,0x34}, {0x6f,0x14,0xdf,0x3d}, {0x78,0x09,0xcd,0x26}, {0x75,0x02,0xc3,0x2f},
|
||||
{0x56,0x33,0xe9,0x10}, {0x5b,0x38,0xe7,0x19}, {0x4c,0x25,0xf5,0x02}, {0x41,0x2e,0xfb,0x0b},
|
||||
{0x61,0x8c,0x9a,0xd7}, {0x6c,0x87,0x94,0xde}, {0x7b,0x9a,0x86,0xc5}, {0x76,0x91,0x88,0xcc},
|
||||
{0x55,0xa0,0xa2,0xf3}, {0x58,0xab,0xac,0xfa}, {0x4f,0xb6,0xbe,0xe1}, {0x42,0xbd,0xb0,0xe8},
|
||||
{0x09,0xd4,0xea,0x9f}, {0x04,0xdf,0xe4,0x96}, {0x13,0xc2,0xf6,0x8d}, {0x1e,0xc9,0xf8,0x84},
|
||||
{0x3d,0xf8,0xd2,0xbb}, {0x30,0xf3,0xdc,0xb2}, {0x27,0xee,0xce,0xa9}, {0x2a,0xe5,0xc0,0xa0},
|
||||
{0xb1,0x3c,0x7a,0x47}, {0xbc,0x37,0x74,0x4e}, {0xab,0x2a,0x66,0x55}, {0xa6,0x21,0x68,0x5c},
|
||||
{0x85,0x10,0x42,0x63}, {0x88,0x1b,0x4c,0x6a}, {0x9f,0x06,0x5e,0x71}, {0x92,0x0d,0x50,0x78},
|
||||
{0xd9,0x64,0x0a,0x0f}, {0xd4,0x6f,0x04,0x06}, {0xc3,0x72,0x16,0x1d}, {0xce,0x79,0x18,0x14},
|
||||
{0xed,0x48,0x32,0x2b}, {0xe0,0x43,0x3c,0x22}, {0xf7,0x5e,0x2e,0x39}, {0xfa,0x55,0x20,0x30},
|
||||
{0xb7,0x01,0xec,0x9a}, {0xba,0x0a,0xe2,0x93}, {0xad,0x17,0xf0,0x88}, {0xa0,0x1c,0xfe,0x81},
|
||||
{0x83,0x2d,0xd4,0xbe}, {0x8e,0x26,0xda,0xb7}, {0x99,0x3b,0xc8,0xac}, {0x94,0x30,0xc6,0xa5},
|
||||
{0xdf,0x59,0x9c,0xd2}, {0xd2,0x52,0x92,0xdb}, {0xc5,0x4f,0x80,0xc0}, {0xc8,0x44,0x8e,0xc9},
|
||||
{0xeb,0x75,0xa4,0xf6}, {0xe6,0x7e,0xaa,0xff}, {0xf1,0x63,0xb8,0xe4}, {0xfc,0x68,0xb6,0xed},
|
||||
{0x67,0xb1,0x0c,0x0a}, {0x6a,0xba,0x02,0x03}, {0x7d,0xa7,0x10,0x18}, {0x70,0xac,0x1e,0x11},
|
||||
{0x53,0x9d,0x34,0x2e}, {0x5e,0x96,0x3a,0x27}, {0x49,0x8b,0x28,0x3c}, {0x44,0x80,0x26,0x35},
|
||||
{0x0f,0xe9,0x7c,0x42}, {0x02,0xe2,0x72,0x4b}, {0x15,0xff,0x60,0x50}, {0x18,0xf4,0x6e,0x59},
|
||||
{0x3b,0xc5,0x44,0x66}, {0x36,0xce,0x4a,0x6f}, {0x21,0xd3,0x58,0x74}, {0x2c,0xd8,0x56,0x7d},
|
||||
{0x0c,0x7a,0x37,0xa1}, {0x01,0x71,0x39,0xa8}, {0x16,0x6c,0x2b,0xb3}, {0x1b,0x67,0x25,0xba},
|
||||
{0x38,0x56,0x0f,0x85}, {0x35,0x5d,0x01,0x8c}, {0x22,0x40,0x13,0x97}, {0x2f,0x4b,0x1d,0x9e},
|
||||
{0x64,0x22,0x47,0xe9}, {0x69,0x29,0x49,0xe0}, {0x7e,0x34,0x5b,0xfb}, {0x73,0x3f,0x55,0xf2},
|
||||
{0x50,0x0e,0x7f,0xcd}, {0x5d,0x05,0x71,0xc4}, {0x4a,0x18,0x63,0xdf}, {0x47,0x13,0x6d,0xd6},
|
||||
{0xdc,0xca,0xd7,0x31}, {0xd1,0xc1,0xd9,0x38}, {0xc6,0xdc,0xcb,0x23}, {0xcb,0xd7,0xc5,0x2a},
|
||||
{0xe8,0xe6,0xef,0x15}, {0xe5,0xed,0xe1,0x1c}, {0xf2,0xf0,0xf3,0x07}, {0xff,0xfb,0xfd,0x0e},
|
||||
{0xb4,0x92,0xa7,0x79}, {0xb9,0x99,0xa9,0x70}, {0xae,0x84,0xbb,0x6b}, {0xa3,0x8f,0xb5,0x62},
|
||||
{0x80,0xbe,0x9f,0x5d}, {0x8d,0xb5,0x91,0x54}, {0x9a,0xa8,0x83,0x4f}, {0x97,0xa3,0x8d,0x46}
|
||||
}
|
||||
};
|
||||
#define U3 xU3.xt8
|
||||
|
||||
static const union xtab xU4 = {
|
||||
.xt8 = {
|
||||
{0x00,0x00,0x00,0x00}, {0x09,0x0d,0x0b,0x0e}, {0x12,0x1a,0x16,0x1c}, {0x1b,0x17,0x1d,0x12},
|
||||
{0x24,0x34,0x2c,0x38}, {0x2d,0x39,0x27,0x36}, {0x36,0x2e,0x3a,0x24}, {0x3f,0x23,0x31,0x2a},
|
||||
{0x48,0x68,0x58,0x70}, {0x41,0x65,0x53,0x7e}, {0x5a,0x72,0x4e,0x6c}, {0x53,0x7f,0x45,0x62},
|
||||
{0x6c,0x5c,0x74,0x48}, {0x65,0x51,0x7f,0x46}, {0x7e,0x46,0x62,0x54}, {0x77,0x4b,0x69,0x5a},
|
||||
{0x90,0xd0,0xb0,0xe0}, {0x99,0xdd,0xbb,0xee}, {0x82,0xca,0xa6,0xfc}, {0x8b,0xc7,0xad,0xf2},
|
||||
{0xb4,0xe4,0x9c,0xd8}, {0xbd,0xe9,0x97,0xd6}, {0xa6,0xfe,0x8a,0xc4}, {0xaf,0xf3,0x81,0xca},
|
||||
{0xd8,0xb8,0xe8,0x90}, {0xd1,0xb5,0xe3,0x9e}, {0xca,0xa2,0xfe,0x8c}, {0xc3,0xaf,0xf5,0x82},
|
||||
{0xfc,0x8c,0xc4,0xa8}, {0xf5,0x81,0xcf,0xa6}, {0xee,0x96,0xd2,0xb4}, {0xe7,0x9b,0xd9,0xba},
|
||||
{0x3b,0xbb,0x7b,0xdb}, {0x32,0xb6,0x70,0xd5}, {0x29,0xa1,0x6d,0xc7}, {0x20,0xac,0x66,0xc9},
|
||||
{0x1f,0x8f,0x57,0xe3}, {0x16,0x82,0x5c,0xed}, {0x0d,0x95,0x41,0xff}, {0x04,0x98,0x4a,0xf1},
|
||||
{0x73,0xd3,0x23,0xab}, {0x7a,0xde,0x28,0xa5}, {0x61,0xc9,0x35,0xb7}, {0x68,0xc4,0x3e,0xb9},
|
||||
{0x57,0xe7,0x0f,0x93}, {0x5e,0xea,0x04,0x9d}, {0x45,0xfd,0x19,0x8f}, {0x4c,0xf0,0x12,0x81},
|
||||
{0xab,0x6b,0xcb,0x3b}, {0xa2,0x66,0xc0,0x35}, {0xb9,0x71,0xdd,0x27}, {0xb0,0x7c,0xd6,0x29},
|
||||
{0x8f,0x5f,0xe7,0x03}, {0x86,0x52,0xec,0x0d}, {0x9d,0x45,0xf1,0x1f}, {0x94,0x48,0xfa,0x11},
|
||||
{0xe3,0x03,0x93,0x4b}, {0xea,0x0e,0x98,0x45}, {0xf1,0x19,0x85,0x57}, {0xf8,0x14,0x8e,0x59},
|
||||
{0xc7,0x37,0xbf,0x73}, {0xce,0x3a,0xb4,0x7d}, {0xd5,0x2d,0xa9,0x6f}, {0xdc,0x20,0xa2,0x61},
|
||||
{0x76,0x6d,0xf6,0xad}, {0x7f,0x60,0xfd,0xa3}, {0x64,0x77,0xe0,0xb1}, {0x6d,0x7a,0xeb,0xbf},
|
||||
{0x52,0x59,0xda,0x95}, {0x5b,0x54,0xd1,0x9b}, {0x40,0x43,0xcc,0x89}, {0x49,0x4e,0xc7,0x87},
|
||||
{0x3e,0x05,0xae,0xdd}, {0x37,0x08,0xa5,0xd3}, {0x2c,0x1f,0xb8,0xc1}, {0x25,0x12,0xb3,0xcf},
|
||||
{0x1a,0x31,0x82,0xe5}, {0x13,0x3c,0x89,0xeb}, {0x08,0x2b,0x94,0xf9}, {0x01,0x26,0x9f,0xf7},
|
||||
{0xe6,0xbd,0x46,0x4d}, {0xef,0xb0,0x4d,0x43}, {0xf4,0xa7,0x50,0x51}, {0xfd,0xaa,0x5b,0x5f},
|
||||
{0xc2,0x89,0x6a,0x75}, {0xcb,0x84,0x61,0x7b}, {0xd0,0x93,0x7c,0x69}, {0xd9,0x9e,0x77,0x67},
|
||||
{0xae,0xd5,0x1e,0x3d}, {0xa7,0xd8,0x15,0x33}, {0xbc,0xcf,0x08,0x21}, {0xb5,0xc2,0x03,0x2f},
|
||||
{0x8a,0xe1,0x32,0x05}, {0x83,0xec,0x39,0x0b}, {0x98,0xfb,0x24,0x19}, {0x91,0xf6,0x2f,0x17},
|
||||
{0x4d,0xd6,0x8d,0x76}, {0x44,0xdb,0x86,0x78}, {0x5f,0xcc,0x9b,0x6a}, {0x56,0xc1,0x90,0x64},
|
||||
{0x69,0xe2,0xa1,0x4e}, {0x60,0xef,0xaa,0x40}, {0x7b,0xf8,0xb7,0x52}, {0x72,0xf5,0xbc,0x5c},
|
||||
{0x05,0xbe,0xd5,0x06}, {0x0c,0xb3,0xde,0x08}, {0x17,0xa4,0xc3,0x1a}, {0x1e,0xa9,0xc8,0x14},
|
||||
{0x21,0x8a,0xf9,0x3e}, {0x28,0x87,0xf2,0x30}, {0x33,0x90,0xef,0x22}, {0x3a,0x9d,0xe4,0x2c},
|
||||
{0xdd,0x06,0x3d,0x96}, {0xd4,0x0b,0x36,0x98}, {0xcf,0x1c,0x2b,0x8a}, {0xc6,0x11,0x20,0x84},
|
||||
{0xf9,0x32,0x11,0xae}, {0xf0,0x3f,0x1a,0xa0}, {0xeb,0x28,0x07,0xb2}, {0xe2,0x25,0x0c,0xbc},
|
||||
{0x95,0x6e,0x65,0xe6}, {0x9c,0x63,0x6e,0xe8}, {0x87,0x74,0x73,0xfa}, {0x8e,0x79,0x78,0xf4},
|
||||
{0xb1,0x5a,0x49,0xde}, {0xb8,0x57,0x42,0xd0}, {0xa3,0x40,0x5f,0xc2}, {0xaa,0x4d,0x54,0xcc},
|
||||
{0xec,0xda,0xf7,0x41}, {0xe5,0xd7,0xfc,0x4f}, {0xfe,0xc0,0xe1,0x5d}, {0xf7,0xcd,0xea,0x53},
|
||||
{0xc8,0xee,0xdb,0x79}, {0xc1,0xe3,0xd0,0x77}, {0xda,0xf4,0xcd,0x65}, {0xd3,0xf9,0xc6,0x6b},
|
||||
{0xa4,0xb2,0xaf,0x31}, {0xad,0xbf,0xa4,0x3f}, {0xb6,0xa8,0xb9,0x2d}, {0xbf,0xa5,0xb2,0x23},
|
||||
{0x80,0x86,0x83,0x09}, {0x89,0x8b,0x88,0x07}, {0x92,0x9c,0x95,0x15}, {0x9b,0x91,0x9e,0x1b},
|
||||
{0x7c,0x0a,0x47,0xa1}, {0x75,0x07,0x4c,0xaf}, {0x6e,0x10,0x51,0xbd}, {0x67,0x1d,0x5a,0xb3},
|
||||
{0x58,0x3e,0x6b,0x99}, {0x51,0x33,0x60,0x97}, {0x4a,0x24,0x7d,0x85}, {0x43,0x29,0x76,0x8b},
|
||||
{0x34,0x62,0x1f,0xd1}, {0x3d,0x6f,0x14,0xdf}, {0x26,0x78,0x09,0xcd}, {0x2f,0x75,0x02,0xc3},
|
||||
{0x10,0x56,0x33,0xe9}, {0x19,0x5b,0x38,0xe7}, {0x02,0x4c,0x25,0xf5}, {0x0b,0x41,0x2e,0xfb},
|
||||
{0xd7,0x61,0x8c,0x9a}, {0xde,0x6c,0x87,0x94}, {0xc5,0x7b,0x9a,0x86}, {0xcc,0x76,0x91,0x88},
|
||||
{0xf3,0x55,0xa0,0xa2}, {0xfa,0x58,0xab,0xac}, {0xe1,0x4f,0xb6,0xbe}, {0xe8,0x42,0xbd,0xb0},
|
||||
{0x9f,0x09,0xd4,0xea}, {0x96,0x04,0xdf,0xe4}, {0x8d,0x13,0xc2,0xf6}, {0x84,0x1e,0xc9,0xf8},
|
||||
{0xbb,0x3d,0xf8,0xd2}, {0xb2,0x30,0xf3,0xdc}, {0xa9,0x27,0xee,0xce}, {0xa0,0x2a,0xe5,0xc0},
|
||||
{0x47,0xb1,0x3c,0x7a}, {0x4e,0xbc,0x37,0x74}, {0x55,0xab,0x2a,0x66}, {0x5c,0xa6,0x21,0x68},
|
||||
{0x63,0x85,0x10,0x42}, {0x6a,0x88,0x1b,0x4c}, {0x71,0x9f,0x06,0x5e}, {0x78,0x92,0x0d,0x50},
|
||||
{0x0f,0xd9,0x64,0x0a}, {0x06,0xd4,0x6f,0x04}, {0x1d,0xc3,0x72,0x16}, {0x14,0xce,0x79,0x18},
|
||||
{0x2b,0xed,0x48,0x32}, {0x22,0xe0,0x43,0x3c}, {0x39,0xf7,0x5e,0x2e}, {0x30,0xfa,0x55,0x20},
|
||||
{0x9a,0xb7,0x01,0xec}, {0x93,0xba,0x0a,0xe2}, {0x88,0xad,0x17,0xf0}, {0x81,0xa0,0x1c,0xfe},
|
||||
{0xbe,0x83,0x2d,0xd4}, {0xb7,0x8e,0x26,0xda}, {0xac,0x99,0x3b,0xc8}, {0xa5,0x94,0x30,0xc6},
|
||||
{0xd2,0xdf,0x59,0x9c}, {0xdb,0xd2,0x52,0x92}, {0xc0,0xc5,0x4f,0x80}, {0xc9,0xc8,0x44,0x8e},
|
||||
{0xf6,0xeb,0x75,0xa4}, {0xff,0xe6,0x7e,0xaa}, {0xe4,0xf1,0x63,0xb8}, {0xed,0xfc,0x68,0xb6},
|
||||
{0x0a,0x67,0xb1,0x0c}, {0x03,0x6a,0xba,0x02}, {0x18,0x7d,0xa7,0x10}, {0x11,0x70,0xac,0x1e},
|
||||
{0x2e,0x53,0x9d,0x34}, {0x27,0x5e,0x96,0x3a}, {0x3c,0x49,0x8b,0x28}, {0x35,0x44,0x80,0x26},
|
||||
{0x42,0x0f,0xe9,0x7c}, {0x4b,0x02,0xe2,0x72}, {0x50,0x15,0xff,0x60}, {0x59,0x18,0xf4,0x6e},
|
||||
{0x66,0x3b,0xc5,0x44}, {0x6f,0x36,0xce,0x4a}, {0x74,0x21,0xd3,0x58}, {0x7d,0x2c,0xd8,0x56},
|
||||
{0xa1,0x0c,0x7a,0x37}, {0xa8,0x01,0x71,0x39}, {0xb3,0x16,0x6c,0x2b}, {0xba,0x1b,0x67,0x25},
|
||||
{0x85,0x38,0x56,0x0f}, {0x8c,0x35,0x5d,0x01}, {0x97,0x22,0x40,0x13}, {0x9e,0x2f,0x4b,0x1d},
|
||||
{0xe9,0x64,0x22,0x47}, {0xe0,0x69,0x29,0x49}, {0xfb,0x7e,0x34,0x5b}, {0xf2,0x73,0x3f,0x55},
|
||||
{0xcd,0x50,0x0e,0x7f}, {0xc4,0x5d,0x05,0x71}, {0xdf,0x4a,0x18,0x63}, {0xd6,0x47,0x13,0x6d},
|
||||
{0x31,0xdc,0xca,0xd7}, {0x38,0xd1,0xc1,0xd9}, {0x23,0xc6,0xdc,0xcb}, {0x2a,0xcb,0xd7,0xc5},
|
||||
{0x15,0xe8,0xe6,0xef}, {0x1c,0xe5,0xed,0xe1}, {0x07,0xf2,0xf0,0xf3}, {0x0e,0xff,0xfb,0xfd},
|
||||
{0x79,0xb4,0x92,0xa7}, {0x70,0xb9,0x99,0xa9}, {0x6b,0xae,0x84,0xbb}, {0x62,0xa3,0x8f,0xb5},
|
||||
{0x5d,0x80,0xbe,0x9f}, {0x54,0x8d,0xb5,0x91}, {0x4f,0x9a,0xa8,0x83}, {0x46,0x97,0xa3,0x8d}
|
||||
}
|
||||
};
|
||||
#define U4 xU4.xt8
|
||||
|
||||
static const word32 rcon[30] = {
|
||||
0x01,0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91
|
||||
};
|
492
crypto/dist/kame/racoon/missing/crypto/rijndael/rijndael-alg-fst.c
vendored
Normal file
492
crypto/dist/kame/racoon/missing/crypto/rijndael/rijndael-alg-fst.c
vendored
Normal file
@ -0,0 +1,492 @@
|
||||
/* $KAME: rijndael-alg-fst.c,v 1.1.1.1 2001/08/08 09:56:23 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* rijndael-alg-fst.c v2.3 April '2000
|
||||
*
|
||||
* Optimised ANSI C code
|
||||
*
|
||||
* authors: v1.0: Antoon Bosselaers
|
||||
* v2.0: Vincent Rijmen
|
||||
* v2.3: Paulo Barreto
|
||||
*
|
||||
* This code is placed in the public domain.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef _KERNEL
|
||||
#include <sys/systm.h>
|
||||
#else
|
||||
#include <string.h>
|
||||
#endif
|
||||
#include <crypto/rijndael/rijndael-alg-fst.h>
|
||||
#include <crypto/rijndael/rijndael_local.h>
|
||||
|
||||
#include <crypto/rijndael/boxes-fst.dat>
|
||||
|
||||
#include <err.h>
|
||||
#define bcopy(a, b, c) memcpy((b), (a), (c))
|
||||
#define bzero(a, b) memset((a), 0, (b))
|
||||
#define panic(a) err(1, (a))
|
||||
|
||||
int rijndaelKeySched(word8 k[MAXKC][4], word8 W[MAXROUNDS+1][4][4], int ROUNDS) {
|
||||
/* Calculate the necessary round keys
|
||||
* The number of calculations depends on keyBits and blockBits
|
||||
*/
|
||||
int j, r, t, rconpointer = 0;
|
||||
union {
|
||||
word8 x8[MAXKC][4];
|
||||
word32 x32[MAXKC];
|
||||
} xtk;
|
||||
#define tk xtk.x8
|
||||
int KC = ROUNDS - 6;
|
||||
|
||||
for (j = KC-1; j >= 0; j--) {
|
||||
*((word32*)tk[j]) = *((word32*)k[j]);
|
||||
}
|
||||
r = 0;
|
||||
t = 0;
|
||||
/* copy values into round key array */
|
||||
for (j = 0; (j < KC) && (r < ROUNDS + 1); ) {
|
||||
for (; (j < KC) && (t < 4); j++, t++) {
|
||||
*((word32*)W[r][t]) = *((word32*)tk[j]);
|
||||
}
|
||||
if (t == 4) {
|
||||
r++;
|
||||
t = 0;
|
||||
}
|
||||
}
|
||||
|
||||
while (r < ROUNDS + 1) { /* while not enough round key material calculated */
|
||||
/* calculate new values */
|
||||
tk[0][0] ^= S[tk[KC-1][1]];
|
||||
tk[0][1] ^= S[tk[KC-1][2]];
|
||||
tk[0][2] ^= S[tk[KC-1][3]];
|
||||
tk[0][3] ^= S[tk[KC-1][0]];
|
||||
tk[0][0] ^= rcon[rconpointer++];
|
||||
|
||||
if (KC != 8) {
|
||||
for (j = 1; j < KC; j++) {
|
||||
*((word32*)tk[j]) ^= *((word32*)tk[j-1]);
|
||||
}
|
||||
} else {
|
||||
for (j = 1; j < KC/2; j++) {
|
||||
*((word32*)tk[j]) ^= *((word32*)tk[j-1]);
|
||||
}
|
||||
tk[KC/2][0] ^= S[tk[KC/2 - 1][0]];
|
||||
tk[KC/2][1] ^= S[tk[KC/2 - 1][1]];
|
||||
tk[KC/2][2] ^= S[tk[KC/2 - 1][2]];
|
||||
tk[KC/2][3] ^= S[tk[KC/2 - 1][3]];
|
||||
for (j = KC/2 + 1; j < KC; j++) {
|
||||
*((word32*)tk[j]) ^= *((word32*)tk[j-1]);
|
||||
}
|
||||
}
|
||||
/* copy values into round key array */
|
||||
for (j = 0; (j < KC) && (r < ROUNDS + 1); ) {
|
||||
for (; (j < KC) && (t < 4); j++, t++) {
|
||||
*((word32*)W[r][t]) = *((word32*)tk[j]);
|
||||
}
|
||||
if (t == 4) {
|
||||
r++;
|
||||
t = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
#undef tk
|
||||
}
|
||||
|
||||
int rijndaelKeyEncToDec(word8 W[MAXROUNDS+1][4][4], int ROUNDS) {
|
||||
int r;
|
||||
word8 *w;
|
||||
|
||||
for (r = 1; r < ROUNDS; r++) {
|
||||
w = W[r][0];
|
||||
*((word32*)w) =
|
||||
*((const word32*)U1[w[0]])
|
||||
^ *((const word32*)U2[w[1]])
|
||||
^ *((const word32*)U3[w[2]])
|
||||
^ *((const word32*)U4[w[3]]);
|
||||
|
||||
w = W[r][1];
|
||||
*((word32*)w) =
|
||||
*((const word32*)U1[w[0]])
|
||||
^ *((const word32*)U2[w[1]])
|
||||
^ *((const word32*)U3[w[2]])
|
||||
^ *((const word32*)U4[w[3]]);
|
||||
|
||||
w = W[r][2];
|
||||
*((word32*)w) =
|
||||
*((const word32*)U1[w[0]])
|
||||
^ *((const word32*)U2[w[1]])
|
||||
^ *((const word32*)U3[w[2]])
|
||||
^ *((const word32*)U4[w[3]]);
|
||||
|
||||
w = W[r][3];
|
||||
*((word32*)w) =
|
||||
*((const word32*)U1[w[0]])
|
||||
^ *((const word32*)U2[w[1]])
|
||||
^ *((const word32*)U3[w[2]])
|
||||
^ *((const word32*)U4[w[3]]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encrypt a single block.
|
||||
*/
|
||||
int rijndaelEncrypt(word8 in[16], word8 out[16], word8 rk[MAXROUNDS+1][4][4], int ROUNDS) {
|
||||
int r;
|
||||
union {
|
||||
word8 x8[16];
|
||||
word32 x32[4];
|
||||
} xa, xb;
|
||||
#define a xa.x8
|
||||
#define b xb.x8
|
||||
union {
|
||||
word8 x8[4][4];
|
||||
word32 x32[4];
|
||||
} xtemp;
|
||||
#define temp xtemp.x8
|
||||
|
||||
memcpy(a, in, sizeof a);
|
||||
|
||||
*((word32*)temp[0]) = *((word32*)(a )) ^ *((word32*)rk[0][0]);
|
||||
*((word32*)temp[1]) = *((word32*)(a+ 4)) ^ *((word32*)rk[0][1]);
|
||||
*((word32*)temp[2]) = *((word32*)(a+ 8)) ^ *((word32*)rk[0][2]);
|
||||
*((word32*)temp[3]) = *((word32*)(a+12)) ^ *((word32*)rk[0][3]);
|
||||
*((word32*)(b )) = *((const word32*)T1[temp[0][0]])
|
||||
^ *((const word32*)T2[temp[1][1]])
|
||||
^ *((const word32*)T3[temp[2][2]])
|
||||
^ *((const word32*)T4[temp[3][3]]);
|
||||
*((word32*)(b + 4)) = *((const word32*)T1[temp[1][0]])
|
||||
^ *((const word32*)T2[temp[2][1]])
|
||||
^ *((const word32*)T3[temp[3][2]])
|
||||
^ *((const word32*)T4[temp[0][3]]);
|
||||
*((word32*)(b + 8)) = *((const word32*)T1[temp[2][0]])
|
||||
^ *((const word32*)T2[temp[3][1]])
|
||||
^ *((const word32*)T3[temp[0][2]])
|
||||
^ *((const word32*)T4[temp[1][3]]);
|
||||
*((word32*)(b +12)) = *((const word32*)T1[temp[3][0]])
|
||||
^ *((const word32*)T2[temp[0][1]])
|
||||
^ *((const word32*)T3[temp[1][2]])
|
||||
^ *((const word32*)T4[temp[2][3]]);
|
||||
for (r = 1; r < ROUNDS-1; r++) {
|
||||
*((word32*)temp[0]) = *((word32*)(b )) ^ *((word32*)rk[r][0]);
|
||||
*((word32*)temp[1]) = *((word32*)(b+ 4)) ^ *((word32*)rk[r][1]);
|
||||
*((word32*)temp[2]) = *((word32*)(b+ 8)) ^ *((word32*)rk[r][2]);
|
||||
*((word32*)temp[3]) = *((word32*)(b+12)) ^ *((word32*)rk[r][3]);
|
||||
|
||||
*((word32*)(b )) = *((const word32*)T1[temp[0][0]])
|
||||
^ *((const word32*)T2[temp[1][1]])
|
||||
^ *((const word32*)T3[temp[2][2]])
|
||||
^ *((const word32*)T4[temp[3][3]]);
|
||||
*((word32*)(b + 4)) = *((const word32*)T1[temp[1][0]])
|
||||
^ *((const word32*)T2[temp[2][1]])
|
||||
^ *((const word32*)T3[temp[3][2]])
|
||||
^ *((const word32*)T4[temp[0][3]]);
|
||||
*((word32*)(b + 8)) = *((const word32*)T1[temp[2][0]])
|
||||
^ *((const word32*)T2[temp[3][1]])
|
||||
^ *((const word32*)T3[temp[0][2]])
|
||||
^ *((const word32*)T4[temp[1][3]]);
|
||||
*((word32*)(b +12)) = *((const word32*)T1[temp[3][0]])
|
||||
^ *((const word32*)T2[temp[0][1]])
|
||||
^ *((const word32*)T3[temp[1][2]])
|
||||
^ *((const word32*)T4[temp[2][3]]);
|
||||
}
|
||||
/* last round is special */
|
||||
*((word32*)temp[0]) = *((word32*)(b )) ^ *((word32*)rk[ROUNDS-1][0]);
|
||||
*((word32*)temp[1]) = *((word32*)(b+ 4)) ^ *((word32*)rk[ROUNDS-1][1]);
|
||||
*((word32*)temp[2]) = *((word32*)(b+ 8)) ^ *((word32*)rk[ROUNDS-1][2]);
|
||||
*((word32*)temp[3]) = *((word32*)(b+12)) ^ *((word32*)rk[ROUNDS-1][3]);
|
||||
b[ 0] = T1[temp[0][0]][1];
|
||||
b[ 1] = T1[temp[1][1]][1];
|
||||
b[ 2] = T1[temp[2][2]][1];
|
||||
b[ 3] = T1[temp[3][3]][1];
|
||||
b[ 4] = T1[temp[1][0]][1];
|
||||
b[ 5] = T1[temp[2][1]][1];
|
||||
b[ 6] = T1[temp[3][2]][1];
|
||||
b[ 7] = T1[temp[0][3]][1];
|
||||
b[ 8] = T1[temp[2][0]][1];
|
||||
b[ 9] = T1[temp[3][1]][1];
|
||||
b[10] = T1[temp[0][2]][1];
|
||||
b[11] = T1[temp[1][3]][1];
|
||||
b[12] = T1[temp[3][0]][1];
|
||||
b[13] = T1[temp[0][1]][1];
|
||||
b[14] = T1[temp[1][2]][1];
|
||||
b[15] = T1[temp[2][3]][1];
|
||||
*((word32*)(b )) ^= *((word32*)rk[ROUNDS][0]);
|
||||
*((word32*)(b+ 4)) ^= *((word32*)rk[ROUNDS][1]);
|
||||
*((word32*)(b+ 8)) ^= *((word32*)rk[ROUNDS][2]);
|
||||
*((word32*)(b+12)) ^= *((word32*)rk[ROUNDS][3]);
|
||||
|
||||
memcpy(out, b, sizeof b /* XXX out */);
|
||||
|
||||
return 0;
|
||||
#undef a
|
||||
#undef b
|
||||
#undef temp
|
||||
}
|
||||
|
||||
#ifdef INTERMEDIATE_VALUE_KAT
|
||||
/**
|
||||
* Encrypt only a certain number of rounds.
|
||||
* Only used in the Intermediate Value Known Answer Test.
|
||||
*/
|
||||
int rijndaelEncryptRound(word8 a[4][4], word8 rk[MAXROUNDS+1][4][4], int ROUNDS, int rounds) {
|
||||
int r;
|
||||
word8 temp[4][4];
|
||||
|
||||
/* make number of rounds sane */
|
||||
if (rounds > ROUNDS) {
|
||||
rounds = ROUNDS;
|
||||
}
|
||||
|
||||
*((word32*)a[0]) = *((word32*)a[0]) ^ *((word32*)rk[0][0]);
|
||||
*((word32*)a[1]) = *((word32*)a[1]) ^ *((word32*)rk[0][1]);
|
||||
*((word32*)a[2]) = *((word32*)a[2]) ^ *((word32*)rk[0][2]);
|
||||
*((word32*)a[3]) = *((word32*)a[3]) ^ *((word32*)rk[0][3]);
|
||||
|
||||
for (r = 1; (r <= rounds) && (r < ROUNDS); r++) {
|
||||
*((word32*)temp[0]) = *((const word32*)T1[a[0][0]])
|
||||
^ *((const word32*)T2[a[1][1]])
|
||||
^ *((const word32*)T3[a[2][2]])
|
||||
^ *((const word32*)T4[a[3][3]]);
|
||||
*((word32*)temp[1]) = *((const word32*)T1[a[1][0]])
|
||||
^ *((const word32*)T2[a[2][1]])
|
||||
^ *((const word32*)T3[a[3][2]])
|
||||
^ *((const word32*)T4[a[0][3]]);
|
||||
*((word32*)temp[2]) = *((const word32*)T1[a[2][0]])
|
||||
^ *((const word32*)T2[a[3][1]])
|
||||
^ *((const word32*)T3[a[0][2]])
|
||||
^ *((const word32*)T4[a[1][3]]);
|
||||
*((word32*)temp[3]) = *((const word32*)T1[a[3][0]])
|
||||
^ *((const word32*)T2[a[0][1]])
|
||||
^ *((const word32*)T3[a[1][2]])
|
||||
^ *((const word32*)T4[a[2][3]]);
|
||||
*((word32*)a[0]) = *((word32*)temp[0]) ^ *((word32*)rk[r][0]);
|
||||
*((word32*)a[1]) = *((word32*)temp[1]) ^ *((word32*)rk[r][1]);
|
||||
*((word32*)a[2]) = *((word32*)temp[2]) ^ *((word32*)rk[r][2]);
|
||||
*((word32*)a[3]) = *((word32*)temp[3]) ^ *((word32*)rk[r][3]);
|
||||
}
|
||||
if (rounds == ROUNDS) {
|
||||
/* last round is special */
|
||||
temp[0][0] = T1[a[0][0]][1];
|
||||
temp[0][1] = T1[a[1][1]][1];
|
||||
temp[0][2] = T1[a[2][2]][1];
|
||||
temp[0][3] = T1[a[3][3]][1];
|
||||
temp[1][0] = T1[a[1][0]][1];
|
||||
temp[1][1] = T1[a[2][1]][1];
|
||||
temp[1][2] = T1[a[3][2]][1];
|
||||
temp[1][3] = T1[a[0][3]][1];
|
||||
temp[2][0] = T1[a[2][0]][1];
|
||||
temp[2][1] = T1[a[3][1]][1];
|
||||
temp[2][2] = T1[a[0][2]][1];
|
||||
temp[2][3] = T1[a[1][3]][1];
|
||||
temp[3][0] = T1[a[3][0]][1];
|
||||
temp[3][1] = T1[a[0][1]][1];
|
||||
temp[3][2] = T1[a[1][2]][1];
|
||||
temp[3][3] = T1[a[2][3]][1];
|
||||
*((word32*)a[0]) = *((word32*)temp[0]) ^ *((word32*)rk[ROUNDS][0]);
|
||||
*((word32*)a[1]) = *((word32*)temp[1]) ^ *((word32*)rk[ROUNDS][1]);
|
||||
*((word32*)a[2]) = *((word32*)temp[2]) ^ *((word32*)rk[ROUNDS][2]);
|
||||
*((word32*)a[3]) = *((word32*)temp[3]) ^ *((word32*)rk[ROUNDS][3]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* INTERMEDIATE_VALUE_KAT */
|
||||
|
||||
/**
|
||||
* Decrypt a single block.
|
||||
*/
|
||||
int rijndaelDecrypt(word8 in[16], word8 out[16], word8 rk[MAXROUNDS+1][4][4], int ROUNDS) {
|
||||
int r;
|
||||
union {
|
||||
word8 x8[16];
|
||||
word32 x32[4];
|
||||
} xa, xb;
|
||||
#define a xa.x8
|
||||
#define b xb.x8
|
||||
union {
|
||||
word8 x8[4][4];
|
||||
word32 x32[4];
|
||||
} xtemp;
|
||||
#define temp xtemp.x8
|
||||
|
||||
memcpy(a, in, sizeof a);
|
||||
|
||||
*((word32*)temp[0]) = *((word32*)(a )) ^ *((word32*)rk[ROUNDS][0]);
|
||||
*((word32*)temp[1]) = *((word32*)(a+ 4)) ^ *((word32*)rk[ROUNDS][1]);
|
||||
*((word32*)temp[2]) = *((word32*)(a+ 8)) ^ *((word32*)rk[ROUNDS][2]);
|
||||
*((word32*)temp[3]) = *((word32*)(a+12)) ^ *((word32*)rk[ROUNDS][3]);
|
||||
|
||||
*((word32*)(b )) = *((const word32*)T5[temp[0][0]])
|
||||
^ *((const word32*)T6[temp[3][1]])
|
||||
^ *((const word32*)T7[temp[2][2]])
|
||||
^ *((const word32*)T8[temp[1][3]]);
|
||||
*((word32*)(b+ 4)) = *((const word32*)T5[temp[1][0]])
|
||||
^ *((const word32*)T6[temp[0][1]])
|
||||
^ *((const word32*)T7[temp[3][2]])
|
||||
^ *((const word32*)T8[temp[2][3]]);
|
||||
*((word32*)(b+ 8)) = *((const word32*)T5[temp[2][0]])
|
||||
^ *((const word32*)T6[temp[1][1]])
|
||||
^ *((const word32*)T7[temp[0][2]])
|
||||
^ *((const word32*)T8[temp[3][3]]);
|
||||
*((word32*)(b+12)) = *((const word32*)T5[temp[3][0]])
|
||||
^ *((const word32*)T6[temp[2][1]])
|
||||
^ *((const word32*)T7[temp[1][2]])
|
||||
^ *((const word32*)T8[temp[0][3]]);
|
||||
for (r = ROUNDS-1; r > 1; r--) {
|
||||
*((word32*)temp[0]) = *((word32*)(b )) ^ *((word32*)rk[r][0]);
|
||||
*((word32*)temp[1]) = *((word32*)(b+ 4)) ^ *((word32*)rk[r][1]);
|
||||
*((word32*)temp[2]) = *((word32*)(b+ 8)) ^ *((word32*)rk[r][2]);
|
||||
*((word32*)temp[3]) = *((word32*)(b+12)) ^ *((word32*)rk[r][3]);
|
||||
*((word32*)(b )) = *((const word32*)T5[temp[0][0]])
|
||||
^ *((const word32*)T6[temp[3][1]])
|
||||
^ *((const word32*)T7[temp[2][2]])
|
||||
^ *((const word32*)T8[temp[1][3]]);
|
||||
*((word32*)(b+ 4)) = *((const word32*)T5[temp[1][0]])
|
||||
^ *((const word32*)T6[temp[0][1]])
|
||||
^ *((const word32*)T7[temp[3][2]])
|
||||
^ *((const word32*)T8[temp[2][3]]);
|
||||
*((word32*)(b+ 8)) = *((const word32*)T5[temp[2][0]])
|
||||
^ *((const word32*)T6[temp[1][1]])
|
||||
^ *((const word32*)T7[temp[0][2]])
|
||||
^ *((const word32*)T8[temp[3][3]]);
|
||||
*((word32*)(b+12)) = *((const word32*)T5[temp[3][0]])
|
||||
^ *((const word32*)T6[temp[2][1]])
|
||||
^ *((const word32*)T7[temp[1][2]])
|
||||
^ *((const word32*)T8[temp[0][3]]);
|
||||
}
|
||||
/* last round is special */
|
||||
*((word32*)temp[0]) = *((word32*)(b )) ^ *((word32*)rk[1][0]);
|
||||
*((word32*)temp[1]) = *((word32*)(b+ 4)) ^ *((word32*)rk[1][1]);
|
||||
*((word32*)temp[2]) = *((word32*)(b+ 8)) ^ *((word32*)rk[1][2]);
|
||||
*((word32*)temp[3]) = *((word32*)(b+12)) ^ *((word32*)rk[1][3]);
|
||||
b[ 0] = S5[temp[0][0]];
|
||||
b[ 1] = S5[temp[3][1]];
|
||||
b[ 2] = S5[temp[2][2]];
|
||||
b[ 3] = S5[temp[1][3]];
|
||||
b[ 4] = S5[temp[1][0]];
|
||||
b[ 5] = S5[temp[0][1]];
|
||||
b[ 6] = S5[temp[3][2]];
|
||||
b[ 7] = S5[temp[2][3]];
|
||||
b[ 8] = S5[temp[2][0]];
|
||||
b[ 9] = S5[temp[1][1]];
|
||||
b[10] = S5[temp[0][2]];
|
||||
b[11] = S5[temp[3][3]];
|
||||
b[12] = S5[temp[3][0]];
|
||||
b[13] = S5[temp[2][1]];
|
||||
b[14] = S5[temp[1][2]];
|
||||
b[15] = S5[temp[0][3]];
|
||||
*((word32*)(b )) ^= *((word32*)rk[0][0]);
|
||||
*((word32*)(b+ 4)) ^= *((word32*)rk[0][1]);
|
||||
*((word32*)(b+ 8)) ^= *((word32*)rk[0][2]);
|
||||
*((word32*)(b+12)) ^= *((word32*)rk[0][3]);
|
||||
|
||||
memcpy(out, b, sizeof b /* XXX out */);
|
||||
|
||||
return 0;
|
||||
#undef a
|
||||
#undef b
|
||||
#undef temp
|
||||
}
|
||||
|
||||
|
||||
#ifdef INTERMEDIATE_VALUE_KAT
|
||||
/**
|
||||
* Decrypt only a certain number of rounds.
|
||||
* Only used in the Intermediate Value Known Answer Test.
|
||||
* Operations rearranged such that the intermediate values
|
||||
* of decryption correspond with the intermediate values
|
||||
* of encryption.
|
||||
*/
|
||||
int rijndaelDecryptRound(word8 a[4][4], word8 rk[MAXROUNDS+1][4][4], int ROUNDS, int rounds) {
|
||||
int r, i;
|
||||
word8 temp[4], shift;
|
||||
|
||||
/* make number of rounds sane */
|
||||
if (rounds > ROUNDS) {
|
||||
rounds = ROUNDS;
|
||||
}
|
||||
/* first round is special: */
|
||||
*(word32 *)a[0] ^= *(word32 *)rk[ROUNDS][0];
|
||||
*(word32 *)a[1] ^= *(word32 *)rk[ROUNDS][1];
|
||||
*(word32 *)a[2] ^= *(word32 *)rk[ROUNDS][2];
|
||||
*(word32 *)a[3] ^= *(word32 *)rk[ROUNDS][3];
|
||||
for (i = 0; i < 4; i++) {
|
||||
a[i][0] = Si[a[i][0]];
|
||||
a[i][1] = Si[a[i][1]];
|
||||
a[i][2] = Si[a[i][2]];
|
||||
a[i][3] = Si[a[i][3]];
|
||||
}
|
||||
for (i = 1; i < 4; i++) {
|
||||
shift = (4 - i) & 3;
|
||||
temp[0] = a[(0 + shift) & 3][i];
|
||||
temp[1] = a[(1 + shift) & 3][i];
|
||||
temp[2] = a[(2 + shift) & 3][i];
|
||||
temp[3] = a[(3 + shift) & 3][i];
|
||||
a[0][i] = temp[0];
|
||||
a[1][i] = temp[1];
|
||||
a[2][i] = temp[2];
|
||||
a[3][i] = temp[3];
|
||||
}
|
||||
/* ROUNDS-1 ordinary rounds */
|
||||
for (r = ROUNDS-1; r > rounds; r--) {
|
||||
*(word32 *)a[0] ^= *(word32 *)rk[r][0];
|
||||
*(word32 *)a[1] ^= *(word32 *)rk[r][1];
|
||||
*(word32 *)a[2] ^= *(word32 *)rk[r][2];
|
||||
*(word32 *)a[3] ^= *(word32 *)rk[r][3];
|
||||
|
||||
*((word32*)a[0]) =
|
||||
*((const word32*)U1[a[0][0]])
|
||||
^ *((const word32*)U2[a[0][1]])
|
||||
^ *((const word32*)U3[a[0][2]])
|
||||
^ *((const word32*)U4[a[0][3]]);
|
||||
|
||||
*((word32*)a[1]) =
|
||||
*((const word32*)U1[a[1][0]])
|
||||
^ *((const word32*)U2[a[1][1]])
|
||||
^ *((const word32*)U3[a[1][2]])
|
||||
^ *((const word32*)U4[a[1][3]]);
|
||||
|
||||
*((word32*)a[2]) =
|
||||
*((const word32*)U1[a[2][0]])
|
||||
^ *((const word32*)U2[a[2][1]])
|
||||
^ *((const word32*)U3[a[2][2]])
|
||||
^ *((const word32*)U4[a[2][3]]);
|
||||
|
||||
*((word32*)a[3]) =
|
||||
*((const word32*)U1[a[3][0]])
|
||||
^ *((const word32*)U2[a[3][1]])
|
||||
^ *((const word32*)U3[a[3][2]])
|
||||
^ *((const word32*)U4[a[3][3]]);
|
||||
for (i = 0; i < 4; i++) {
|
||||
a[i][0] = Si[a[i][0]];
|
||||
a[i][1] = Si[a[i][1]];
|
||||
a[i][2] = Si[a[i][2]];
|
||||
a[i][3] = Si[a[i][3]];
|
||||
}
|
||||
for (i = 1; i < 4; i++) {
|
||||
shift = (4 - i) & 3;
|
||||
temp[0] = a[(0 + shift) & 3][i];
|
||||
temp[1] = a[(1 + shift) & 3][i];
|
||||
temp[2] = a[(2 + shift) & 3][i];
|
||||
temp[3] = a[(3 + shift) & 3][i];
|
||||
a[0][i] = temp[0];
|
||||
a[1][i] = temp[1];
|
||||
a[2][i] = temp[2];
|
||||
a[3][i] = temp[3];
|
||||
}
|
||||
}
|
||||
if (rounds == 0) {
|
||||
/* End with the extra key addition */
|
||||
*(word32 *)a[0] ^= *(word32 *)rk[0][0];
|
||||
*(word32 *)a[1] ^= *(word32 *)rk[0][1];
|
||||
*(word32 *)a[2] ^= *(word32 *)rk[0][2];
|
||||
*(word32 *)a[3] ^= *(word32 *)rk[0][3];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif /* INTERMEDIATE_VALUE_KAT */
|
33
crypto/dist/kame/racoon/missing/crypto/rijndael/rijndael-alg-fst.h
vendored
Normal file
33
crypto/dist/kame/racoon/missing/crypto/rijndael/rijndael-alg-fst.h
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/* $KAME: rijndael-alg-fst.h,v 1.1.1.1 2001/08/08 09:56:23 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* rijndael-alg-fst.h v2.3 April '2000
|
||||
*
|
||||
* Optimised ANSI C code
|
||||
*
|
||||
* #define INTERMEDIATE_VALUE_KAT to generate the Intermediate Value Known Answer Test.
|
||||
*/
|
||||
|
||||
#ifndef __RIJNDAEL_ALG_FST_H
|
||||
#define __RIJNDAEL_ALG_FST_H
|
||||
|
||||
#define RIJNDAEL_MAXKC (256/32)
|
||||
#define RIJNDAEL_MAXROUNDS 14
|
||||
|
||||
int rijndaelKeySched(u_int8_t k[RIJNDAEL_MAXKC][4], u_int8_t rk[RIJNDAEL_MAXROUNDS+1][4][4], int ROUNDS);
|
||||
|
||||
int rijndaelKeyEncToDec(u_int8_t W[RIJNDAEL_MAXROUNDS+1][4][4], int ROUNDS);
|
||||
|
||||
int rijndaelEncrypt(u_int8_t a[16], u_int8_t b[16], u_int8_t rk[RIJNDAEL_MAXROUNDS+1][4][4], int ROUNDS);
|
||||
|
||||
#ifdef INTERMEDIATE_VALUE_KAT
|
||||
int rijndaelEncryptRound(u_int8_t a[4][4], u_int8_t rk[RIJNDAEL_MAXROUNDS+1][4][4], int ROUNDS, int rounds);
|
||||
#endif /* INTERMEDIATE_VALUE_KAT */
|
||||
|
||||
int rijndaelDecrypt(u_int8_t a[16], u_int8_t b[16], u_int8_t rk[RIJNDAEL_MAXROUNDS+1][4][4], int ROUNDS);
|
||||
|
||||
#ifdef INTERMEDIATE_VALUE_KAT
|
||||
int rijndaelDecryptRound(u_int8_t a[4][4], u_int8_t rk[RIJNDAEL_MAXROUNDS+1][4][4], int ROUNDS, int rounds);
|
||||
#endif /* INTERMEDIATE_VALUE_KAT */
|
||||
|
||||
#endif /* __RIJNDAEL_ALG_FST_H */
|
495
crypto/dist/kame/racoon/missing/crypto/rijndael/rijndael-api-fst.c
vendored
Normal file
495
crypto/dist/kame/racoon/missing/crypto/rijndael/rijndael-api-fst.c
vendored
Normal file
@ -0,0 +1,495 @@
|
||||
/* $KAME: rijndael-api-fst.c,v 1.2 2001/08/16 21:46:54 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* rijndael-api-fst.c v2.3 April '2000
|
||||
*
|
||||
* Optimised ANSI C code
|
||||
*
|
||||
* authors: v1.0: Antoon Bosselaers
|
||||
* v2.0: Vincent Rijmen
|
||||
* v2.1: Vincent Rijmen
|
||||
* v2.2: Vincent Rijmen
|
||||
* v2.3: Paulo Barreto
|
||||
* v2.4: Vincent Rijmen
|
||||
*
|
||||
* This code is placed in the public domain.
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef _KERNEL
|
||||
#include <sys/time.h>
|
||||
#include <sys/systm.h>
|
||||
#else
|
||||
#include <string.h>
|
||||
#endif
|
||||
#include <crypto/rijndael/rijndael-alg-fst.h>
|
||||
#include <crypto/rijndael/rijndael-api-fst.h>
|
||||
#include <crypto/rijndael/rijndael_local.h>
|
||||
|
||||
#include <err.h>
|
||||
#define bcopy(a, b, c) memcpy(b, a, c)
|
||||
#define bzero(a, b) memset(a, 0, b)
|
||||
#define panic(a) err(1, (a))
|
||||
|
||||
int rijndael_makeKey(keyInstance *key, BYTE direction, int keyLen, char *keyMaterial) {
|
||||
word8 k[MAXKC][4];
|
||||
int i;
|
||||
char *keyMat;
|
||||
|
||||
if (key == NULL) {
|
||||
return BAD_KEY_INSTANCE;
|
||||
}
|
||||
|
||||
if ((direction == DIR_ENCRYPT) || (direction == DIR_DECRYPT)) {
|
||||
key->direction = direction;
|
||||
} else {
|
||||
return BAD_KEY_DIR;
|
||||
}
|
||||
|
||||
if ((keyLen == 128) || (keyLen == 192) || (keyLen == 256)) {
|
||||
key->keyLen = keyLen;
|
||||
} else {
|
||||
return BAD_KEY_MAT;
|
||||
}
|
||||
|
||||
if (keyMaterial != NULL) {
|
||||
bcopy(keyMaterial, key->keyMaterial, keyLen/8);
|
||||
}
|
||||
|
||||
key->ROUNDS = keyLen/32 + 6;
|
||||
|
||||
/* initialize key schedule: */
|
||||
keyMat = key->keyMaterial;
|
||||
for (i = 0; i < key->keyLen/8; i++) {
|
||||
k[i >> 2][i & 3] = (word8)keyMat[i];
|
||||
}
|
||||
rijndaelKeySched(k, key->keySched, key->ROUNDS);
|
||||
if (direction == DIR_DECRYPT) {
|
||||
rijndaelKeyEncToDec(key->keySched, key->ROUNDS);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int rijndael_cipherInit(cipherInstance *cipher, BYTE mode, char *IV) {
|
||||
if ((mode == MODE_ECB) || (mode == MODE_CBC) || (mode == MODE_CFB1)) {
|
||||
cipher->mode = mode;
|
||||
} else {
|
||||
return BAD_CIPHER_MODE;
|
||||
}
|
||||
if (IV != NULL) {
|
||||
bcopy(IV, cipher->IV, MAX_IV_SIZE);
|
||||
} else {
|
||||
bzero(cipher->IV, MAX_IV_SIZE);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int rijndael_blockEncrypt(cipherInstance *cipher, keyInstance *key,
|
||||
BYTE *input, int inputLen, BYTE *outBuffer) {
|
||||
int i, k, numBlocks;
|
||||
word8 block[16], iv[4][4];
|
||||
|
||||
if (cipher == NULL ||
|
||||
key == NULL ||
|
||||
key->direction == DIR_DECRYPT) {
|
||||
return BAD_CIPHER_STATE;
|
||||
}
|
||||
if (input == NULL || inputLen <= 0) {
|
||||
return 0; /* nothing to do */
|
||||
}
|
||||
|
||||
numBlocks = inputLen/128;
|
||||
|
||||
switch (cipher->mode) {
|
||||
case MODE_ECB:
|
||||
for (i = numBlocks; i > 0; i--) {
|
||||
rijndaelEncrypt(input, outBuffer, key->keySched, key->ROUNDS);
|
||||
input += 16;
|
||||
outBuffer += 16;
|
||||
}
|
||||
break;
|
||||
|
||||
case MODE_CBC:
|
||||
#if 0 /*STRICT_ALIGN*/
|
||||
bcopy(cipher->IV, block, 16);
|
||||
bcopy(input, iv, 16);
|
||||
((word32*)block)[0] ^= ((word32*)iv)[0];
|
||||
((word32*)block)[1] ^= ((word32*)iv)[1];
|
||||
((word32*)block)[2] ^= ((word32*)iv)[2];
|
||||
((word32*)block)[3] ^= ((word32*)iv)[3];
|
||||
#else
|
||||
((word32*)block)[0] = ((word32*)cipher->IV)[0] ^ ((word32*)input)[0];
|
||||
((word32*)block)[1] = ((word32*)cipher->IV)[1] ^ ((word32*)input)[1];
|
||||
((word32*)block)[2] = ((word32*)cipher->IV)[2] ^ ((word32*)input)[2];
|
||||
((word32*)block)[3] = ((word32*)cipher->IV)[3] ^ ((word32*)input)[3];
|
||||
#endif
|
||||
rijndaelEncrypt(block, outBuffer, key->keySched, key->ROUNDS);
|
||||
input += 16;
|
||||
for (i = numBlocks - 1; i > 0; i--) {
|
||||
#if 0 /*STRICT_ALIGN*/
|
||||
bcopy(outBuffer, block, 16);
|
||||
((word32*)block)[0] ^= ((word32*)iv)[0];
|
||||
((word32*)block)[1] ^= ((word32*)iv)[1];
|
||||
((word32*)block)[2] ^= ((word32*)iv)[2];
|
||||
((word32*)block)[3] ^= ((word32*)iv)[3];
|
||||
#else
|
||||
((word32*)block)[0] = ((word32*)outBuffer)[0] ^ ((word32*)input)[0];
|
||||
((word32*)block)[1] = ((word32*)outBuffer)[1] ^ ((word32*)input)[1];
|
||||
((word32*)block)[2] = ((word32*)outBuffer)[2] ^ ((word32*)input)[2];
|
||||
((word32*)block)[3] = ((word32*)outBuffer)[3] ^ ((word32*)input)[3];
|
||||
#endif
|
||||
outBuffer += 16;
|
||||
rijndaelEncrypt(block, outBuffer, key->keySched, key->ROUNDS);
|
||||
input += 16;
|
||||
}
|
||||
break;
|
||||
|
||||
case MODE_CFB1:
|
||||
#if 0 /*STRICT_ALIGN*/
|
||||
bcopy(cipher->IV, iv, 16);
|
||||
#else /* !STRICT_ALIGN */
|
||||
*((word32*)iv[0]) = *((word32*)(cipher->IV ));
|
||||
*((word32*)iv[1]) = *((word32*)(cipher->IV+ 4));
|
||||
*((word32*)iv[2]) = *((word32*)(cipher->IV+ 8));
|
||||
*((word32*)iv[3]) = *((word32*)(cipher->IV+12));
|
||||
#endif /* ?STRICT_ALIGN */
|
||||
for (i = numBlocks; i > 0; i--) {
|
||||
for (k = 0; k < 128; k++) {
|
||||
*((word32*) block ) = *((word32*)iv[0]);
|
||||
*((word32*)(block+ 4)) = *((word32*)iv[1]);
|
||||
*((word32*)(block+ 8)) = *((word32*)iv[2]);
|
||||
*((word32*)(block+12)) = *((word32*)iv[3]);
|
||||
rijndaelEncrypt(block, block, key->keySched, key->ROUNDS);
|
||||
outBuffer[k/8] ^= (block[0] & 0x80) >> (k & 7);
|
||||
iv[0][0] = (iv[0][0] << 1) | (iv[0][1] >> 7);
|
||||
iv[0][1] = (iv[0][1] << 1) | (iv[0][2] >> 7);
|
||||
iv[0][2] = (iv[0][2] << 1) | (iv[0][3] >> 7);
|
||||
iv[0][3] = (iv[0][3] << 1) | (iv[1][0] >> 7);
|
||||
iv[1][0] = (iv[1][0] << 1) | (iv[1][1] >> 7);
|
||||
iv[1][1] = (iv[1][1] << 1) | (iv[1][2] >> 7);
|
||||
iv[1][2] = (iv[1][2] << 1) | (iv[1][3] >> 7);
|
||||
iv[1][3] = (iv[1][3] << 1) | (iv[2][0] >> 7);
|
||||
iv[2][0] = (iv[2][0] << 1) | (iv[2][1] >> 7);
|
||||
iv[2][1] = (iv[2][1] << 1) | (iv[2][2] >> 7);
|
||||
iv[2][2] = (iv[2][2] << 1) | (iv[2][3] >> 7);
|
||||
iv[2][3] = (iv[2][3] << 1) | (iv[3][0] >> 7);
|
||||
iv[3][0] = (iv[3][0] << 1) | (iv[3][1] >> 7);
|
||||
iv[3][1] = (iv[3][1] << 1) | (iv[3][2] >> 7);
|
||||
iv[3][2] = (iv[3][2] << 1) | (iv[3][3] >> 7);
|
||||
iv[3][3] = (iv[3][3] << 1) | ((outBuffer[k/8] >> (7-(k&7))) & 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return BAD_CIPHER_STATE;
|
||||
}
|
||||
|
||||
return 128*numBlocks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encrypt data partitioned in octets, using RFC 2040-like padding.
|
||||
*
|
||||
* @param input data to be encrypted (octet sequence)
|
||||
* @param inputOctets input length in octets (not bits)
|
||||
* @param outBuffer encrypted output data
|
||||
*
|
||||
* @return length in octets (not bits) of the encrypted output buffer.
|
||||
*/
|
||||
int rijndael_padEncrypt(cipherInstance *cipher, keyInstance *key,
|
||||
BYTE *input, int inputOctets, BYTE *outBuffer) {
|
||||
int i, numBlocks, padLen;
|
||||
word8 block[16], *iv, *cp;
|
||||
|
||||
if (cipher == NULL ||
|
||||
key == NULL ||
|
||||
key->direction == DIR_DECRYPT) {
|
||||
return BAD_CIPHER_STATE;
|
||||
}
|
||||
if (input == NULL || inputOctets <= 0) {
|
||||
return 0; /* nothing to do */
|
||||
}
|
||||
|
||||
numBlocks = inputOctets/16;
|
||||
|
||||
switch (cipher->mode) {
|
||||
case MODE_ECB:
|
||||
for (i = numBlocks; i > 0; i--) {
|
||||
rijndaelEncrypt(input, outBuffer, key->keySched, key->ROUNDS);
|
||||
input += 16;
|
||||
outBuffer += 16;
|
||||
}
|
||||
padLen = 16 - (inputOctets - 16*numBlocks);
|
||||
if (padLen > 0 && padLen <= 16)
|
||||
panic("rijndael_padEncrypt(ECB)");
|
||||
bcopy(input, block, 16 - padLen);
|
||||
for (cp = block + 16 - padLen; cp < block + 16; cp++)
|
||||
*cp = padLen;
|
||||
rijndaelEncrypt(block, outBuffer, key->keySched, key->ROUNDS);
|
||||
break;
|
||||
|
||||
case MODE_CBC:
|
||||
iv = cipher->IV;
|
||||
for (i = numBlocks; i > 0; i--) {
|
||||
((word32*)block)[0] = ((word32*)input)[0] ^ ((word32*)iv)[0];
|
||||
((word32*)block)[1] = ((word32*)input)[1] ^ ((word32*)iv)[1];
|
||||
((word32*)block)[2] = ((word32*)input)[2] ^ ((word32*)iv)[2];
|
||||
((word32*)block)[3] = ((word32*)input)[3] ^ ((word32*)iv)[3];
|
||||
rijndaelEncrypt(block, outBuffer, key->keySched, key->ROUNDS);
|
||||
iv = outBuffer;
|
||||
input += 16;
|
||||
outBuffer += 16;
|
||||
}
|
||||
#if 0 /*XXX i'm not sure that is correct. sakane@kame.net */
|
||||
padLen = 16 - (inputOctets - 16*numBlocks);
|
||||
#else
|
||||
padLen = 16 - inputOctets % 16;
|
||||
if (padLen == 16)
|
||||
padLen = 0;
|
||||
#endif
|
||||
if (padLen > 0 && padLen <= 16)
|
||||
panic("rijndael_padEncrypt(CBC)");
|
||||
for (i = 0; i < 16 - padLen; i++) {
|
||||
block[i] = input[i] ^ iv[i];
|
||||
}
|
||||
for (i = 16 - padLen; i < 16; i++) {
|
||||
block[i] = (BYTE)padLen ^ iv[i];
|
||||
}
|
||||
rijndaelEncrypt(block, outBuffer, key->keySched, key->ROUNDS);
|
||||
break;
|
||||
|
||||
default:
|
||||
return BAD_CIPHER_STATE;
|
||||
}
|
||||
|
||||
return 16*(numBlocks + 1);
|
||||
}
|
||||
|
||||
int rijndael_blockDecrypt(cipherInstance *cipher, keyInstance *key,
|
||||
BYTE *input, int inputLen, BYTE *outBuffer) {
|
||||
int i, k, numBlocks;
|
||||
word8 block[16], iv[4][4];
|
||||
|
||||
if (cipher == NULL ||
|
||||
key == NULL ||
|
||||
(cipher->mode != MODE_CFB1 && key->direction == DIR_ENCRYPT)) {
|
||||
return BAD_CIPHER_STATE;
|
||||
}
|
||||
if (input == NULL || inputLen <= 0) {
|
||||
return 0; /* nothing to do */
|
||||
}
|
||||
|
||||
numBlocks = inputLen/128;
|
||||
|
||||
switch (cipher->mode) {
|
||||
case MODE_ECB:
|
||||
for (i = numBlocks; i > 0; i--) {
|
||||
rijndaelDecrypt(input, outBuffer, key->keySched, key->ROUNDS);
|
||||
input += 16;
|
||||
outBuffer += 16;
|
||||
}
|
||||
break;
|
||||
|
||||
case MODE_CBC:
|
||||
#if 0 /*STRICT_ALIGN */
|
||||
bcopy(cipher->IV, iv, 16);
|
||||
#else
|
||||
*((word32*)iv[0]) = *((word32*)(cipher->IV ));
|
||||
*((word32*)iv[1]) = *((word32*)(cipher->IV+ 4));
|
||||
*((word32*)iv[2]) = *((word32*)(cipher->IV+ 8));
|
||||
*((word32*)iv[3]) = *((word32*)(cipher->IV+12));
|
||||
#endif
|
||||
for (i = numBlocks; i > 0; i--) {
|
||||
rijndaelDecrypt(input, block, key->keySched, key->ROUNDS);
|
||||
((word32*)block)[0] ^= *((word32*)iv[0]);
|
||||
((word32*)block)[1] ^= *((word32*)iv[1]);
|
||||
((word32*)block)[2] ^= *((word32*)iv[2]);
|
||||
((word32*)block)[3] ^= *((word32*)iv[3]);
|
||||
#if 0 /*STRICT_ALIGN*/
|
||||
bcopy(input, iv, 16);
|
||||
bcopy(block, outBuffer, 16);
|
||||
#else
|
||||
*((word32*)iv[0]) = ((word32*)input)[0]; ((word32*)outBuffer)[0] = ((word32*)block)[0];
|
||||
*((word32*)iv[1]) = ((word32*)input)[1]; ((word32*)outBuffer)[1] = ((word32*)block)[1];
|
||||
*((word32*)iv[2]) = ((word32*)input)[2]; ((word32*)outBuffer)[2] = ((word32*)block)[2];
|
||||
*((word32*)iv[3]) = ((word32*)input)[3]; ((word32*)outBuffer)[3] = ((word32*)block)[3];
|
||||
#endif
|
||||
input += 16;
|
||||
outBuffer += 16;
|
||||
}
|
||||
break;
|
||||
|
||||
case MODE_CFB1:
|
||||
#if 0 /*STRICT_ALIGN */
|
||||
bcopy(cipher->IV, iv, 16);
|
||||
#else
|
||||
*((word32*)iv[0]) = *((word32*)(cipher->IV));
|
||||
*((word32*)iv[1]) = *((word32*)(cipher->IV+ 4));
|
||||
*((word32*)iv[2]) = *((word32*)(cipher->IV+ 8));
|
||||
*((word32*)iv[3]) = *((word32*)(cipher->IV+12));
|
||||
#endif
|
||||
for (i = numBlocks; i > 0; i--) {
|
||||
for (k = 0; k < 128; k++) {
|
||||
*((word32*) block ) = *((word32*)iv[0]);
|
||||
*((word32*)(block+ 4)) = *((word32*)iv[1]);
|
||||
*((word32*)(block+ 8)) = *((word32*)iv[2]);
|
||||
*((word32*)(block+12)) = *((word32*)iv[3]);
|
||||
rijndaelEncrypt(block, block, key->keySched, key->ROUNDS);
|
||||
iv[0][0] = (iv[0][0] << 1) | (iv[0][1] >> 7);
|
||||
iv[0][1] = (iv[0][1] << 1) | (iv[0][2] >> 7);
|
||||
iv[0][2] = (iv[0][2] << 1) | (iv[0][3] >> 7);
|
||||
iv[0][3] = (iv[0][3] << 1) | (iv[1][0] >> 7);
|
||||
iv[1][0] = (iv[1][0] << 1) | (iv[1][1] >> 7);
|
||||
iv[1][1] = (iv[1][1] << 1) | (iv[1][2] >> 7);
|
||||
iv[1][2] = (iv[1][2] << 1) | (iv[1][3] >> 7);
|
||||
iv[1][3] = (iv[1][3] << 1) | (iv[2][0] >> 7);
|
||||
iv[2][0] = (iv[2][0] << 1) | (iv[2][1] >> 7);
|
||||
iv[2][1] = (iv[2][1] << 1) | (iv[2][2] >> 7);
|
||||
iv[2][2] = (iv[2][2] << 1) | (iv[2][3] >> 7);
|
||||
iv[2][3] = (iv[2][3] << 1) | (iv[3][0] >> 7);
|
||||
iv[3][0] = (iv[3][0] << 1) | (iv[3][1] >> 7);
|
||||
iv[3][1] = (iv[3][1] << 1) | (iv[3][2] >> 7);
|
||||
iv[3][2] = (iv[3][2] << 1) | (iv[3][3] >> 7);
|
||||
iv[3][3] = (iv[3][3] << 1) | ((input[k/8] >> (7-(k&7))) & 1);
|
||||
outBuffer[k/8] ^= (block[0] & 0x80) >> (k & 7);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return BAD_CIPHER_STATE;
|
||||
}
|
||||
|
||||
return 128*numBlocks;
|
||||
}
|
||||
|
||||
int rijndael_padDecrypt(cipherInstance *cipher, keyInstance *key,
|
||||
BYTE *input, int inputOctets, BYTE *outBuffer) {
|
||||
int i, numBlocks, padLen;
|
||||
word8 block[16];
|
||||
word32 iv[4];
|
||||
|
||||
if (cipher == NULL ||
|
||||
key == NULL ||
|
||||
key->direction == DIR_ENCRYPT) {
|
||||
return BAD_CIPHER_STATE;
|
||||
}
|
||||
if (input == NULL || inputOctets <= 0) {
|
||||
return 0; /* nothing to do */
|
||||
}
|
||||
if (inputOctets % 16 != 0) {
|
||||
return BAD_DATA;
|
||||
}
|
||||
|
||||
numBlocks = inputOctets/16;
|
||||
|
||||
switch (cipher->mode) {
|
||||
case MODE_ECB:
|
||||
/* all blocks but last */
|
||||
for (i = numBlocks - 1; i > 0; i--) {
|
||||
rijndaelDecrypt(input, outBuffer, key->keySched, key->ROUNDS);
|
||||
input += 16;
|
||||
outBuffer += 16;
|
||||
}
|
||||
/* last block */
|
||||
rijndaelDecrypt(input, block, key->keySched, key->ROUNDS);
|
||||
padLen = block[15];
|
||||
if (padLen >= 16) {
|
||||
return BAD_DATA;
|
||||
}
|
||||
for (i = 16 - padLen; i < 16; i++) {
|
||||
if (block[i] != padLen) {
|
||||
return BAD_DATA;
|
||||
}
|
||||
}
|
||||
bcopy(block, outBuffer, 16 - padLen);
|
||||
break;
|
||||
|
||||
case MODE_CBC:
|
||||
bcopy(cipher->IV, iv, 16);
|
||||
/* all blocks but last */
|
||||
for (i = numBlocks - 1; i > 0; i--) {
|
||||
rijndaelDecrypt(input, block, key->keySched, key->ROUNDS);
|
||||
((word32*)block)[0] ^= iv[0];
|
||||
((word32*)block)[1] ^= iv[1];
|
||||
((word32*)block)[2] ^= iv[2];
|
||||
((word32*)block)[3] ^= iv[3];
|
||||
bcopy(input, iv, 16);
|
||||
bcopy(block, outBuffer, 16);
|
||||
input += 16;
|
||||
outBuffer += 16;
|
||||
}
|
||||
/* last block */
|
||||
rijndaelDecrypt(input, block, key->keySched, key->ROUNDS);
|
||||
((word32*)block)[0] ^= iv[0];
|
||||
((word32*)block)[1] ^= iv[1];
|
||||
((word32*)block)[2] ^= iv[2];
|
||||
((word32*)block)[3] ^= iv[3];
|
||||
padLen = block[15];
|
||||
if (padLen <= 0 || padLen > 16) {
|
||||
return BAD_DATA;
|
||||
}
|
||||
for (i = 16 - padLen; i < 16; i++) {
|
||||
if (block[i] != padLen) {
|
||||
return BAD_DATA;
|
||||
}
|
||||
}
|
||||
bcopy(block, outBuffer, 16 - padLen);
|
||||
break;
|
||||
|
||||
default:
|
||||
return BAD_CIPHER_STATE;
|
||||
}
|
||||
|
||||
return 16*numBlocks - padLen;
|
||||
}
|
||||
|
||||
#ifdef INTERMEDIATE_VALUE_KAT
|
||||
/**
|
||||
* cipherUpdateRounds:
|
||||
*
|
||||
* Encrypts/Decrypts exactly one full block a specified number of rounds.
|
||||
* Only used in the Intermediate Value Known Answer Test.
|
||||
*
|
||||
* Returns:
|
||||
* TRUE - on success
|
||||
* BAD_CIPHER_STATE - cipher in bad state (e.g., not initialized)
|
||||
*/
|
||||
int rijndael_cipherUpdateRounds(cipherInstance *cipher, keyInstance *key,
|
||||
BYTE *input, int inputLen, BYTE *outBuffer, int rounds) {
|
||||
int j;
|
||||
word8 block[4][4];
|
||||
|
||||
if (cipher == NULL || key == NULL) {
|
||||
return BAD_CIPHER_STATE;
|
||||
}
|
||||
|
||||
for (j = 3; j >= 0; j--) {
|
||||
/* parse input stream into rectangular array */
|
||||
*((word32*)block[j]) = *((word32*)(input+4*j));
|
||||
}
|
||||
|
||||
switch (key->direction) {
|
||||
case DIR_ENCRYPT:
|
||||
rijndaelEncryptRound(block, key->keySched, key->ROUNDS, rounds);
|
||||
break;
|
||||
|
||||
case DIR_DECRYPT:
|
||||
rijndaelDecryptRound(block, key->keySched, key->ROUNDS, rounds);
|
||||
break;
|
||||
|
||||
default:
|
||||
return BAD_KEY_DIR;
|
||||
}
|
||||
|
||||
for (j = 3; j >= 0; j--) {
|
||||
/* parse rectangular array into output ciphertext bytes */
|
||||
*((word32*)(outBuffer+4*j)) = *((word32*)block[j]);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif /* INTERMEDIATE_VALUE_KAT */
|
103
crypto/dist/kame/racoon/missing/crypto/rijndael/rijndael-api-fst.h
vendored
Normal file
103
crypto/dist/kame/racoon/missing/crypto/rijndael/rijndael-api-fst.h
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
/* $KAME: rijndael-api-fst.h,v 1.1.1.1 2001/08/08 09:56:27 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* rijndael-api-fst.h v2.3 April '2000
|
||||
*
|
||||
* Optimised ANSI C code
|
||||
*
|
||||
* #define INTERMEDIATE_VALUE_KAT to generate the Intermediate Value Known Answer Test.
|
||||
*/
|
||||
|
||||
#ifndef __RIJNDAEL_API_FST_H
|
||||
#define __RIJNDAEL_API_FST_H
|
||||
|
||||
#include <crypto/rijndael/rijndael-alg-fst.h>
|
||||
|
||||
/* Defines:
|
||||
Add any additional defines you need
|
||||
*/
|
||||
|
||||
#define DIR_ENCRYPT 0 /* Are we encrpyting? */
|
||||
#define DIR_DECRYPT 1 /* Are we decrpyting? */
|
||||
#define MODE_ECB 1 /* Are we ciphering in ECB mode? */
|
||||
#define MODE_CBC 2 /* Are we ciphering in CBC mode? */
|
||||
#define MODE_CFB1 3 /* Are we ciphering in 1-bit CFB mode? */
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#define BITSPERBLOCK 128 /* Default number of bits in a cipher block */
|
||||
|
||||
/* Error Codes - CHANGE POSSIBLE: inclusion of additional error codes */
|
||||
#define BAD_KEY_DIR -1 /* Key direction is invalid, e.g., unknown value */
|
||||
#define BAD_KEY_MAT -2 /* Key material not of correct length */
|
||||
#define BAD_KEY_INSTANCE -3 /* Key passed is not valid */
|
||||
#define BAD_CIPHER_MODE -4 /* Params struct passed to cipherInit invalid */
|
||||
#define BAD_CIPHER_STATE -5 /* Cipher in wrong state (e.g., not initialized) */
|
||||
#define BAD_BLOCK_LENGTH -6
|
||||
#define BAD_CIPHER_INSTANCE -7
|
||||
#define BAD_DATA -8 /* Data contents are invalid, e.g., invalid padding */
|
||||
#define BAD_OTHER -9 /* Unknown error */
|
||||
|
||||
/* CHANGE POSSIBLE: inclusion of algorithm specific defines */
|
||||
#define MAX_KEY_SIZE 64 /* # of ASCII char's needed to represent a key */
|
||||
#define MAX_IV_SIZE 16 /* # bytes needed to represent an IV */
|
||||
|
||||
/* Typedefs:
|
||||
|
||||
Typedef'ed data storage elements. Add any algorithm specific
|
||||
parameters at the bottom of the structs as appropriate.
|
||||
*/
|
||||
|
||||
/* The structure for key information */
|
||||
typedef struct {
|
||||
u_int8_t direction; /* Key used for encrypting or decrypting? */
|
||||
int keyLen; /* Length of the key */
|
||||
char keyMaterial[MAX_KEY_SIZE+1]; /* Raw key data in ASCII, e.g., user input or KAT values */
|
||||
/* The following parameters are algorithm dependent, replace or add as necessary */
|
||||
int ROUNDS; /* key-length-dependent number of rounds */
|
||||
int blockLen; /* block length */
|
||||
union {
|
||||
u_int8_t xkS8[RIJNDAEL_MAXROUNDS+1][4][4]; /* key schedule */
|
||||
u_int32_t xkS32[RIJNDAEL_MAXROUNDS+1][4]; /* key schedule */
|
||||
} xKeySched;
|
||||
#define keySched xKeySched.xkS8
|
||||
} keyInstance;
|
||||
|
||||
/* The structure for cipher information */
|
||||
typedef struct { /* changed order of the components */
|
||||
u_int8_t mode; /* MODE_ECB, MODE_CBC, or MODE_CFB1 */
|
||||
u_int8_t IV[MAX_IV_SIZE]; /* A possible Initialization Vector for ciphering */
|
||||
/* Add any algorithm specific parameters needed here */
|
||||
int blockLen; /* Sample: Handles non-128 bit block sizes (if available) */
|
||||
} cipherInstance;
|
||||
|
||||
/* Function prototypes */
|
||||
/* CHANGED: nothing
|
||||
TODO: implement the following extensions to setup 192-bit and 256-bit block lengths:
|
||||
makeKeyEx(): parameter blockLen added
|
||||
-- this parameter is absolutely necessary if you want to
|
||||
setup the round keys in a variable block length setting
|
||||
cipherInitEx(): parameter blockLen added (for obvious reasons)
|
||||
*/
|
||||
|
||||
int rijndael_makeKey(keyInstance *key, u_int8_t direction, int keyLen, char *keyMaterial);
|
||||
|
||||
int rijndael_cipherInit(cipherInstance *cipher, u_int8_t mode, char *IV);
|
||||
|
||||
int rijndael_blockEncrypt(cipherInstance *cipher, keyInstance *key,
|
||||
u_int8_t *input, int inputLen, u_int8_t *outBuffer);
|
||||
|
||||
int rijndael_padEncrypt(cipherInstance *cipher, keyInstance *key,
|
||||
u_int8_t *input, int inputOctets, u_int8_t *outBuffer);
|
||||
|
||||
int rijndael_blockDecrypt(cipherInstance *cipher, keyInstance *key,
|
||||
u_int8_t *input, int inputLen, u_int8_t *outBuffer);
|
||||
|
||||
int rijndael_padDecrypt(cipherInstance *cipher, keyInstance *key,
|
||||
u_int8_t *input, int inputOctets, u_int8_t *outBuffer);
|
||||
|
||||
#ifdef INTERMEDIATE_VALUE_KAT
|
||||
int rijndael_cipherUpdateRounds(cipherInstance *cipher, keyInstance *key,
|
||||
u_int8_t *input, int inputLen, u_int8_t *outBuffer, int Rounds);
|
||||
#endif /* INTERMEDIATE_VALUE_KAT */
|
||||
|
||||
#endif /* __RIJNDAEL_API_FST_H */
|
3
crypto/dist/kame/racoon/missing/crypto/rijndael/rijndael.h
vendored
Normal file
3
crypto/dist/kame/racoon/missing/crypto/rijndael/rijndael.h
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/* $KAME: rijndael.h,v 1.1.1.1 2001/08/08 09:56:27 sakane Exp $ */
|
||||
|
||||
#include <crypto/rijndael/rijndael-api-fst.h>
|
10
crypto/dist/kame/racoon/missing/crypto/rijndael/rijndael_local.h
vendored
Normal file
10
crypto/dist/kame/racoon/missing/crypto/rijndael/rijndael_local.h
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
/* $KAME: rijndael_local.h,v 1.1.1.1 2001/08/08 09:56:27 sakane Exp $ */
|
||||
|
||||
/* the file should not be used from outside */
|
||||
typedef u_int8_t BYTE;
|
||||
typedef u_int8_t word8;
|
||||
typedef u_int16_t word16;
|
||||
typedef u_int32_t word32;
|
||||
|
||||
#define MAXKC RIJNDAEL_MAXKC
|
||||
#define MAXROUNDS RIJNDAEL_MAXROUNDS
|
1101
crypto/dist/kame/racoon/missing/crypto/sha2/sha2.c
vendored
Normal file
1101
crypto/dist/kame/racoon/missing/crypto/sha2/sha2.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
144
crypto/dist/kame/racoon/missing/crypto/sha2/sha2.h
vendored
Normal file
144
crypto/dist/kame/racoon/missing/crypto/sha2/sha2.h
vendored
Normal file
@ -0,0 +1,144 @@
|
||||
/* $KAME: sha2.h,v 1.2 2001/08/08 22:09:27 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* sha2.h
|
||||
*
|
||||
* Version 1.0.0beta1
|
||||
*
|
||||
* Written by Aaron D. Gifford <me@aarongifford.com>
|
||||
*
|
||||
* Copyright 2000 Aaron D. Gifford. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTOR(S) ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTOR(S) BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __SHA2_H__
|
||||
#define __SHA2_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*** SHA-256/384/512 Various Length Definitions ***********************/
|
||||
#define SHA256_BLOCK_LENGTH 64
|
||||
#define SHA256_DIGEST_LENGTH 32
|
||||
#define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1)
|
||||
#define SHA384_BLOCK_LENGTH 128
|
||||
#define SHA384_DIGEST_LENGTH 48
|
||||
#define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1)
|
||||
#define SHA512_BLOCK_LENGTH 128
|
||||
#define SHA512_DIGEST_LENGTH 64
|
||||
#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
|
||||
|
||||
|
||||
/*** SHA-256/384/512 Context Structures *******************************/
|
||||
/* NOTE: If your architecture does not define either u_intXX_t types or
|
||||
* uintXX_t (from inttypes.h), you may need to define things by hand
|
||||
* for your system:
|
||||
*/
|
||||
#if 0
|
||||
typedef unsigned char u_int8_t; /* 1-byte (8-bits) */
|
||||
typedef unsigned int u_int32_t; /* 4-bytes (32-bits) */
|
||||
typedef unsigned long long u_int64_t; /* 8-bytes (64-bits) */
|
||||
#endif
|
||||
/*
|
||||
* Most BSD systems already define u_intXX_t types, as does Linux.
|
||||
* Some systems, however, like Compaq's Tru64 Unix instead can use
|
||||
* uintXX_t types defined by very recent ANSI C standards and included
|
||||
* in the file:
|
||||
*
|
||||
* #include <inttypes.h>
|
||||
*
|
||||
* If you choose to use <inttypes.h> then please define:
|
||||
*
|
||||
* #define SHA2_USE_INTTYPES_H
|
||||
*
|
||||
* Or on the command line during compile:
|
||||
*
|
||||
* cc -DSHA2_USE_INTTYPES_H ...
|
||||
*/
|
||||
#if 0 /*def SHA2_USE_INTTYPES_H*/
|
||||
|
||||
typedef struct _SHA256_CTX {
|
||||
uint32_t state[8];
|
||||
uint64_t bitcount;
|
||||
uint8_t buffer[SHA256_BLOCK_LENGTH];
|
||||
} SHA256_CTX;
|
||||
typedef struct _SHA512_CTX {
|
||||
uint64_t state[8];
|
||||
uint64_t bitcount[2];
|
||||
uint8_t buffer[SHA512_BLOCK_LENGTH];
|
||||
} SHA512_CTX;
|
||||
|
||||
#else /* SHA2_USE_INTTYPES_H */
|
||||
|
||||
typedef struct _SHA256_CTX {
|
||||
u_int32_t state[8];
|
||||
u_int64_t bitcount;
|
||||
u_int8_t buffer[SHA256_BLOCK_LENGTH];
|
||||
} SHA256_CTX;
|
||||
typedef struct _SHA512_CTX {
|
||||
u_int64_t state[8];
|
||||
u_int64_t bitcount[2];
|
||||
u_int8_t buffer[SHA512_BLOCK_LENGTH];
|
||||
} SHA512_CTX;
|
||||
|
||||
#endif /* SHA2_USE_INTTYPES_H */
|
||||
|
||||
typedef SHA512_CTX SHA384_CTX;
|
||||
|
||||
|
||||
/*** SHA-256/384/512 Function Prototypes ******************************/
|
||||
|
||||
void SHA256_Init __P((SHA256_CTX *));
|
||||
void SHA256_Update __P((SHA256_CTX*, const u_int8_t*, size_t));
|
||||
void SHA256_Final __P((u_int8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*));
|
||||
char* SHA256_End __P((SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]));
|
||||
char* SHA256_Data __P((const u_int8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]));
|
||||
|
||||
void SHA384_Init __P((SHA384_CTX*));
|
||||
void SHA384_Update __P((SHA384_CTX*, const u_int8_t*, size_t));
|
||||
void SHA384_Final __P((u_int8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*));
|
||||
char* SHA384_End __P((SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]));
|
||||
char* SHA384_Data __P((const u_int8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]));
|
||||
|
||||
void SHA512_Init __P((SHA512_CTX*));
|
||||
void SHA512_Update __P((SHA512_CTX*, const u_int8_t*, size_t));
|
||||
void SHA512_Final __P((u_int8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*));
|
||||
char* SHA512_End __P((SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]));
|
||||
char* SHA512_Data __P((const u_int8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]));
|
||||
|
||||
struct env_md_st *EVP_sha2_256 __P((void));
|
||||
struct env_md_st *EVP_sha2_384 __P((void));
|
||||
struct env_md_st *EVP_sha2_512 __P((void));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __SHA2_H__ */
|
||||
|
44
crypto/dist/kame/racoon/oakley.h
vendored
44
crypto/dist/kame/racoon/oakley.h
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: oakley.h,v 1.18 2001/04/11 00:28:59 sakane Exp $ */
|
||||
/* $KAME: oakley.h,v 1.27 2001/08/17 10:50:27 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -74,6 +74,10 @@
|
||||
#define OAKLEY_ATTR_GRP_DESC_EC2N155 3
|
||||
#define OAKLEY_ATTR_GRP_DESC_EC2N185 4
|
||||
#define OAKLEY_ATTR_GRP_DESC_MODP1536 5
|
||||
#define OAKLEY_ATTR_GRP_DESC_MODP2048 42048 /* these value are */
|
||||
#define OAKLEY_ATTR_GRP_DESC_MODP3072 43072 /* make consensus */
|
||||
#define OAKLEY_ATTR_GRP_DESC_MODP4096 44096 /* at the bake off */
|
||||
#define OAKLEY_ATTR_GRP_DESC_MODP8192 48192 /* in helsinki */
|
||||
/* 32768 - 65535 Private Use */
|
||||
#define OAKLEY_ATTR_GRP_TYPE 5 /* B */
|
||||
#define OAKLEY_ATTR_GRP_TYPE_MODP 1
|
||||
@ -110,39 +114,8 @@
|
||||
*/
|
||||
#define OAKLEY_ATTR_GSS_ID 16384
|
||||
|
||||
#define OAKLEY_PRIME_MODP768 \
|
||||
"FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1" \
|
||||
"29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD" \
|
||||
"EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245" \
|
||||
"E485B576 625E7EC6 F44C42E9 A63A3620 FFFFFFFF FFFFFFFF"
|
||||
|
||||
#define OAKLEY_PRIME_MODP1024 \
|
||||
"FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1" \
|
||||
"29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD" \
|
||||
"EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245" \
|
||||
"E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED" \
|
||||
"EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE65381" \
|
||||
"FFFFFFFF FFFFFFFF"
|
||||
|
||||
#define OAKLEY_PRIME_MODP1536 \
|
||||
"FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1" \
|
||||
"29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD" \
|
||||
"EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245" \
|
||||
"E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED" \
|
||||
"EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE45B3D" \
|
||||
"C2007CB8 A163BF05 98DA4836 1C55D39A 69163FA8 FD24CF5F" \
|
||||
"83655D23 DCA3AD96 1C62F356 208552BB 9ED52907 7096966D" \
|
||||
"670C354E 4ABC9804 F1746C08 CA237327 FFFFFFFF FFFFFFFF"
|
||||
|
||||
#define MAXPADLWORD 20
|
||||
|
||||
struct cipher_algorithm {
|
||||
char *name;
|
||||
vchar_t *(*encrypt) __P((vchar_t *data, vchar_t *key, caddr_t iv));
|
||||
vchar_t *(*decrypt) __P((vchar_t *data, vchar_t *key, caddr_t iv));
|
||||
int (*weakkey) __P((vchar_t *key));
|
||||
};
|
||||
|
||||
struct dhgroup {
|
||||
int type;
|
||||
vchar_t *prime;
|
||||
@ -153,10 +126,6 @@ struct dhgroup {
|
||||
vchar_t *order;
|
||||
};
|
||||
|
||||
#define MAXDHGROUP 10
|
||||
|
||||
extern struct dhgroup dhgroup[MAXDHGROUP];
|
||||
|
||||
/* certificate holder */
|
||||
typedef struct cert_t_tag {
|
||||
u_int8_t type; /* type of CERT, must be same to pl->v[0]*/
|
||||
@ -170,7 +139,7 @@ struct isakmp_ivm;
|
||||
|
||||
extern int oakley_get_defaultlifetime __P((void));
|
||||
|
||||
extern void oakley_dhinit __P((void));
|
||||
extern int oakley_dhinit __P((void));
|
||||
extern void oakley_dhgrp_free __P((struct dhgroup *));
|
||||
extern int oakley_dh_compute __P((const struct dhgroup *,
|
||||
vchar_t *, vchar_t *, vchar_t *, vchar_t **));
|
||||
@ -219,4 +188,3 @@ extern vchar_t *oakley_do_decrypt __P((struct ph1handle *,
|
||||
vchar_t *, vchar_t *, vchar_t *));
|
||||
extern vchar_t *oakley_do_encrypt __P((struct ph1handle *,
|
||||
vchar_t *, vchar_t *, vchar_t *));
|
||||
extern int oakley_padlen __P((int));
|
||||
|
105
crypto/dist/kame/racoon/pfkey.c
vendored
105
crypto/dist/kame/racoon/pfkey.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: pfkey.c,v 1.123 2001/07/27 10:29:06 sakane Exp $ */
|
||||
/* $KAME: pfkey.c,v 1.128 2001/08/20 06:46:28 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -191,7 +191,7 @@ pfkey_handler()
|
||||
|
||||
plog(LLV_DEBUG, LOCATION, NULL, "get pfkey %s message\n",
|
||||
s_pfkey_type(msg->sadb_msg_type));
|
||||
plogdump(LLV_DEBUG, msg, msg->sadb_msg_len << 3);
|
||||
plogdump(LLV_DEBUG2, msg, msg->sadb_msg_len << 3);
|
||||
|
||||
/* validity check */
|
||||
if (msg->sadb_msg_errno) {
|
||||
@ -610,75 +610,35 @@ static u_int
|
||||
keylen_aalg(hashtype)
|
||||
u_int hashtype;
|
||||
{
|
||||
switch (hashtype) {
|
||||
case IPSECDOI_ATTR_AUTH_HMAC_MD5:
|
||||
return 128;
|
||||
case IPSECDOI_ATTR_AUTH_HMAC_SHA1:
|
||||
return 160;
|
||||
case IPSECDOI_ATTR_AUTH_KPDK: /* need special care */
|
||||
return 0;
|
||||
int res;
|
||||
|
||||
/* not supported */
|
||||
case IPSECDOI_ATTR_AUTH_DES_MAC:
|
||||
plog(LLV_ERROR, LOCATION, NULL,
|
||||
"Not supported hash type: %u\n", hashtype);
|
||||
return ~0;
|
||||
|
||||
case 0: /* reserved */
|
||||
default:
|
||||
if (hashtype == 0)
|
||||
return SADB_AALG_NONE;
|
||||
|
||||
res = alg_ipsec_hmacdef_hashlen(hashtype);
|
||||
if (res == -1) {
|
||||
plog(LLV_ERROR, LOCATION, NULL,
|
||||
"Invalid hash type: %u\n", hashtype);
|
||||
"invalid hmac algorithm %u.\n", hashtype);
|
||||
return ~0;
|
||||
}
|
||||
/*NOTREACHED*/
|
||||
return res;
|
||||
}
|
||||
|
||||
/* default key length for encryption algorithm */
|
||||
static u_int
|
||||
keylen_ealg(t_id, encklen)
|
||||
u_int t_id;
|
||||
keylen_ealg(enctype, encklen)
|
||||
u_int enctype;
|
||||
int encklen;
|
||||
{
|
||||
switch (t_id) {
|
||||
case IPSECDOI_ESP_DES_IV64: /* sa_flags |= SADB_X_EXT_OLD */
|
||||
return 64;
|
||||
case IPSECDOI_ESP_DES:
|
||||
return 64;
|
||||
case IPSECDOI_ESP_3DES:
|
||||
return 192;
|
||||
case IPSECDOI_ESP_RC5:
|
||||
return encklen ? encklen : 128;
|
||||
case IPSECDOI_ESP_CAST:
|
||||
return encklen ? encklen : 128;
|
||||
case IPSECDOI_ESP_BLOWFISH:
|
||||
return encklen ? encklen : 128;
|
||||
case IPSECDOI_ESP_DES_IV32: /* flags |= (SADB_X_EXT_OLD|
|
||||
SADB_X_EXT_IV4B)*/
|
||||
return 64;
|
||||
case IPSECDOI_ESP_NULL:
|
||||
return 0;
|
||||
case IPSECDOI_ESP_RIJNDAEL:
|
||||
return encklen ? encklen : 128;
|
||||
case IPSECDOI_ESP_TWOFISH:
|
||||
return encklen ? encklen : 128;
|
||||
int res;
|
||||
|
||||
/* not supported */
|
||||
case IPSECDOI_ESP_3IDEA:
|
||||
case IPSECDOI_ESP_IDEA:
|
||||
case IPSECDOI_ESP_RC4:
|
||||
res = alg_ipsec_encdef_keylen(enctype, encklen);
|
||||
if (res == -1) {
|
||||
plog(LLV_ERROR, LOCATION, NULL,
|
||||
"Not supported transform: %u\n", t_id);
|
||||
return ~0;
|
||||
|
||||
case 0: /* reserved */
|
||||
default:
|
||||
plog(LLV_ERROR, LOCATION, NULL,
|
||||
"Invalid transform id: %u\n", t_id);
|
||||
"invalid encryption algorithm %u.\n", enctype);
|
||||
return ~0;
|
||||
}
|
||||
/*NOTREACHED*/
|
||||
return res;
|
||||
}
|
||||
|
||||
int
|
||||
@ -956,6 +916,7 @@ pk_sendupdate(iph2)
|
||||
struct sockaddr *src = NULL, *dst = NULL;
|
||||
int e_type, e_keylen, a_type, a_keylen, flags;
|
||||
u_int satype, mode;
|
||||
u_int64_t lifebyte = 0;
|
||||
|
||||
/* sanity check */
|
||||
if (iph2->approval == NULL) {
|
||||
@ -1001,6 +962,12 @@ pk_sendupdate(iph2)
|
||||
&a_type, &a_keylen, &flags) < 0)
|
||||
return -1;
|
||||
|
||||
#if 0
|
||||
lifebyte = iph2->approval->lifebyte * 1024,
|
||||
#else
|
||||
lifebyte = 0;
|
||||
#endif
|
||||
|
||||
plog(LLV_DEBUG, LOCATION, NULL, "call pfkey_send_update\n");
|
||||
|
||||
if (pfkey_send_update(
|
||||
@ -1014,8 +981,7 @@ pk_sendupdate(iph2)
|
||||
4, /* XXX static size of window */
|
||||
pr->keymat->v,
|
||||
e_type, e_keylen, a_type, a_keylen, flags,
|
||||
0, iph2->approval->lifebyte * 1024,
|
||||
iph2->approval->lifetime, 0,
|
||||
0, lifebyte, iph2->approval->lifetime, 0,
|
||||
iph2->seq) < 0) {
|
||||
plog(LLV_ERROR, LOCATION, NULL,
|
||||
"libipsec failed send update (%s)\n",
|
||||
@ -1191,6 +1157,7 @@ pk_sendadd(iph2)
|
||||
struct sockaddr *src = NULL, *dst = NULL;
|
||||
int e_type, e_keylen, a_type, a_keylen, flags;
|
||||
u_int satype, mode;
|
||||
u_int64_t lifebyte = 0;
|
||||
|
||||
/* sanity check */
|
||||
if (iph2->approval == NULL) {
|
||||
@ -1236,6 +1203,12 @@ pk_sendadd(iph2)
|
||||
&a_type, &a_keylen, &flags) < 0)
|
||||
return -1;
|
||||
|
||||
#if 0
|
||||
lifebyte = iph2->approval->lifebyte * 1024,
|
||||
#else
|
||||
lifebyte = 0;
|
||||
#endif
|
||||
|
||||
plog(LLV_DEBUG, LOCATION, NULL, "call pfkey_send_add\n");
|
||||
|
||||
if (pfkey_send_add(
|
||||
@ -1249,8 +1222,7 @@ pk_sendadd(iph2)
|
||||
4, /* XXX static size of window */
|
||||
pr->keymat_p->v,
|
||||
e_type, e_keylen, a_type, a_keylen, flags,
|
||||
0, iph2->approval->lifebyte * 1024,
|
||||
iph2->approval->lifetime, 0,
|
||||
0, lifebyte, iph2->approval->lifetime, 0,
|
||||
iph2->seq) < 0) {
|
||||
plog(LLV_ERROR, LOCATION, NULL,
|
||||
"libipsec failed send add (%s)\n",
|
||||
@ -2255,8 +2227,9 @@ pk_checkalg(class, calg, keylen)
|
||||
sup = SADB_EXT_SUPPORTED_AUTH;
|
||||
break;
|
||||
case IPSECDOI_PROTO_IPCOMP:
|
||||
plog(LLV_WARNING, LOCATION, NULL,
|
||||
"compression algorithm can not be checked.\n");
|
||||
plog(LLV_DEBUG, LOCATION, NULL,
|
||||
"compression algorithm can not be checked "
|
||||
"because sadb message doesn't support it.\n");
|
||||
return 0;
|
||||
default:
|
||||
plog(LLV_ERROR, LOCATION, NULL,
|
||||
@ -2537,18 +2510,24 @@ sadbsecas2str(src, dst, proto, spi, mode)
|
||||
s_ipsecdoi_proto(doi_proto),
|
||||
mode ? "/" : "",
|
||||
mode ? s_ipsecdoi_encmode(doi_mode) : "");
|
||||
if (i < 0 || i >= blen)
|
||||
return NULL;
|
||||
p += i;
|
||||
blen -= i;
|
||||
|
||||
i = snprintf(p, blen, "%s->", saddrwop2str(src));
|
||||
if (i < 0 || i >= blen)
|
||||
return NULL;
|
||||
p += i;
|
||||
blen -= i;
|
||||
|
||||
i = snprintf(p, blen, "%s ", saddrwop2str(dst));
|
||||
if (i < 0 || i >= blen)
|
||||
return NULL;
|
||||
p += i;
|
||||
blen -= i;
|
||||
|
||||
if (spi) {
|
||||
p += i;
|
||||
blen -= i;
|
||||
snprintf(p, blen, "spi=%lu(0x%lx)", (unsigned long)ntohl(spi),
|
||||
(unsigned long)ntohl(spi));
|
||||
}
|
||||
|
11
crypto/dist/kame/racoon/plog.c
vendored
11
crypto/dist/kame/racoon/plog.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: plog.c,v 1.17 2001/06/01 08:26:05 sakane Exp $ */
|
||||
/* $KAME: plog.c,v 1.18 2001/08/20 06:46:28 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -107,11 +107,14 @@ plog_common(pri, fmt, func)
|
||||
|
||||
if (pri < ARRAYLEN(ptab)) {
|
||||
len = snprintf(p, reslen, "%s: ", ptab[pri].name);
|
||||
p += len;
|
||||
reslen -= len;
|
||||
if (len >= 0 && len < reslen) {
|
||||
p += len;
|
||||
reslen -= len;
|
||||
} else
|
||||
*p = '\0';
|
||||
}
|
||||
|
||||
len = snprintf(p, reslen, "%s: %s", func, fmt);
|
||||
snprintf(p, reslen, "%s: %s", func, fmt);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
10
crypto/dist/kame/racoon/policy.c
vendored
10
crypto/dist/kame/racoon/policy.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: policy.c,v 1.40 2001/06/27 15:55:57 sakane Exp $ */
|
||||
/* $KAME: policy.c,v 1.42 2001/08/20 06:46:28 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -413,7 +413,7 @@ spidx2str(spidx)
|
||||
blen = sizeof(buf) - 1;
|
||||
p = buf;
|
||||
|
||||
a = saddr2str((struct sockaddr *)&spidx->src);
|
||||
a = saddr2str((const struct sockaddr *)&spidx->src);
|
||||
for (b = a; *b != '\0'; b++)
|
||||
if (*b == '[') {
|
||||
*b = '\0';
|
||||
@ -421,10 +421,12 @@ spidx2str(spidx)
|
||||
break;
|
||||
}
|
||||
i = snprintf(p, blen, "%s/%d[%s ", a, spidx->prefs, b);
|
||||
if (i < 0 || i >= blen)
|
||||
return NULL;
|
||||
p += i;
|
||||
blen -= i;
|
||||
|
||||
a = saddr2str((struct sockaddr *)&spidx->dst);
|
||||
a = saddr2str((const struct sockaddr *)&spidx->dst);
|
||||
for (b = a; *b != '\0'; b++)
|
||||
if (*b == '[') {
|
||||
*b = '\0';
|
||||
@ -432,6 +434,8 @@ spidx2str(spidx)
|
||||
break;
|
||||
}
|
||||
i = snprintf(p, blen, "%s/%d[%s ", a, spidx->prefd, b);
|
||||
if (i < 0 || i >= blen)
|
||||
return NULL;
|
||||
p += i;
|
||||
blen -= i;
|
||||
|
||||
|
12
crypto/dist/kame/racoon/proposal.c
vendored
12
crypto/dist/kame/racoon/proposal.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: proposal.c,v 1.34 2001/07/10 04:07:03 sakane Exp $ */
|
||||
/* $KAME: proposal.c,v 1.37 2001/08/16 11:18:02 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -705,6 +705,16 @@ aproppair2saprop(p0)
|
||||
inssatrns(newpr, newtr);
|
||||
}
|
||||
|
||||
/*
|
||||
* If the peer does not specify encryption mode, use
|
||||
* transport mode by default. This is to conform to
|
||||
* draft-shacham-ippcp-rfc2393bis-08.txt (explicitly specifies
|
||||
* that unspecified == transport), as well as RFC2407
|
||||
* (unspecified == implementation dependent default).
|
||||
*/
|
||||
if (newpr->encmode == 0)
|
||||
newpr->encmode = IPSECDOI_ATTR_ENC_MODE_TRNS;
|
||||
|
||||
inssaproto(newpp, newpr);
|
||||
}
|
||||
|
||||
|
3
crypto/dist/kame/racoon/proposal.h
vendored
3
crypto/dist/kame/racoon/proposal.h
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: proposal.h,v 1.15 2001/04/06 14:23:48 sakane Exp $ */
|
||||
/* $KAME: proposal.h,v 1.16 2001/08/16 05:02:13 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -79,7 +79,6 @@ struct saproto {
|
||||
int reqid_out; /* request id (outbound) */
|
||||
int reqid_in; /* request id (inbound) */
|
||||
|
||||
int len; /* length, in bits */
|
||||
int ok; /* if 1, success to set SA in kenrel */
|
||||
|
||||
struct satrns *head; /* header of transform */
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $KAME: racoon.conf.in,v 1.16 2000/12/17 21:17:53 sakane Exp $
|
||||
# $KAME: racoon.conf.in,v 1.18 2001/08/16 06:33:40 itojun Exp $
|
||||
|
||||
# "path" must be placed before it should be used.
|
||||
# You can overwrite which you defined, but it should not use due to confusing.
|
||||
@ -62,7 +62,6 @@ remote anonymous
|
||||
|
||||
nonce_size 16;
|
||||
lifetime time 1 min; # sec,min,hour
|
||||
lifetime byte 5 MB; # B,KB,GB
|
||||
initial_contact on;
|
||||
support_mip6 on;
|
||||
proposal_check obey; # obey, strict or claim
|
||||
@ -88,7 +87,6 @@ remote ::1 [8000]
|
||||
|
||||
nonce_size 16;
|
||||
lifetime time 1 min; # sec,min,hour
|
||||
lifetime byte 5 MB; # B,KB,GB
|
||||
|
||||
proposal {
|
||||
encryption_algorithm 3des;
|
||||
@ -102,7 +100,6 @@ sainfo anonymous
|
||||
{
|
||||
pfs_group 1;
|
||||
lifetime time 30 sec;
|
||||
lifetime byte 5000 KB;
|
||||
encryption_algorithm 3des ;
|
||||
authentication_algorithm hmac_sha1;
|
||||
compression_algorithm deflate ;
|
||||
@ -112,7 +109,6 @@ sainfo address 203.178.141.209 any address 203.178.141.218 any
|
||||
{
|
||||
pfs_group 1;
|
||||
lifetime time 30 sec;
|
||||
lifetime byte 5000 KB;
|
||||
encryption_algorithm des ;
|
||||
authentication_algorithm hmac_md5;
|
||||
compression_algorithm deflate ;
|
||||
@ -122,8 +118,7 @@ sainfo address ::1 icmp6 address ::1 icmp6
|
||||
{
|
||||
pfs_group 1;
|
||||
lifetime time 60 sec;
|
||||
lifetime byte 5000 KB;
|
||||
encryption_algorithm 3des, cast128, blowfish, des ;
|
||||
encryption_algorithm 3des, cast128, blowfish 448, des ;
|
||||
authentication_algorithm hmac_sha1, hmac_md5 ;
|
||||
compression_algorithm deflate ;
|
||||
}
|
||||
|
4
crypto/dist/kame/racoon/session.c
vendored
4
crypto/dist/kame/racoon/session.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: session.c,v 1.24 2001/01/31 05:38:44 sakane Exp $ */
|
||||
/* $KAME: session.c,v 1.26 2001/08/13 10:50:42 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -177,7 +177,7 @@ close_session()
|
||||
close_sockets();
|
||||
backupsa_clean();
|
||||
|
||||
plog(LLV_INFO, LOCATION, NULL, "racoon shutdown");
|
||||
plog(LLV_INFO, LOCATION, NULL, "racoon shutdown\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
7
crypto/dist/kame/racoon/sockmisc.c
vendored
7
crypto/dist/kame/racoon/sockmisc.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: sockmisc.c,v 1.28 2001/04/03 15:51:57 thorpej Exp $ */
|
||||
/* $KAME: sockmisc.c,v 1.29 2001/08/16 14:37:29 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -563,7 +563,8 @@ setsockopt_bypass(so, family)
|
||||
int so, family;
|
||||
{
|
||||
int level;
|
||||
char *buf, *policy;
|
||||
char *buf;
|
||||
char *policy;
|
||||
|
||||
switch (family) {
|
||||
case AF_INET:
|
||||
@ -658,7 +659,7 @@ dupsaddr(src)
|
||||
|
||||
char *
|
||||
saddr2str(saddr)
|
||||
struct sockaddr *saddr;
|
||||
const struct sockaddr *saddr;
|
||||
{
|
||||
static char buf[NI_MAXHOST + NI_MAXSERV + 10];
|
||||
char addr[NI_MAXHOST], port[NI_MAXSERV];
|
||||
|
4
crypto/dist/kame/racoon/sockmisc.h
vendored
4
crypto/dist/kame/racoon/sockmisc.h
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: sockmisc.h,v 1.10 2001/03/23 01:19:08 sakane Exp $ */
|
||||
/* $KAME: sockmisc.h,v 1.11 2001/08/16 14:37:29 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -46,7 +46,7 @@ extern int setsockopt_bypass __P((int, int));
|
||||
|
||||
extern struct sockaddr *newsaddr __P((int));
|
||||
extern struct sockaddr *dupsaddr __P((struct sockaddr *));
|
||||
extern char *saddr2str __P((struct sockaddr *));
|
||||
extern char *saddr2str __P((const struct sockaddr *));
|
||||
extern char *saddrwop2str __P((struct sockaddr *));
|
||||
extern struct sockaddr *str2saddr __P((char *, char *));
|
||||
extern void mask_sockaddr __P((struct sockaddr *, const struct sockaddr *,
|
||||
|
15
crypto/dist/kame/racoon/stats.pl
vendored
Normal file
15
crypto/dist/kame/racoon/stats.pl
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/perl
|
||||
# usage:
|
||||
# % cat /var/log/racoon-stats.log | perl stats.pl
|
||||
|
||||
while(<STDIN>) {
|
||||
chomp;
|
||||
($a, $a, $a, $a, $a, $b) = split(/\s+/, $_, 6);
|
||||
($a, $c) = split(/:/, $b, 2);
|
||||
$r{$a} += $c;
|
||||
$t{$a}++;
|
||||
}
|
||||
|
||||
foreach (sort keys %t) {
|
||||
printf "%s: total=%d avg=%8.6f\n", $_, $t{$_}, $r{$_}/$t{$_};
|
||||
}
|
8
crypto/dist/kame/racoon/str2val.c
vendored
8
crypto/dist/kame/racoon/str2val.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: str2val.c,v 1.10 2001/04/03 15:51:57 thorpej Exp $ */
|
||||
/* $KAME: str2val.c,v 1.11 2001/08/16 14:37:29 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -72,7 +72,7 @@ val2str(buf, mlen)
|
||||
*/
|
||||
char *
|
||||
str2val(str, base, len)
|
||||
char *str;
|
||||
const char *str;
|
||||
int base;
|
||||
size_t *len;
|
||||
{
|
||||
@ -80,7 +80,8 @@ str2val(str, base, len)
|
||||
size_t i;
|
||||
char *dst;
|
||||
char *rp;
|
||||
char *p, b[3];
|
||||
const char *p;
|
||||
char b[3];
|
||||
|
||||
i = 0;
|
||||
for (p = str; *p != '\0'; p++) {
|
||||
@ -119,4 +120,3 @@ str2val(str, base, len)
|
||||
|
||||
return(dst);
|
||||
}
|
||||
|
||||
|
4
crypto/dist/kame/racoon/str2val.h
vendored
4
crypto/dist/kame/racoon/str2val.h
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: str2val.h,v 1.5 2000/10/04 17:41:04 itojun Exp $ */
|
||||
/* $KAME: str2val.h,v 1.6 2001/08/16 14:37:29 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -30,4 +30,4 @@
|
||||
*/
|
||||
|
||||
extern caddr_t val2str __P((const char *, size_t));
|
||||
extern char *str2val __P((char *, int, size_t *));
|
||||
extern char *str2val __P((const char *, int, size_t *));
|
||||
|
24
crypto/dist/kame/racoon/strnames.c
vendored
24
crypto/dist/kame/racoon/strnames.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: strnames.c,v 1.19 2001/07/31 09:17:11 itojun Exp $ */
|
||||
/* $KAME: strnames.c,v 1.21 2001/08/14 14:55:27 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -620,6 +620,10 @@ static struct ksmap name_attr_isakmp_desc[] = {
|
||||
{ OAKLEY_ATTR_GRP_DESC_EC2N155, "EC2N group on GP[2^155]", NULL },
|
||||
{ OAKLEY_ATTR_GRP_DESC_EC2N185, "EC2N group on GP[2^185]", NULL },
|
||||
{ OAKLEY_ATTR_GRP_DESC_MODP1536, "1536-bit MODP group", NULL },
|
||||
{ OAKLEY_ATTR_GRP_DESC_MODP2048, "2048-bit MODP group", NULL },
|
||||
{ OAKLEY_ATTR_GRP_DESC_MODP3072, "3072-bit MODP group", NULL },
|
||||
{ OAKLEY_ATTR_GRP_DESC_MODP4096, "4096-bit MODP group", NULL },
|
||||
{ OAKLEY_ATTR_GRP_DESC_MODP8192, "8192-bit MODP group", NULL },
|
||||
};
|
||||
|
||||
char *
|
||||
@ -696,24 +700,6 @@ s_ipsec_level(k)
|
||||
return num2str(k);
|
||||
}
|
||||
|
||||
/* algorithm.h */
|
||||
static struct ksmap name_algstrength[] = {
|
||||
{ algstrength_ehigh, "extra high", NULL },
|
||||
{ algstrength_high, "high", NULL },
|
||||
{ algstrength_normal, "normal", NULL },
|
||||
};
|
||||
|
||||
char *
|
||||
s_algstrength(k)
|
||||
int k;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < ARRAYLEN(name_algstrength); i++)
|
||||
if (name_algstrength[i].key == k)
|
||||
return name_algstrength[i].str;
|
||||
return num2str(k);
|
||||
}
|
||||
|
||||
static struct ksmap name_algclass[] = {
|
||||
{ algclass_ipsec_enc, "ipsec enc", s_ipsecdoi_trns_esp },
|
||||
{ algclass_ipsec_auth, "ipsec auth", s_ipsecdoi_trns_ah },
|
||||
|
3
crypto/dist/kame/racoon/strnames.h
vendored
3
crypto/dist/kame/racoon/strnames.h
vendored
@ -1,4 +1,4 @@
|
||||
/* $KAME: strnames.h,v 1.11 2001/07/14 14:06:40 sakane Exp $ */
|
||||
/* $KAME: strnames.h,v 1.12 2001/08/09 07:32:19 sakane Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -55,7 +55,6 @@ extern char *s_attr_isakmp_group __P((int));
|
||||
extern char *s_attr_isakmp_ltype __P((int));
|
||||
extern char *s_oakley_attr_v __P((int, int));
|
||||
extern char *s_ipsec_level __P((int));
|
||||
extern char *s_algstrength __P((int));
|
||||
extern char *s_algclass __P((int));
|
||||
extern char *s_algtype __P((int, int));
|
||||
extern char *s_pfkey_type __P((int));
|
||||
|
Loading…
Reference in New Issue
Block a user