mirror of
https://github.com/clearml/dropbear
synced 2025-06-26 18:17:32 +00:00
merge from main
--HG-- branch : fuzz
This commit is contained in:
43
.travis.yml
43
.travis.yml
@@ -1,25 +1,25 @@
|
||||
language: c
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
git:
|
||||
depth: 3
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- BUNDLEDLIBTOM=--disable-bundled-libtom WEXTRAFLAGS=-Werror
|
||||
- BUNDLEDLIBTOM=--enable-bundled-libtom
|
||||
- MULTI=1
|
||||
- NOWRITEV=1
|
||||
|
||||
# TODO: remove this section when libtomcrypt compiles on OSX: https://github.com/libtom/libtomcrypt/issues/82
|
||||
matrix:
|
||||
exclude:
|
||||
include:
|
||||
# subsequent matrix options use these first settings
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: WEXTRAFLAGS=-Werror
|
||||
- env: MULTI=1 WEXTRAFLAGS=-Werror
|
||||
# libtom has some warnings, so no WEXTRAFLAGS
|
||||
- env: BUNDLEDLIBTOM=--enable-bundled-libtom WEXTRAFLAGS=""
|
||||
- env: NOWRITEV=1 WEXTRAFLAGS=-Werror
|
||||
# libtomcrypt 1.18.1 fixes clang problems, distro doesn't have that yet
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: BUNDLEDLIBTOM=--enable-bundled-libtom WEXTRAFLAGS=""
|
||||
- os: osx
|
||||
env: BUNDLEDLIBTOM=--disable-bundled-libtom WEXTRAFLAGS=-Werror
|
||||
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
compiler: clang
|
||||
env: WEXTRAFLAGS=""
|
||||
|
||||
# container-based builds
|
||||
sudo: false
|
||||
@@ -35,9 +35,6 @@ addons:
|
||||
before_install:
|
||||
- if [ "$CC" = "clang" ]; then WEXTRAFLAGS="$WEXTRAFLAGS -Wno-error=incompatible-library-redeclaration" ; fi # workaround
|
||||
|
||||
install:
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" -a "$BUNDLEDLIBTOM" = "--disable-bundled-libtom" ]; then brew update > /dev/null && brew install libtomcrypt libtommath ; fi
|
||||
|
||||
script:
|
||||
- autoconf && autoheader && ./configure "$BUNDLEDLIBTOM" CFLAGS="-O2 -Wall -Wno-pointer-sign $WEXTRAFLAGS" --prefix="$HOME/inst"
|
||||
- if [ "$NOWRITEV" = "1" ]; then sed -i -e s/HAVE_WRITEV/DONT_HAVE_WRITEV/ config.h ; fi
|
||||
@@ -51,3 +48,9 @@ after_success:
|
||||
- ~/inst/bin/dropbearkey -t ecdsa -f testec256 -s 256
|
||||
- ~/inst/bin/dropbearkey -t ecdsa -f testec384 -s 384
|
||||
- ~/inst/bin/dropbearkey -t ecdsa -f testec521 -s 521
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- coverity
|
||||
|
||||
|
||||
24
INSTALL
24
INSTALL
@@ -1,20 +1,26 @@
|
||||
Basic Dropbear build instructions:
|
||||
|
||||
- Edit options.h to set which features you want.
|
||||
- Edit debug.h if you want any debug options (not usually required).
|
||||
- Edit localoptions.h to set which features you want. Available options
|
||||
are described in default_options.h.in, these will be overridden by
|
||||
anything set in localoptions.h
|
||||
|
||||
(If using a non-tarball copy, "autoconf; autoheader")
|
||||
- If using a Mercurial or Git checkout, "autoconf; autoheader"
|
||||
|
||||
./configure (optionally with --disable-zlib or --disable-syslog,
|
||||
- Configure for your system:
|
||||
./configure (optionally with --disable-zlib or --disable-syslog,
|
||||
or --help for other options)
|
||||
|
||||
Now compile:
|
||||
- Compile:
|
||||
|
||||
make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
|
||||
make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
|
||||
|
||||
And install (/usr/local/bin is usual default):
|
||||
- Optionally install, or copy the binaries another way
|
||||
|
||||
make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" install
|
||||
make install (/usr/local/bin is usual default):
|
||||
|
||||
or
|
||||
|
||||
make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" install
|
||||
|
||||
(you can leave items out of the PROGRAMS list to avoid compiling them. If you
|
||||
recompile after changing the PROGRAMS list, you *MUST* "make clean" before
|
||||
@@ -25,7 +31,7 @@ See MULTI for instructions on making all-in-one binaries.
|
||||
If you want to compile statically use ./configure --enable-static
|
||||
|
||||
By default Dropbear adds various build flags that improve robustness
|
||||
against programming bugs (good for security) - if these cause problems
|
||||
against programming bugs (good for security). If these cause problems
|
||||
they can be disabled with ./configure --disable-harden
|
||||
|
||||
Binaries can be stripped with "make strip"
|
||||
|
||||
26
Makefile.in
26
Makefile.in
@@ -25,6 +25,7 @@ endif
|
||||
|
||||
ifneq ($(wildcard localoptions.h),)
|
||||
CFLAGS+=-DLOCALOPTIONS_H_EXISTS
|
||||
LOCALOPTIONS_H=localoptions.h
|
||||
endif
|
||||
|
||||
COMMONOBJS=dbutil.o buffer.o dbhelpers.o \
|
||||
@@ -61,13 +62,6 @@ ifeq (@DROPBEAR_FUZZ@, 1)
|
||||
COMMONOBJS += fuzz-common.o fuzz-wrapfd.o
|
||||
endif
|
||||
|
||||
HEADERS=options.h dbutil.h session.h packet.h algo.h ssh.h buffer.h kex.h \
|
||||
dss.h bignum.h signkey.h rsa.h dbrandom.h service.h auth.h \
|
||||
debug.h channel.h chansession.h config.h queue.h sshpty.h \
|
||||
termcodes.h gendss.h genrsa.h runopts.h includes.h \
|
||||
loginrec.h atomicio.h x11fwd.h agentfwd.h tcpfwd.h compat.h \
|
||||
listener.h fake-rfc2553.h ecc.h ecdsa.h
|
||||
|
||||
dropbearobjs=$(COMMONOBJS) $(CLISVROBJS) $(SVROBJS)
|
||||
dbclientobjs=$(COMMONOBJS) $(CLISVROBJS) $(CLIOBJS)
|
||||
dropbearkeyobjs=$(COMMONOBJS) $(KEYOBJS)
|
||||
@@ -102,7 +96,6 @@ STATIC=@STATIC@
|
||||
|
||||
# whether we're building client, server, or both for the common objects.
|
||||
# evilness so we detect 'dropbear' by itself as a word
|
||||
space:= $(empty) $(empty)
|
||||
ifneq (,$(strip $(foreach prog, $(PROGRAMS), $(findstring ZdropbearZ, Z$(prog)Z))))
|
||||
CFLAGS+= -DDROPBEAR_SERVER
|
||||
endif
|
||||
@@ -133,6 +126,10 @@ endif
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
# a bit lazy, but safer
|
||||
HEADERS=$(wildcard $(srcdir)/*.h *.h)
|
||||
*.o: $(HEADERS)
|
||||
|
||||
strip: $(TARGETS)
|
||||
$(STRIP) $(addsuffix $(EXEEXT), $(TARGETS))
|
||||
|
||||
@@ -205,10 +202,10 @@ link%:
|
||||
-rm -f $*$(EXEEXT)
|
||||
-ln -s dropbearmulti$(EXEEXT) $*$(EXEEXT)
|
||||
|
||||
$(STATIC_LTC): options.h
|
||||
$(STATIC_LTC):
|
||||
$(MAKE) -C libtomcrypt
|
||||
|
||||
$(STATIC_LTM): options.h
|
||||
$(STATIC_LTM):
|
||||
$(MAKE) -C libtommath
|
||||
|
||||
.PHONY : clean sizes thisclean distclean tidy ltc-clean ltm-clean
|
||||
@@ -239,10 +236,10 @@ tidy:
|
||||
# default_options.h is stored in version control, could not find a workaround
|
||||
# for parallel "make -j" and dependency rules.
|
||||
default_options.h: default_options.h.in
|
||||
echo "# > > > Generated from $^, edit that file instead !" > $@.tmp
|
||||
echo >> $@.tmp
|
||||
$(srcdir)/ifndef_wrapper.sh < $^ > $@.tmp
|
||||
mv $@.tmp $@
|
||||
@echo Creating $@
|
||||
@echo "/*\n > > > Do not edit this file (default_options.h) < < <\nGenerated from "$^"\nLocal customisation goes in localoptions.h\n*/\n\n" > $@.tmp
|
||||
@$(srcdir)/ifndef_wrapper.sh < $^ >> $@.tmp
|
||||
@mv $@.tmp $@
|
||||
|
||||
## Fuzzing targets
|
||||
|
||||
@@ -293,4 +290,3 @@ fuzz-hostkeys:
|
||||
/usr/bin/xxd -i -a keyr >> hostkeys.c
|
||||
/usr/bin/xxd -i -a keye >> hostkeys.c
|
||||
/usr/bin/xxd -i -a keyd >> hostkeys.c
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
/* client functions */
|
||||
void cli_load_agent_keys(m_list * ret_list);
|
||||
void agent_buf_sign(buffer *sigblob, sign_key *key,
|
||||
buffer *data_buf);
|
||||
void cli_setup_agent(struct Channel *channel);
|
||||
const buffer *data_buf);
|
||||
void cli_setup_agent(const struct Channel *channel);
|
||||
|
||||
#ifdef __hpux
|
||||
#define seteuid(a) setresuid(-1, (a), -1)
|
||||
@@ -56,7 +56,7 @@ extern const struct ChanType cli_chan_agent;
|
||||
|
||||
int svr_agentreq(struct ChanSess * chansess);
|
||||
void svr_agentcleanup(struct ChanSess * chansess);
|
||||
void svr_agentset(struct ChanSess *chansess);
|
||||
void svr_agentset(const struct ChanSess *chansess);
|
||||
|
||||
#endif /* DROPBEAR_SVR_AGENTFWD */
|
||||
|
||||
|
||||
6
algo.h
6
algo.h
@@ -112,8 +112,8 @@ struct dropbear_kex {
|
||||
const struct ltc_hash_descriptor *hash_desc;
|
||||
};
|
||||
|
||||
int have_algo(char* algo, size_t algolen, algo_type algos[]);
|
||||
void buf_put_algolist(buffer * buf, algo_type localalgos[]);
|
||||
int have_algo(const char* algo, size_t algolen, const algo_type algos[]);
|
||||
void buf_put_algolist(buffer * buf, const algo_type localalgos[]);
|
||||
|
||||
enum kexguess2_used {
|
||||
KEXGUESS2_LOOK,
|
||||
@@ -131,7 +131,7 @@ algo_type * buf_match_algo(buffer* buf, algo_type localalgos[],
|
||||
#if DROPBEAR_USER_ALGO_LIST
|
||||
int check_user_algos(const char* user_algo_list, algo_type * algos,
|
||||
const char *algo_desc);
|
||||
char * algolist_string(algo_type algos[]);
|
||||
char * algolist_string(const algo_type algos[]);
|
||||
#endif
|
||||
|
||||
enum {
|
||||
|
||||
4
auth.h
4
auth.h
@@ -36,7 +36,7 @@ void cli_authinitialise(void);
|
||||
void recv_msg_userauth_request(void);
|
||||
void send_msg_userauth_failure(int partial, int incrfail);
|
||||
void send_msg_userauth_success(void);
|
||||
void send_msg_userauth_banner(buffer *msg);
|
||||
void send_msg_userauth_banner(const buffer *msg);
|
||||
void svr_auth_password(void);
|
||||
void svr_auth_pubkey(void);
|
||||
void svr_auth_pam(void);
|
||||
@@ -74,7 +74,7 @@ void cli_pubkeyfail(void);
|
||||
void cli_auth_password(void);
|
||||
int cli_auth_pubkey(void);
|
||||
void cli_auth_interactive(void);
|
||||
char* getpass_or_cancel(char* prompt);
|
||||
char* getpass_or_cancel(const char* prompt);
|
||||
void cli_auth_pubkey_cleanup(void);
|
||||
|
||||
|
||||
|
||||
8
buffer.c
8
buffer.c
@@ -67,7 +67,7 @@ void buf_free(buffer* buf) {
|
||||
}
|
||||
|
||||
/* overwrite the contents of the buffer to clear it */
|
||||
void buf_burn(buffer* buf) {
|
||||
void buf_burn(const buffer* buf) {
|
||||
|
||||
m_burn(buf->data, buf->size);
|
||||
|
||||
@@ -91,7 +91,7 @@ buffer* buf_resize(buffer *buf, unsigned int newsize) {
|
||||
|
||||
/* Create a copy of buf, allocating required memory etc. */
|
||||
/* The new buffer is sized the same as the length of the source buffer. */
|
||||
buffer* buf_newcopy(buffer* buf) {
|
||||
buffer* buf_newcopy(const buffer* buf) {
|
||||
|
||||
buffer* ret;
|
||||
|
||||
@@ -184,7 +184,7 @@ void buf_putbyte(buffer* buf, unsigned char val) {
|
||||
|
||||
/* returns an in-place pointer to the buffer, checking that
|
||||
* the next len bytes from that position can be used */
|
||||
unsigned char* buf_getptr(buffer* buf, unsigned int len) {
|
||||
unsigned char* buf_getptr(const buffer* buf, unsigned int len) {
|
||||
|
||||
if (len > BUF_MAX_INCR || buf->pos + len > buf->len) {
|
||||
dropbear_exit("Bad buf_getptr");
|
||||
@@ -194,7 +194,7 @@ unsigned char* buf_getptr(buffer* buf, unsigned int len) {
|
||||
|
||||
/* like buf_getptr, but checks against total size, not used length.
|
||||
* This allows writing past the used length, but not past the size */
|
||||
unsigned char* buf_getwriteptr(buffer* buf, unsigned int len) {
|
||||
unsigned char* buf_getwriteptr(const buffer* buf, unsigned int len) {
|
||||
|
||||
if (len > BUF_MAX_INCR || buf->pos + len > buf->size) {
|
||||
dropbear_exit("Bad buf_getwriteptr");
|
||||
|
||||
8
buffer.h
8
buffer.h
@@ -44,8 +44,8 @@ buffer * buf_new(unsigned int size);
|
||||
/* Possibly returns a new buffer*, like realloc() */
|
||||
buffer * buf_resize(buffer *buf, unsigned int newsize);
|
||||
void buf_free(buffer* buf);
|
||||
void buf_burn(buffer* buf);
|
||||
buffer* buf_newcopy(buffer* buf);
|
||||
void buf_burn(const buffer* buf);
|
||||
buffer* buf_newcopy(const buffer* buf);
|
||||
void buf_setlen(buffer* buf, unsigned int len);
|
||||
void buf_incrlen(buffer* buf, unsigned int incr);
|
||||
void buf_setpos(buffer* buf, unsigned int pos);
|
||||
@@ -54,8 +54,8 @@ void buf_incrwritepos(buffer* buf, unsigned int incr);
|
||||
unsigned char buf_getbyte(buffer* buf);
|
||||
unsigned char buf_getbool(buffer* buf);
|
||||
void buf_putbyte(buffer* buf, unsigned char val);
|
||||
unsigned char* buf_getptr(buffer* buf, unsigned int len);
|
||||
unsigned char* buf_getwriteptr(buffer* buf, unsigned int len);
|
||||
unsigned char* buf_getptr(const buffer* buf, unsigned int len);
|
||||
unsigned char* buf_getwriteptr(const buffer* buf, unsigned int len);
|
||||
char* buf_getstring(buffer* buf, unsigned int *retlen);
|
||||
buffer * buf_getstringbuf(buffer *buf);
|
||||
void buf_eatstring(buffer *buf);
|
||||
|
||||
16
channel.h
16
channel.h
@@ -84,7 +84,7 @@ struct Channel {
|
||||
int flushing;
|
||||
|
||||
/* Used by client chansession to handle ~ escaping, NULL ignored otherwise */
|
||||
void (*read_mangler)(struct Channel*, unsigned char* bytes, int *len);
|
||||
void (*read_mangler)(const struct Channel*, const unsigned char* bytes, int *len);
|
||||
|
||||
const struct ChanType* type;
|
||||
|
||||
@@ -94,11 +94,11 @@ struct Channel {
|
||||
struct ChanType {
|
||||
|
||||
int sepfds; /* Whether this channel has separate pipes for in/out or not */
|
||||
char *name;
|
||||
const char *name;
|
||||
int (*inithandler)(struct Channel*);
|
||||
int (*check_close)(struct Channel*);
|
||||
int (*check_close)(const struct Channel*);
|
||||
void (*reqhandler)(struct Channel*);
|
||||
void (*closehandler)(struct Channel*);
|
||||
void (*closehandler)(const struct Channel*);
|
||||
};
|
||||
|
||||
/* Callback for connect_remote */
|
||||
@@ -107,7 +107,7 @@ void channel_connect_done(int result, int sock, void* user_data, const char* err
|
||||
void chaninitialise(const struct ChanType *chantypes[]);
|
||||
void chancleanup(void);
|
||||
void setchannelfds(fd_set *readfds, fd_set *writefds, int allow_reads);
|
||||
void channelio(fd_set *readfd, fd_set *writefd);
|
||||
void channelio(const fd_set *readfd, const fd_set *writefd);
|
||||
struct Channel* getchannel(void);
|
||||
/* Returns an arbitrary channel that is in a ready state - not
|
||||
being initialised and no EOF in either direction. NULL if none. */
|
||||
@@ -115,8 +115,8 @@ struct Channel* get_any_ready_channel(void);
|
||||
|
||||
void recv_msg_channel_open(void);
|
||||
void recv_msg_channel_request(void);
|
||||
void send_msg_channel_failure(struct Channel *channel);
|
||||
void send_msg_channel_success(struct Channel *channel);
|
||||
void send_msg_channel_failure(const struct Channel *channel);
|
||||
void send_msg_channel_success(const struct Channel *channel);
|
||||
void recv_msg_channel_data(void);
|
||||
void recv_msg_channel_extended_data(void);
|
||||
void recv_msg_channel_window_adjust(void);
|
||||
@@ -135,7 +135,7 @@ int send_msg_channel_open_init(int fd, const struct ChanType *type);
|
||||
void recv_msg_channel_open_confirmation(void);
|
||||
void recv_msg_channel_open_failure(void);
|
||||
#endif
|
||||
void start_send_channel_request(struct Channel *channel, char *type);
|
||||
void start_send_channel_request(const struct Channel *channel, const char *type);
|
||||
|
||||
void send_msg_request_success(void);
|
||||
void send_msg_request_failure(void);
|
||||
|
||||
@@ -94,6 +94,7 @@ void cli_send_netcat_request(void);
|
||||
#endif
|
||||
|
||||
void svr_chansessinitialise(void);
|
||||
void svr_chansess_checksignal(void);
|
||||
extern const struct ChanType svrchansess;
|
||||
|
||||
struct SigMap {
|
||||
|
||||
@@ -56,19 +56,19 @@ void cbuf_free(circbuffer * cbuf) {
|
||||
m_free(cbuf);
|
||||
}
|
||||
|
||||
unsigned int cbuf_getused(circbuffer * cbuf) {
|
||||
unsigned int cbuf_getused(const circbuffer * cbuf) {
|
||||
|
||||
return cbuf->used;
|
||||
|
||||
}
|
||||
|
||||
unsigned int cbuf_getavail(circbuffer * cbuf) {
|
||||
unsigned int cbuf_getavail(const circbuffer * cbuf) {
|
||||
|
||||
return cbuf->size - cbuf->used;
|
||||
|
||||
}
|
||||
|
||||
unsigned int cbuf_writelen(circbuffer *cbuf) {
|
||||
unsigned int cbuf_writelen(const circbuffer *cbuf) {
|
||||
|
||||
dropbear_assert(cbuf->used <= cbuf->size);
|
||||
dropbear_assert(((2*cbuf->size)+cbuf->writepos-cbuf->readpos)%cbuf->size == cbuf->used%cbuf->size);
|
||||
@@ -86,7 +86,7 @@ unsigned int cbuf_writelen(circbuffer *cbuf) {
|
||||
return cbuf->size - cbuf->writepos;
|
||||
}
|
||||
|
||||
void cbuf_readptrs(circbuffer *cbuf,
|
||||
void cbuf_readptrs(const circbuffer *cbuf,
|
||||
unsigned char **p1, unsigned int *len1,
|
||||
unsigned char **p2, unsigned int *len2) {
|
||||
*p1 = &cbuf->data[cbuf->readpos];
|
||||
|
||||
@@ -38,12 +38,12 @@ typedef struct circbuf circbuffer;
|
||||
circbuffer * cbuf_new(unsigned int size);
|
||||
void cbuf_free(circbuffer * cbuf);
|
||||
|
||||
unsigned int cbuf_getused(circbuffer * cbuf); /* how much data stored */
|
||||
unsigned int cbuf_getavail(circbuffer * cbuf); /* how much we can write */
|
||||
unsigned int cbuf_writelen(circbuffer *cbuf); /* max linear write len */
|
||||
unsigned int cbuf_getused(const circbuffer * cbuf); /* how much data stored */
|
||||
unsigned int cbuf_getavail(const circbuffer * cbuf); /* how much we can write */
|
||||
unsigned int cbuf_writelen(const circbuffer *cbuf); /* max linear write len */
|
||||
|
||||
/* returns pointers to the two portions of the circular buffer that can be read */
|
||||
void cbuf_readptrs(circbuffer *cbuf,
|
||||
void cbuf_readptrs(const circbuffer *cbuf,
|
||||
unsigned char **p1, unsigned int *len1,
|
||||
unsigned char **p2, unsigned int *len2);
|
||||
unsigned char* cbuf_writeptr(circbuffer *cbuf, unsigned int len);
|
||||
|
||||
@@ -108,7 +108,7 @@ static int new_agent_chan(struct Channel * channel) {
|
||||
data Any data, depending on packet type. Encoding as in the ssh packet
|
||||
protocol.
|
||||
*/
|
||||
static buffer * agent_request(unsigned char type, buffer *data) {
|
||||
static buffer * agent_request(unsigned char type, const buffer *data) {
|
||||
|
||||
buffer * payload = NULL;
|
||||
buffer * inbuf = NULL;
|
||||
@@ -230,7 +230,7 @@ out:
|
||||
}
|
||||
}
|
||||
|
||||
void cli_setup_agent(struct Channel *channel) {
|
||||
void cli_setup_agent(const struct Channel *channel) {
|
||||
if (!getenv("SSH_AUTH_SOCK")) {
|
||||
return;
|
||||
}
|
||||
@@ -254,7 +254,7 @@ void cli_load_agent_keys(m_list *ret_list) {
|
||||
}
|
||||
|
||||
void agent_buf_sign(buffer *sigblob, sign_key *key,
|
||||
buffer *data_buf) {
|
||||
const buffer *data_buf) {
|
||||
buffer *request_data = NULL;
|
||||
buffer *response = NULL;
|
||||
unsigned int siglen;
|
||||
|
||||
@@ -60,9 +60,11 @@ void cli_auth_getmethods() {
|
||||
*/
|
||||
if (ses.keys->trans.algo_comp != DROPBEAR_COMP_ZLIB_DELAY) {
|
||||
ses.authstate.authtypes = AUTH_TYPE_PUBKEY;
|
||||
#if DROPBEAR_USE_DROPBEAR_PASSWORD
|
||||
if (getenv(DROPBEAR_PASSWORD_ENV)) {
|
||||
ses.authstate.authtypes |= AUTH_TYPE_PASSWORD | AUTH_TYPE_INTERACT;
|
||||
}
|
||||
#endif
|
||||
if (cli_auth_try() == DROPBEAR_SUCCESS) {
|
||||
TRACE(("skipped initial none auth query"))
|
||||
/* Note that there will be two auth responses in-flight */
|
||||
@@ -331,11 +333,11 @@ int cli_auth_try() {
|
||||
#if DROPBEAR_CLI_PASSWORD_AUTH || DROPBEAR_CLI_INTERACT_AUTH
|
||||
/* A helper for getpass() that exits if the user cancels. The returned
|
||||
* password is statically allocated by getpass() */
|
||||
char* getpass_or_cancel(char* prompt)
|
||||
char* getpass_or_cancel(const char* prompt)
|
||||
{
|
||||
char* password = NULL;
|
||||
|
||||
#ifdef DROPBEAR_PASSWORD_ENV
|
||||
#if DROPBEAR_USE_DROPBEAR_PASSWORD
|
||||
/* Password provided in an environment var */
|
||||
password = getenv(DROPBEAR_PASSWORD_ENV);
|
||||
if (password)
|
||||
|
||||
@@ -121,7 +121,7 @@ void recv_msg_userauth_pk_ok() {
|
||||
}
|
||||
|
||||
void cli_buf_put_sign(buffer* buf, sign_key *key, int type,
|
||||
buffer *data_buf) {
|
||||
const buffer *data_buf) {
|
||||
#if DROPBEAR_CLI_AGENTFWD
|
||||
if (key->source == SIGNKEY_SOURCE_AGENT) {
|
||||
/* Format the agent signature ourselves, as buf_put_sign would. */
|
||||
|
||||
@@ -35,12 +35,12 @@
|
||||
#include "chansession.h"
|
||||
#include "agentfwd.h"
|
||||
|
||||
static void cli_closechansess(struct Channel *channel);
|
||||
static void cli_closechansess(const struct Channel *channel);
|
||||
static int cli_initchansess(struct Channel *channel);
|
||||
static void cli_chansessreq(struct Channel *channel);
|
||||
static void send_chansess_pty_req(struct Channel *channel);
|
||||
static void send_chansess_shell_req(struct Channel *channel);
|
||||
static void cli_escape_handler(struct Channel *channel, unsigned char* buf, int *len);
|
||||
static void send_chansess_pty_req(const struct Channel *channel);
|
||||
static void send_chansess_shell_req(const struct Channel *channel);
|
||||
static void cli_escape_handler(const struct Channel *channel, const unsigned char* buf, int *len);
|
||||
static int cli_init_netcat(struct Channel *channel);
|
||||
|
||||
static void cli_tty_setup(void);
|
||||
@@ -83,7 +83,7 @@ out:
|
||||
|
||||
|
||||
/* If the main session goes, we close it up */
|
||||
static void cli_closechansess(struct Channel *UNUSED(channel)) {
|
||||
static void cli_closechansess(const struct Channel *UNUSED(channel)) {
|
||||
cli_tty_cleanup(); /* Restore tty modes etc */
|
||||
|
||||
/* This channel hasn't gone yet, so we have > 1 */
|
||||
@@ -270,7 +270,7 @@ void cli_chansess_winchange() {
|
||||
cli_ses.winchange = 0;
|
||||
}
|
||||
|
||||
static void send_chansess_pty_req(struct Channel *channel) {
|
||||
static void send_chansess_pty_req(const struct Channel *channel) {
|
||||
|
||||
char* term = NULL;
|
||||
|
||||
@@ -303,7 +303,7 @@ static void send_chansess_pty_req(struct Channel *channel) {
|
||||
TRACE(("leave send_chansess_pty_req"))
|
||||
}
|
||||
|
||||
static void send_chansess_shell_req(struct Channel *channel) {
|
||||
static void send_chansess_shell_req(const struct Channel *channel) {
|
||||
|
||||
char* reqtype = NULL;
|
||||
|
||||
@@ -452,7 +452,7 @@ do_escape(unsigned char c) {
|
||||
}
|
||||
|
||||
static
|
||||
void cli_escape_handler(struct Channel* UNUSED(channel), unsigned char* buf, int *len) {
|
||||
void cli_escape_handler(const struct Channel* UNUSED(channel), const unsigned char* buf, int *len) {
|
||||
char c;
|
||||
int skip_char = 0;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include "ecc.h"
|
||||
|
||||
|
||||
static void checkhostkey(unsigned char* keyblob, unsigned int keybloblen);
|
||||
static void checkhostkey(const unsigned char* keyblob, unsigned int keybloblen);
|
||||
#define MAX_KNOWNHOSTS_LINE 4500
|
||||
|
||||
void send_msg_kexdh_init() {
|
||||
@@ -185,7 +185,7 @@ void recv_msg_kexdh_reply() {
|
||||
TRACE(("leave recv_msg_kexdh_init"))
|
||||
}
|
||||
|
||||
static void ask_to_confirm(unsigned char* keyblob, unsigned int keybloblen,
|
||||
static void ask_to_confirm(const unsigned char* keyblob, unsigned int keybloblen,
|
||||
const char* algoname) {
|
||||
|
||||
char* fp = NULL;
|
||||
@@ -282,7 +282,7 @@ out:
|
||||
return hostsfile;
|
||||
}
|
||||
|
||||
static void checkhostkey(unsigned char* keyblob, unsigned int keybloblen) {
|
||||
static void checkhostkey(const unsigned char* keyblob, unsigned int keybloblen) {
|
||||
|
||||
FILE *hostsfile = NULL;
|
||||
int readonly = 0;
|
||||
|
||||
11
cli-main.c
11
cli-main.c
@@ -66,8 +66,8 @@ int main(int argc, char ** argv) {
|
||||
}
|
||||
#endif
|
||||
|
||||
TRACE(("user='%s' host='%s' port='%s'", cli_opts.username,
|
||||
cli_opts.remotehost, cli_opts.remoteport))
|
||||
TRACE(("user='%s' host='%s' port='%s' bind_address='%s' bind_port='%s'", cli_opts.username,
|
||||
cli_opts.remotehost, cli_opts.remoteport, cli_opts.bind_address, cli_opts.bind_port))
|
||||
|
||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
|
||||
dropbear_exit("signal() error");
|
||||
@@ -86,7 +86,8 @@ int main(int argc, char ** argv) {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
progress = connect_remote(cli_opts.remotehost, cli_opts.remoteport, cli_connected, &ses);
|
||||
progress = connect_remote(cli_opts.remotehost, cli_opts.remoteport,
|
||||
cli_connected, &ses, cli_opts.bind_address, cli_opts.bind_port);
|
||||
sock_in = sock_out = -1;
|
||||
}
|
||||
|
||||
@@ -107,7 +108,7 @@ static void cli_dropbear_exit(int exitcode, const char* format, va_list param) {
|
||||
vsnprintf(exitmsg, sizeof(exitmsg), format, param);
|
||||
|
||||
/* Add the prefix depending on session/auth state */
|
||||
if (!sessinitdone) {
|
||||
if (!ses.init_done) {
|
||||
snprintf(fullmsg, sizeof(fullmsg), "Exited: %s", exitmsg);
|
||||
} else {
|
||||
snprintf(fullmsg, sizeof(fullmsg),
|
||||
@@ -142,7 +143,7 @@ static void cli_dropbear_log(int priority,
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
static void exec_proxy_cmd(void *user_data_cmd) {
|
||||
static void exec_proxy_cmd(const void *user_data_cmd) {
|
||||
const char *cmd = user_data_cmd;
|
||||
char *usershell;
|
||||
|
||||
|
||||
@@ -92,6 +92,7 @@ static void printhelp() {
|
||||
"-c <cipher list> Specify preferred ciphers ('-c help' to list options)\n"
|
||||
"-m <MAC list> Specify preferred MACs for packet verification (or '-m help')\n"
|
||||
#endif
|
||||
"-b [bind_address][:bind_port]\n"
|
||||
"-V Version\n"
|
||||
#if DEBUG_TRACE
|
||||
"-v verbose (compiled with DEBUG_TRACE)\n"
|
||||
@@ -125,12 +126,12 @@ void cli_getopts(int argc, char ** argv) {
|
||||
OPT_OTHER
|
||||
} opt;
|
||||
unsigned int cmdlen;
|
||||
char* dummy = NULL; /* Not used for anything real */
|
||||
|
||||
char* recv_window_arg = NULL;
|
||||
char* keepalive_arg = NULL;
|
||||
char* idle_timeout_arg = NULL;
|
||||
char *host_arg = NULL;
|
||||
char *bind_arg = NULL;
|
||||
char c;
|
||||
|
||||
/* see printhelp() for options */
|
||||
@@ -166,6 +167,8 @@ void cli_getopts(int argc, char ** argv) {
|
||||
#if DROPBEAR_CLI_PROXYCMD
|
||||
cli_opts.proxycmd = NULL;
|
||||
#endif
|
||||
cli_opts.bind_address = NULL;
|
||||
cli_opts.bind_port = NULL;
|
||||
#ifndef DISABLE_ZLIB
|
||||
opts.compress_mode = DROPBEAR_COMPRESS_ON;
|
||||
#endif
|
||||
@@ -303,10 +306,10 @@ void cli_getopts(int argc, char ** argv) {
|
||||
case 'm':
|
||||
#endif
|
||||
case 'D':
|
||||
#ifndef DROPBEAR_CLI_REMOTETCPFWD
|
||||
#if !DROPBEAR_CLI_REMOTETCPFWD
|
||||
case 'R':
|
||||
#endif
|
||||
#ifndef DROPBEAR_CLI_LOCALTCPFWD
|
||||
#if !DROPBEAR_CLI_LOCALTCPFWD
|
||||
case 'L':
|
||||
#endif
|
||||
case 'V':
|
||||
@@ -314,8 +317,8 @@ void cli_getopts(int argc, char ** argv) {
|
||||
exit(EXIT_SUCCESS);
|
||||
break;
|
||||
case 'b':
|
||||
next = &dummy;
|
||||
/* FALLTHROUGH */
|
||||
next = &bind_arg;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,
|
||||
"WARNING: Ignoring unknown option -%c\n", c);
|
||||
@@ -420,6 +423,18 @@ void cli_getopts(int argc, char ** argv) {
|
||||
cli_opts.remoteport = "22";
|
||||
}
|
||||
|
||||
if (bind_arg) {
|
||||
/* split [host][:port] */
|
||||
char *port = strrchr(bind_arg, ':');
|
||||
if (port) {
|
||||
cli_opts.bind_port = m_strdup(port+1);
|
||||
*port = '\0';
|
||||
}
|
||||
if (strlen(bind_arg) > 0) {
|
||||
cli_opts.bind_address = m_strdup(bind_arg);
|
||||
}
|
||||
}
|
||||
|
||||
/* If not explicitly specified with -t or -T, we don't want a pty if
|
||||
* there's a command, but we do otherwise */
|
||||
if (cli_opts.wantpty == 9) {
|
||||
|
||||
@@ -118,7 +118,7 @@ void cli_session(int sock_in, int sock_out, struct dropbear_progress_connection
|
||||
cli_session_init(proxy_cmd_pid);
|
||||
|
||||
/* Ready to go */
|
||||
sessinitdone = 1;
|
||||
ses.init_done = 1;
|
||||
|
||||
/* Exchange identification */
|
||||
send_session_identification();
|
||||
@@ -165,13 +165,6 @@ static void cli_session_init(pid_t proxy_cmd_pid) {
|
||||
cli_ses.lastprivkey = NULL;
|
||||
cli_ses.lastauthtype = 0;
|
||||
|
||||
#if DROPBEAR_NONE_CIPHER
|
||||
cli_ses.cipher_none_after_auth = get_algo_usable(sshciphers, "none");
|
||||
set_algo_usable(sshciphers, "none", 0);
|
||||
#else
|
||||
cli_ses.cipher_none_after_auth = 0;
|
||||
#endif
|
||||
|
||||
/* For printing "remote host closed" for the user */
|
||||
ses.remoteclosed = cli_remoteclosed;
|
||||
|
||||
@@ -275,14 +268,6 @@ static void cli_sessionloop() {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if DROPBEAR_NONE_CIPHER
|
||||
if (cli_ses.cipher_none_after_auth)
|
||||
{
|
||||
set_algo_usable(sshciphers, "none", 1);
|
||||
send_msg_kexinit();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (cli_opts.backgrounded) {
|
||||
int devnull;
|
||||
/* keeping stdin open steals input from the terminal and
|
||||
@@ -353,7 +338,7 @@ void kill_proxy_command(void) {
|
||||
|
||||
static void cli_session_cleanup(void) {
|
||||
|
||||
if (!sessinitdone) {
|
||||
if (!ses.init_done) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ static int newtcpforwarded(struct Channel * channel) {
|
||||
}
|
||||
|
||||
snprintf(portstring, sizeof(portstring), "%u", fwd->connectport);
|
||||
channel->conn_pending = connect_remote(fwd->connectaddr, portstring, channel_connect_done, channel);
|
||||
channel->conn_pending = connect_remote(fwd->connectaddr, portstring, channel_connect_done, channel, NULL, NULL);
|
||||
|
||||
channel->prio = DROPBEAR_CHANNEL_PRIO_UNKNOWABLE;
|
||||
|
||||
|
||||
@@ -179,9 +179,6 @@ algo_type sshciphers[] = {
|
||||
{"blowfish-cbc", 0, &dropbear_blowfish, 1, &dropbear_mode_cbc},
|
||||
#endif
|
||||
#endif /* DROPBEAR_ENABLE_CBC_MODE */
|
||||
#if DROPBEAR_NONE_CIPHER
|
||||
{"none", 0, (void*)&dropbear_nocipher, 1, &dropbear_mode_none},
|
||||
#endif
|
||||
{NULL, 0, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
@@ -314,7 +311,7 @@ algo_type sshkex[] = {
|
||||
* against.
|
||||
* Returns DROPBEAR_SUCCESS if we have a match for algo, DROPBEAR_FAILURE
|
||||
* otherwise */
|
||||
int have_algo(char* algo, size_t algolen, algo_type algos[]) {
|
||||
int have_algo(const char* algo, size_t algolen, const algo_type algos[]) {
|
||||
|
||||
int i;
|
||||
|
||||
@@ -329,7 +326,7 @@ int have_algo(char* algo, size_t algolen, algo_type algos[]) {
|
||||
}
|
||||
|
||||
/* Output a comma separated list of algorithms to a buffer */
|
||||
void buf_put_algolist(buffer * buf, algo_type localalgos[]) {
|
||||
void buf_put_algolist(buffer * buf, const algo_type localalgos[]) {
|
||||
|
||||
unsigned int i, len;
|
||||
unsigned int donefirst = 0;
|
||||
@@ -466,42 +463,10 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if DROPBEAR_NONE_CIPHER
|
||||
|
||||
void
|
||||
set_algo_usable(algo_type algos[], const char * algo_name, int usable)
|
||||
{
|
||||
algo_type *a;
|
||||
for (a = algos; a->name != NULL; a++)
|
||||
{
|
||||
if (strcmp(a->name, algo_name) == 0)
|
||||
{
|
||||
a->usable = usable;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
get_algo_usable(algo_type algos[], const char * algo_name)
|
||||
{
|
||||
algo_type *a;
|
||||
for (a = algos; a->name != NULL; a++)
|
||||
{
|
||||
if (strcmp(a->name, algo_name) == 0)
|
||||
{
|
||||
return a->usable;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* DROPBEAR_NONE_CIPHER */
|
||||
|
||||
#if DROPBEAR_USER_ALGO_LIST
|
||||
|
||||
char *
|
||||
algolist_string(algo_type algos[])
|
||||
algolist_string(const algo_type algos[])
|
||||
{
|
||||
char *ret_list;
|
||||
buffer *b = buf_new(200);
|
||||
|
||||
@@ -38,18 +38,18 @@
|
||||
|
||||
static void send_msg_channel_open_failure(unsigned int remotechan, int reason,
|
||||
const char *text, const char *lang);
|
||||
static void send_msg_channel_open_confirmation(struct Channel* channel,
|
||||
static void send_msg_channel_open_confirmation(const struct Channel* channel,
|
||||
unsigned int recvwindow,
|
||||
unsigned int recvmaxpacket);
|
||||
static int writechannel(struct Channel* channel, int fd, circbuffer *cbuf,
|
||||
const unsigned char *moredata, unsigned int *morelen);
|
||||
static void send_msg_channel_window_adjust(struct Channel *channel,
|
||||
static void send_msg_channel_window_adjust(const struct Channel *channel,
|
||||
unsigned int incr);
|
||||
static void send_msg_channel_data(struct Channel *channel, int isextended);
|
||||
static void send_msg_channel_eof(struct Channel *channel);
|
||||
static void send_msg_channel_close(struct Channel *channel);
|
||||
static void remove_channel(struct Channel *channel);
|
||||
static unsigned int write_pending(struct Channel * channel);
|
||||
static unsigned int write_pending(const struct Channel * channel);
|
||||
static void check_close(struct Channel *channel);
|
||||
static void close_chan_fd(struct Channel *channel, int fd, int how);
|
||||
|
||||
@@ -198,7 +198,7 @@ struct Channel* getchannel() {
|
||||
}
|
||||
|
||||
/* Iterate through the channels, performing IO if available */
|
||||
void channelio(fd_set *readfds, fd_set *writefds) {
|
||||
void channelio(const fd_set *readfds, const fd_set *writefds) {
|
||||
|
||||
/* Listeners such as TCP, X11, agent-auth */
|
||||
struct Channel *channel;
|
||||
@@ -262,7 +262,7 @@ void channelio(fd_set *readfds, fd_set *writefds) {
|
||||
|
||||
/* Returns true if there is data remaining to be written to stdin or
|
||||
* stderr of a channel's endpoint. */
|
||||
static unsigned int write_pending(struct Channel * channel) {
|
||||
static unsigned int write_pending(const struct Channel * channel) {
|
||||
|
||||
if (channel->writefd >= 0 && cbuf_getused(channel->writebuf) > 0) {
|
||||
return 1;
|
||||
@@ -903,7 +903,7 @@ void recv_msg_channel_window_adjust() {
|
||||
|
||||
/* Increment the incoming data window for a channel, and let the remote
|
||||
* end know */
|
||||
static void send_msg_channel_window_adjust(struct Channel* channel,
|
||||
static void send_msg_channel_window_adjust(const struct Channel* channel,
|
||||
unsigned int incr) {
|
||||
|
||||
TRACE(("sending window adjust %d", incr))
|
||||
@@ -1008,7 +1008,7 @@ cleanup:
|
||||
}
|
||||
|
||||
/* Send a failure message */
|
||||
void send_msg_channel_failure(struct Channel *channel) {
|
||||
void send_msg_channel_failure(const struct Channel *channel) {
|
||||
|
||||
TRACE(("enter send_msg_channel_failure"))
|
||||
CHECKCLEARTOWRITE();
|
||||
@@ -1021,7 +1021,7 @@ void send_msg_channel_failure(struct Channel *channel) {
|
||||
}
|
||||
|
||||
/* Send a success message */
|
||||
void send_msg_channel_success(struct Channel *channel) {
|
||||
void send_msg_channel_success(const struct Channel *channel) {
|
||||
|
||||
TRACE(("enter send_msg_channel_success"))
|
||||
CHECKCLEARTOWRITE();
|
||||
@@ -1053,7 +1053,7 @@ static void send_msg_channel_open_failure(unsigned int remotechan,
|
||||
|
||||
/* Confirm a channel open, and let the remote end know what number we've
|
||||
* allocated and the receive parameters */
|
||||
static void send_msg_channel_open_confirmation(struct Channel* channel,
|
||||
static void send_msg_channel_open_confirmation(const struct Channel* channel,
|
||||
unsigned int recvwindow,
|
||||
unsigned int recvmaxpacket) {
|
||||
|
||||
@@ -1239,8 +1239,8 @@ struct Channel* get_any_ready_channel() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void start_send_channel_request(struct Channel *channel,
|
||||
char *type) {
|
||||
void start_send_channel_request(const struct Channel *channel,
|
||||
const char *type) {
|
||||
|
||||
CHECKCLEARTOWRITE();
|
||||
buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_REQUEST);
|
||||
|
||||
@@ -721,7 +721,7 @@ void free_kexcurve25519_param(struct kex_curve25519_param *param)
|
||||
m_free(param);
|
||||
}
|
||||
|
||||
void kexcurve25519_comb_key(struct kex_curve25519_param *param, buffer *buf_pub_them,
|
||||
void kexcurve25519_comb_key(const struct kex_curve25519_param *param, const buffer *buf_pub_them,
|
||||
sign_key *hostkey) {
|
||||
unsigned char out[CURVE25519_LEN];
|
||||
const unsigned char* Q_C = NULL;
|
||||
|
||||
@@ -43,13 +43,6 @@ static void read_session_identification(void);
|
||||
|
||||
struct sshsession ses; /* GLOBAL */
|
||||
|
||||
/* need to know if the session struct has been initialised, this way isn't the
|
||||
* cleanest, but works OK */
|
||||
int sessinitdone = 0; /* GLOBAL */
|
||||
|
||||
/* this is set when we get SIGINT or SIGTERM, the handler is in main.c */
|
||||
int exitflag = 0; /* GLOBAL */
|
||||
|
||||
/* called only at the start of a session, set up initial state */
|
||||
void common_session_init(int sock_in, int sock_out) {
|
||||
time_t now;
|
||||
@@ -86,13 +79,13 @@ void common_session_init(int sock_in, int sock_out) {
|
||||
if (!fuzz.fuzzing)
|
||||
#endif
|
||||
{
|
||||
if (pipe(ses.signal_pipe) < 0) {
|
||||
dropbear_exit("Signal pipe failed");
|
||||
}
|
||||
setnonblocking(ses.signal_pipe[0]);
|
||||
setnonblocking(ses.signal_pipe[1]);
|
||||
ses.maxfd = MAX(ses.maxfd, ses.signal_pipe[0]);
|
||||
ses.maxfd = MAX(ses.maxfd, ses.signal_pipe[1]);
|
||||
if (pipe(ses.signal_pipe) < 0) {
|
||||
dropbear_exit("Signal pipe failed");
|
||||
}
|
||||
setnonblocking(ses.signal_pipe[0]);
|
||||
setnonblocking(ses.signal_pipe[1]);
|
||||
ses.maxfd = MAX(ses.maxfd, ses.signal_pipe[0]);
|
||||
ses.maxfd = MAX(ses.maxfd, ses.signal_pipe[1]);
|
||||
}
|
||||
|
||||
ses.writepayload = buf_new(TRANS_MAX_PAYLOAD_LEN);
|
||||
@@ -169,9 +162,8 @@ void session_loop(void(*loophandler)()) {
|
||||
if (!fuzz.fuzzing)
|
||||
#endif
|
||||
{
|
||||
FD_SET(ses.signal_pipe[0], &readfd);
|
||||
FD_SET(ses.signal_pipe[0], &readfd);
|
||||
}
|
||||
ses.channel_signal_pending = 0;
|
||||
|
||||
/* set up for channels which can be read/written */
|
||||
setchannelfds(&readfd, &writefd, writequeue_has_space);
|
||||
@@ -199,7 +191,7 @@ void session_loop(void(*loophandler)()) {
|
||||
|
||||
val = select(ses.maxfd+1, &readfd, &writefd, NULL, &timeout);
|
||||
|
||||
if (exitflag) {
|
||||
if (ses.exitflag) {
|
||||
dropbear_exit("Terminated by signal");
|
||||
}
|
||||
|
||||
@@ -219,6 +211,7 @@ void session_loop(void(*loophandler)()) {
|
||||
/* We'll just empty out the pipe if required. We don't do
|
||||
any thing with the data, since the pipe's purpose is purely to
|
||||
wake up the select() above. */
|
||||
ses.channel_signal_pending = 0;
|
||||
if (FD_ISSET(ses.signal_pipe[0], &readfd)) {
|
||||
char x;
|
||||
TRACE(("signal pipe set"))
|
||||
@@ -253,6 +246,10 @@ void session_loop(void(*loophandler)()) {
|
||||
|
||||
handle_connect_fds(&writefd);
|
||||
|
||||
/* loop handler prior to channelio, in case the server loophandler closes
|
||||
channels on process exit */
|
||||
loophandler();
|
||||
|
||||
/* process pipes etc for the channels, ses.dataallowed == 0
|
||||
* during rekeying ) */
|
||||
channelio(&readfd, &writefd);
|
||||
@@ -264,11 +261,6 @@ void session_loop(void(*loophandler)()) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (loophandler) {
|
||||
loophandler();
|
||||
}
|
||||
|
||||
} /* for(;;) */
|
||||
|
||||
/* Not reached */
|
||||
@@ -289,8 +281,8 @@ void session_cleanup() {
|
||||
TRACE(("enter session_cleanup"))
|
||||
|
||||
/* we can't cleanup if we don't know the session state */
|
||||
if (!sessinitdone) {
|
||||
TRACE(("leave session_cleanup: !sessinitdone"))
|
||||
if (!ses.init_done) {
|
||||
TRACE(("leave session_cleanup: !ses.init_done"))
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
114
configure.ac
114
configure.ac
@@ -9,29 +9,36 @@ AC_PREREQ(2.59)
|
||||
AC_INIT
|
||||
AC_CONFIG_SRCDIR(buffer.c)
|
||||
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
if test -z "$LD" ; then
|
||||
LD=$CC
|
||||
fi
|
||||
AC_SUBST(LD)
|
||||
|
||||
AC_DEFUN(DB_TRYADDCFLAGS,
|
||||
[{
|
||||
OLDFLAGS="$CFLAGS"
|
||||
TESTFLAGS="$1"
|
||||
CFLAGS="$CFLAGS $TESTFLAGS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
|
||||
[AC_MSG_NOTICE([Setting $TESTFLAGS])],
|
||||
[AC_MSG_NOTICE([Not setting $TESTFLAGS]); CFLAGS="$OLDFLAGS" ]
|
||||
)
|
||||
}])
|
||||
|
||||
# set compile flags prior to other tests
|
||||
if test -z "$OLDCFLAGS" && test "$GCC" = "yes"; then
|
||||
AC_MSG_NOTICE(No \$CFLAGS set... using "-Os -W -Wall" for GCC)
|
||||
CFLAGS="-Os -W -Wall -Wno-pointer-sign"
|
||||
CFLAGS="-Os -W -Wall"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if compiler '$CC' supports -fno-strict-overflow])
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -fno-strict-overflow"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
|
||||
[AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no); CFLAGS="$OLDCFLAGS" ]
|
||||
)
|
||||
AC_MSG_NOTICE([Checking if compiler '$CC' supports -Wno-pointer-sign])
|
||||
DB_TRYADDCFLAGS([-Wno-pointer-sign])
|
||||
|
||||
AC_MSG_NOTICE([Checking if compiler '$CC' supports -fno-strict-overflow])
|
||||
DB_TRYADDCFLAGS([-fno-strict-overflow])
|
||||
|
||||
STATIC=0
|
||||
AC_ARG_ENABLE(static,
|
||||
@@ -59,13 +66,8 @@ if test "$hardenbuild" -eq 1; then
|
||||
# relocation flags don't make sense for static builds
|
||||
if test "$STATIC" -ne 1; then
|
||||
# pie
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
TESTFLAGS="-fPIE"
|
||||
CFLAGS="$CFLAGS $TESTFLAGS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
|
||||
[AC_MSG_NOTICE([Setting $TESTFLAGS])],
|
||||
[AC_MSG_NOTICE([Not setting $TESTFLAGS]); CFLAGS="$OLDCFLAGS" ]
|
||||
)
|
||||
DB_TRYADDCFLAGS([-fPIE])
|
||||
|
||||
OLDLDFLAGS="$LDFLAGS"
|
||||
TESTFLAGS="-Wl,-pie"
|
||||
LDFLAGS="$LDFLAGS $TESTFLAGS"
|
||||
@@ -107,13 +109,12 @@ if test "$hardenbuild" -eq 1; then
|
||||
]
|
||||
)
|
||||
# FORTIFY_SOURCE
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
TESTFLAGS="-D_FORTIFY_SOURCE=2"
|
||||
CFLAGS="$CFLAGS $TESTFLAGS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
|
||||
[AC_MSG_NOTICE([Setting $TESTFLAGS])],
|
||||
[AC_MSG_NOTICE([Not setting $TESTFLAGS]); CFLAGS="$OLDCFLAGS" ]
|
||||
)
|
||||
DB_TRYADDCFLAGS([-D_FORTIFY_SOURCE=2])
|
||||
|
||||
# Spectre v2 mitigations
|
||||
DB_TRYADDCFLAGS([-mfunction-return=thunk])
|
||||
DB_TRYADDCFLAGS([-mindirect-branch=thunk])
|
||||
|
||||
fi
|
||||
|
||||
# large file support is useful for scp
|
||||
@@ -269,15 +270,20 @@ AC_ARG_ENABLE(openpty,
|
||||
AC_MSG_NOTICE(Not using openpty)
|
||||
else
|
||||
AC_MSG_NOTICE(Using openpty if available)
|
||||
AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY,1,[Have openpty() function])])
|
||||
AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes])
|
||||
fi
|
||||
],
|
||||
[
|
||||
AC_MSG_NOTICE(Using openpty if available)
|
||||
AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY)])
|
||||
AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes])
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
if test "x$dropbear_cv_func_have_openpty" = "xyes"; then
|
||||
AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)
|
||||
no_ptc_check=yes
|
||||
no_ptmx_check=yes
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(syslog,
|
||||
[ --disable-syslog Don't include syslog support],
|
||||
@@ -809,61 +815,11 @@ fi
|
||||
|
||||
AC_EXEEXT
|
||||
|
||||
# XXX there must be a nicer way to do this
|
||||
if test $BUNDLED_LIBTOM = 1 ; then
|
||||
AS_MKDIR_P(libtomcrypt/src/ciphers/aes)
|
||||
AS_MKDIR_P(libtomcrypt/src/ciphers/safer)
|
||||
AS_MKDIR_P(libtomcrypt/src/ciphers/twofish)
|
||||
AS_MKDIR_P(libtomcrypt/src/encauth/ccm)
|
||||
AS_MKDIR_P(libtomcrypt/src/encauth/eax)
|
||||
AS_MKDIR_P(libtomcrypt/src/encauth/gcm)
|
||||
AS_MKDIR_P(libtomcrypt/src/encauth/ocb)
|
||||
AS_MKDIR_P(libtomcrypt/src/hashes)
|
||||
AS_MKDIR_P(libtomcrypt/src/hashes/chc)
|
||||
AS_MKDIR_P(libtomcrypt/src/hashes/helper)
|
||||
AS_MKDIR_P(libtomcrypt/src/hashes/sha2)
|
||||
AS_MKDIR_P(libtomcrypt/src/hashes/whirl)
|
||||
AS_MKDIR_P(libtomcrypt/src/mac/hmac)
|
||||
AS_MKDIR_P(libtomcrypt/src/mac/omac)
|
||||
AS_MKDIR_P(libtomcrypt/src/mac/pelican)
|
||||
AS_MKDIR_P(libtomcrypt/src/mac/pmac)
|
||||
AS_MKDIR_P(libtomcrypt/src/mac/f9)
|
||||
AS_MKDIR_P(libtomcrypt/src/mac/xcbc)
|
||||
AS_MKDIR_P(libtomcrypt/src/math/fp)
|
||||
AS_MKDIR_P(libtomcrypt/src/misc/base64)
|
||||
AS_MKDIR_P(libtomcrypt/src/misc/crypt)
|
||||
AS_MKDIR_P(libtomcrypt/src/misc/mpi)
|
||||
AS_MKDIR_P(libtomcrypt/src/misc/pkcs5)
|
||||
AS_MKDIR_P(libtomcrypt/src/modes/cbc)
|
||||
AS_MKDIR_P(libtomcrypt/src/modes/cfb)
|
||||
AS_MKDIR_P(libtomcrypt/src/modes/ctr)
|
||||
AS_MKDIR_P(libtomcrypt/src/modes/ecb)
|
||||
AS_MKDIR_P(libtomcrypt/src/modes/ofb)
|
||||
AS_MKDIR_P(libtomcrypt/src/modes/f8)
|
||||
AS_MKDIR_P(libtomcrypt/src/modes/lrw)
|
||||
AS_MKDIR_P(libtomcrypt/src/modes/xts)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/bit)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/boolean)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/choice)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/ia5)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/integer)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/object_identifier)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/octet)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/printable_string)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/sequence)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/set)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/short_integer)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/utctime)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/utf8)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/dh)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/dsa)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/ecc)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/katja)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/pkcs1)
|
||||
AS_MKDIR_P(libtomcrypt/src/pk/rsa)
|
||||
AS_MKDIR_P(libtomcrypt/src/prngs)
|
||||
(cd $srcdir; find libtomcrypt -type d) | xargs mkdir -pv
|
||||
LIBTOM_FILES="libtomcrypt/Makefile libtommath/Makefile"
|
||||
fi
|
||||
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
AC_CONFIG_FILES(Makefile $LIBTOM_FILES)
|
||||
AC_OUTPUT
|
||||
|
||||
@@ -133,8 +133,8 @@ Can be used to give options in the format used by OpenSSH config file. This is
|
||||
useful for specifying options for which there is no separate command-line flag.
|
||||
For full details of the options listed below, and their possible values, see
|
||||
ssh_config(5).
|
||||
The following options have currently been implemented:
|
||||
|
||||
For now following options have been implemented:
|
||||
.RS
|
||||
.TP
|
||||
.B ExitOnForwardFailure
|
||||
@@ -147,6 +147,10 @@ Send dbclient log messages to syslog in addition to stderr.
|
||||
.B \-s
|
||||
The specified command will be requested as a subsystem, used for sftp. Dropbear doesn't implement sftp itself but the OpenSSH sftp client can be used eg \fIsftp -S dbclient user@host\fR
|
||||
.TP
|
||||
.B \-b \fI[address][:port]
|
||||
Bind to a specific local address when connecting to the remote host. This can be used to choose from
|
||||
multiple outgoing interfaces. Either address or port (or both) can be given.
|
||||
.TP
|
||||
.B \-V
|
||||
Print the version
|
||||
|
||||
|
||||
10
dbrandom.c
10
dbrandom.c
@@ -59,7 +59,7 @@ process_file(hash_state *hs, const char *filename,
|
||||
unsigned int readcount;
|
||||
int ret = DROPBEAR_FAILURE;
|
||||
|
||||
#ifdef DROPBEAR_PRNGD_SOCKET
|
||||
#if DROPBEAR_USE_PRNGD
|
||||
if (prngd)
|
||||
{
|
||||
readfd = connect_unix(filename);
|
||||
@@ -107,7 +107,7 @@ process_file(hash_state *hs, const char *filename,
|
||||
wantread = MIN(sizeof(readbuf), len-readcount);
|
||||
}
|
||||
|
||||
#ifdef DROPBEAR_PRNGD_SOCKET
|
||||
#if DROPBEAR_USE_PRNGD
|
||||
if (prngd)
|
||||
{
|
||||
char egdcmd[2];
|
||||
@@ -141,7 +141,7 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
void addrandom(unsigned char * buf, unsigned int len)
|
||||
void addrandom(const unsigned char * buf, unsigned int len)
|
||||
{
|
||||
hash_state hs;
|
||||
|
||||
@@ -168,7 +168,7 @@ static void write_urandom()
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifndef DROPBEAR_PRNGD_SOCKET
|
||||
#if !DROPBEAR_USE_PRNGD
|
||||
/* This is opportunistic, don't worry about failure */
|
||||
unsigned char buf[INIT_SEED_SIZE];
|
||||
FILE *f = fopen(DROPBEAR_URANDOM_DEV, "w");
|
||||
@@ -215,7 +215,7 @@ void seedrandom() {
|
||||
/* existing state */
|
||||
sha1_process(&hs, (void*)hashpool, sizeof(hashpool));
|
||||
|
||||
#ifdef DROPBEAR_PRNGD_SOCKET
|
||||
#if DROPBEAR_USE_PRNGD
|
||||
if (process_file(&hs, DROPBEAR_PRNGD_SOCKET, INIT_SEED_SIZE, 1)
|
||||
!= DROPBEAR_SUCCESS) {
|
||||
dropbear_exit("Failure reading random device %s",
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
void seedrandom(void);
|
||||
void genrandom(unsigned char* buf, unsigned int len);
|
||||
void addrandom(unsigned char * buf, unsigned int len);
|
||||
void addrandom(const unsigned char * buf, unsigned int len);
|
||||
void gen_random_mpint(mp_int *max, mp_int *rand);
|
||||
|
||||
#endif /* DROPBEAR_RANDOM_H_ */
|
||||
|
||||
8
dbutil.c
8
dbutil.c
@@ -221,7 +221,7 @@ void dropbear_trace2(const char* format, ...) {
|
||||
#endif /* DEBUG_TRACE */
|
||||
|
||||
/* Connect to a given unix socket. The socket is blocking */
|
||||
#ifdef ENABLE_CONNECT_UNIX
|
||||
#if ENABLE_CONNECT_UNIX
|
||||
int connect_unix(const char* path) {
|
||||
struct sockaddr_un addr;
|
||||
int fd = -1;
|
||||
@@ -248,7 +248,7 @@ int connect_unix(const char* path) {
|
||||
* it will be run after the child has fork()ed, and is passed exec_data.
|
||||
* If ret_errfd == NULL then stderr will not be captured.
|
||||
* ret_pid can be passed as NULL to discard the pid. */
|
||||
int spawn_command(void(*exec_fn)(void *user_data), void *exec_data,
|
||||
int spawn_command(void(*exec_fn)(const void *user_data), const void *exec_data,
|
||||
int *ret_writefd, int *ret_readfd, int *ret_errfd, pid_t *ret_pid) {
|
||||
int infds[2];
|
||||
int outfds[2];
|
||||
@@ -611,6 +611,10 @@ reach userspace include headers */
|
||||
#ifndef CLOCK_MONOTONIC_COARSE
|
||||
#define CLOCK_MONOTONIC_COARSE 6
|
||||
#endif
|
||||
/* Some old toolchains know SYS_clock_gettime but not CLOCK_MONOTONIC */
|
||||
#ifndef CLOCK_MONOTONIC
|
||||
#define CLOCK_MONOTONIC 1
|
||||
#endif
|
||||
static clockid_t get_linux_clock_source() {
|
||||
struct timespec ts;
|
||||
if (syscall(SYS_clock_gettime, CLOCK_MONOTONIC_COARSE, &ts) == 0) {
|
||||
|
||||
4
dbutil.h
4
dbutil.h
@@ -57,10 +57,10 @@ extern int debug_trace;
|
||||
|
||||
char * stripcontrol(const char * text);
|
||||
|
||||
int spawn_command(void(*exec_fn)(void *user_data), void *exec_data,
|
||||
int spawn_command(void(*exec_fn)(const void *user_data), const void *exec_data,
|
||||
int *writefd, int *readfd, int *errfd, pid_t *pid);
|
||||
void run_shell_command(const char* cmd, unsigned int maxfd, char* usershell);
|
||||
#ifdef ENABLE_CONNECT_UNIX
|
||||
#if ENABLE_CONNECT_UNIX
|
||||
int connect_unix(const char* addr);
|
||||
#endif
|
||||
int buf_readfile(buffer* buf, const char* filename);
|
||||
|
||||
10
debug.h
10
debug.h
@@ -33,16 +33,6 @@
|
||||
* etc. Don't use this normally, it might cause problems */
|
||||
/* #define DEBUG_VALGRIND */
|
||||
|
||||
/* Define this to compile in trace debugging printf()s.
|
||||
* You'll need to run programs with "-v" to turn this on.
|
||||
*
|
||||
* Caution: Don't use this in an unfriendly environment (ie unfirewalled),
|
||||
* since the printing may not sanitise strings etc. This will add a reasonable
|
||||
* amount to your executable size. */
|
||||
#ifndef DEBUG_TRACE
|
||||
#define DEBUG_TRACE 0
|
||||
#endif
|
||||
|
||||
/* All functions writing to the cleartext payload buffer call
|
||||
* CHECKCLEARTOWRITE() before writing. This is only really useful if you're
|
||||
* attempting to track down a problem */
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
/*
|
||||
> > > Do not edit this file (default_options.h) < < <
|
||||
Generated from ../default_options.h.in
|
||||
Local customisation goes in localoptions.h
|
||||
*/
|
||||
|
||||
|
||||
#ifndef DROPBEAR_DEFAULT_OPTIONS_H_
|
||||
#define DROPBEAR_DEFAULT_OPTIONS_H_
|
||||
/*
|
||||
> > > Read This < < <
|
||||
|
||||
default_options.h.in (this file) documents compile-time options, and provides
|
||||
default values.
|
||||
default_options.h.in documents compile-time options, and provides default values.
|
||||
|
||||
Local customisation should be added to localoptions.h which is
|
||||
used if it exists. Options defined there will override any options in this
|
||||
file (#ifndef guards added by ifndef_wrapper.sh).
|
||||
file.
|
||||
|
||||
Options can also be defined with -DDROPBEAR_XXX in Makefile CFLAGS
|
||||
|
||||
@@ -381,7 +387,7 @@ Homedir is prepended unless path begins with / */
|
||||
#endif
|
||||
|
||||
/* Default maximum number of failed authentication tries (server option) */
|
||||
/* -T runtime option overrides */
|
||||
/* -T server option overrides */
|
||||
#ifndef MAX_AUTH_TRIES
|
||||
#define MAX_AUTH_TRIES 10
|
||||
#endif
|
||||
|
||||
@@ -3,12 +3,11 @@
|
||||
/*
|
||||
> > > Read This < < <
|
||||
|
||||
default_options.h.in (this file) documents compile-time options, and provides
|
||||
default values.
|
||||
default_options.h.in documents compile-time options, and provides default values.
|
||||
|
||||
Local customisation should be added to localoptions.h which is
|
||||
used if it exists. Options defined there will override any options in this
|
||||
file (#ifndef guards added by ifndef_wrapper.sh).
|
||||
file.
|
||||
|
||||
Options can also be defined with -DDROPBEAR_XXX in Makefile CFLAGS
|
||||
|
||||
@@ -37,10 +36,9 @@ IMPORTANT: Many options will require "make clean" after changes */
|
||||
#define NON_INETD_MODE 1
|
||||
#define INETD_MODE 1
|
||||
|
||||
/* Setting this disables the fast exptmod bignum code. It saves ~5kB, but is
|
||||
* perhaps 20% slower for pubkey operations (it is probably worth experimenting
|
||||
* if you want to use this) */
|
||||
/*#define NO_FAST_EXPTMOD*/
|
||||
#if !(NON_INETD_MODE || INETD_MODE)
|
||||
#error "NON_INETD_MODE or INETD_MODE (or both) must be enabled."
|
||||
#endif
|
||||
|
||||
/* Set this if you want to use the DROPBEAR_SMALL_CODE option. This can save
|
||||
several kB in binary size however will make the symmetrical ciphers and hashes
|
||||
@@ -78,7 +76,7 @@ much traffic. */
|
||||
#define DROPBEAR_CLI_NETCAT 1
|
||||
|
||||
/* Whether to support "-c" and "-m" flags to choose ciphers/MACs at runtime */
|
||||
#define ENABLE_USER_ALGO_LIST 1
|
||||
#define DROPBEAR_USER_ALGO_LIST 1
|
||||
|
||||
/* Encryption - at least one required.
|
||||
* Protocol RFC requires 3DES and recommends AES128 for interoperability.
|
||||
@@ -87,10 +85,15 @@ much traffic. */
|
||||
#define DROPBEAR_AES128 1
|
||||
#define DROPBEAR_3DES 1
|
||||
#define DROPBEAR_AES256 1
|
||||
/* Compiling in Blowfish will add ~6kB to runtime heap memory usage */
|
||||
/*#define DROPBEAR_BLOWFISH*/
|
||||
#define DROPBEAR_TWOFISH256 1
|
||||
#define DROPBEAR_TWOFISH128 1
|
||||
/* Compiling in Blowfish will add ~6kB to runtime heap memory usage */
|
||||
#define DROPBEAR_BLOWFISH 0
|
||||
|
||||
#if !(DROPBEAR_AES128 || DROPBEAR_3DES || DROPBEAR_AES256 || DROPBEAR_BLOWFISH \
|
||||
|| DROPBEAR_TWOFISH256 || DROPBEAR_TWOFISH128)
|
||||
#error "At least one encryption algorithm must be enabled; 3DES and AES128 are recommended."
|
||||
#endif
|
||||
|
||||
/* Enable CBC mode for ciphers. This has security issues though
|
||||
* is the most compatible with older SSH implementations */
|
||||
@@ -130,6 +133,10 @@ If you test it please contact the Dropbear author */
|
||||
* on x86-64 */
|
||||
#define DROPBEAR_ECDSA 1
|
||||
|
||||
#if !(DROPBEAR_RSA || DROPBEAR_DSS || DROPBEAR_ECDSA)
|
||||
#error "At least one hostkey or public-key algorithm must be enabled; RSA is recommended."
|
||||
#endif
|
||||
|
||||
/* RSA must be >=1024 */
|
||||
#define DROPBEAR_DEFAULT_RSA_SIZE 2048
|
||||
/* DSS is always 1024 */
|
||||
@@ -194,27 +201,57 @@ If you test it please contact the Dropbear author */
|
||||
* PAM challenge/response.
|
||||
* You can't enable both PASSWORD and PAM. */
|
||||
|
||||
/* This requires crypt() */
|
||||
#ifdef HAVE_CRYPT
|
||||
#define DROPBEAR_SVR_PASSWORD_AUTH 1
|
||||
#else
|
||||
#define DROPBEAR_SVR_PASSWORD_AUTH 0
|
||||
#endif
|
||||
/* PAM requires ./configure --enable-pam */
|
||||
#define DROPBEAR_SVR_PAM_AUTH 0
|
||||
#if defined(HAVE_LIBPAM) && !DROPBEAR_SVR_PASSWORD_AUTH
|
||||
#define DROPBEAR_SVR_PAM_AUTH 1
|
||||
#else
|
||||
#define DROPBEAR_SVR_PAM_AUTH 0
|
||||
#endif
|
||||
|
||||
/* This requires crypt() */
|
||||
#if defined(HAVE_CRYPT) && !DROPBEAR_SVR_PAM_AUTH
|
||||
#define DROPBEAR_SVR_PASSWORD_AUTH 1
|
||||
#else
|
||||
#define DROPBEAR_SVR_PASSWORD_AUTH 0
|
||||
#endif
|
||||
|
||||
#define DROPBEAR_SVR_PUBKEY_AUTH 1
|
||||
|
||||
#if !(DROPBEAR_SVR_PASSWORD_AUTH || DROPBEAR_SVR_PAM_AUTH || DROPBEAR_SVR_PUBKEY_AUTH)
|
||||
#error "At least one server authentication type must be enabled; PUBKEY and PASSWORD are recommended."
|
||||
#endif
|
||||
|
||||
#if DROPBEAR_SVR_PASSWORD_AUTH && !HAVE_CRYPT
|
||||
#error "DROPBEAR_SVR_PASSWORD_AUTH requires `crypt()'."
|
||||
#endif
|
||||
|
||||
#if DROPBEAR_SVR_PAM_AUTH
|
||||
#if DISABLE_PAM
|
||||
#error "DROPBEAR_SVR_PAM_AUTH requires 'configure --enable-pam' to succeed."
|
||||
#endif
|
||||
#if DROPBEAR_SVR_PASSWORD_AUTH
|
||||
#error "DROPBEAR_SVR_PASSWORD_AUTH cannot be enabled at the same time as DROPBEAR_SVR_PAM_AUTH."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Whether to take public key options in
|
||||
* authorized_keys file into account */
|
||||
#define DROPBEAR_SVR_PUBKEY_OPTIONS 1
|
||||
|
||||
/* This requires getpass. */
|
||||
#ifdef HAVE_GETPASS
|
||||
#define DROPBEAR_CLI_PASSWORD_AUTH 1
|
||||
#define DROPBEAR_CLI_INTERACT_AUTH 1
|
||||
#define DROPBEAR_CLI_PASSWORD_AUTH 1
|
||||
#define DROPBEAR_CLI_INTERACT_AUTH 1
|
||||
#else
|
||||
#define DROPBEAR_CLI_PASSWORD_AUTH 0
|
||||
#define DROPBEAR_CLI_INTERACT_AUTH 0
|
||||
#endif
|
||||
#define DROPBEAR_CLI_PUBKEY_AUTH 1
|
||||
|
||||
#if !(DROPBEAR_CLI_PASSWORD_AUTH || DROPBEAR_CLI_PUBKEY_AUTH)
|
||||
#error "At least one client authentication type must be enabled; PUBKEY and PASSWORD are recommended."
|
||||
#endif
|
||||
|
||||
/* A default argument for dbclient -i <privatekey>.
|
||||
Homedir is prepended unless path begins with / */
|
||||
#define DROPBEAR_DEFAULT_CLI_AUTHKEY ".ssh/id_dropbear"
|
||||
@@ -225,7 +262,7 @@ Homedir is prepended unless path begins with / */
|
||||
* note that it will be provided for all "hidden" client-interactive
|
||||
* style prompts - if you want something more sophisticated, use
|
||||
* SSH_ASKPASS instead. Comment out this var to remove this functionality.*/
|
||||
#define DROPBEAR_PASSWORD_ENV "DROPBEAR_PASSWORD"
|
||||
#define DROPBEAR_USE_DROPBEAR_PASSWORD 1
|
||||
|
||||
/* Define this (as well as DROPBEAR_CLI_PASSWORD_AUTH) to allow the use of
|
||||
* a helper program for the ssh client. The helper program should be
|
||||
@@ -234,6 +271,10 @@ Homedir is prepended unless path begins with / */
|
||||
* return the password on standard output */
|
||||
#define DROPBEAR_CLI_ASKPASS_HELPER 0
|
||||
|
||||
#if DROPBEAR_CLI_ASKPASS_HELPER
|
||||
#define DROPBEAR_CLI_PASSWORD_AUTH 1
|
||||
#endif
|
||||
|
||||
/* Save a network roundtrip by sendng a real auth request immediately after
|
||||
* sending a query for the available methods. It is at the expense of < 100
|
||||
* bytes of extra network traffic. This is not yet enabled by default since it
|
||||
@@ -246,8 +287,8 @@ Homedir is prepended unless path begins with / */
|
||||
#define DROPBEAR_URANDOM_DEV "/dev/urandom"
|
||||
|
||||
/* Set this to use PRNGD or EGD instead of /dev/urandom or /dev/random */
|
||||
/*#define DROPBEAR_PRNGD_SOCKET "/var/run/dropbear-rng"*/
|
||||
|
||||
#define DROPBEAR_USE_PRNGD 0
|
||||
#define DROPBEAR_PRNGD_SOCKET "/var/run/dropbear-rng"
|
||||
|
||||
/* Specify the number of clients we will allow to be connected but
|
||||
* not yet authenticated. After this limit, connections are rejected */
|
||||
@@ -270,6 +311,8 @@ Homedir is prepended unless path begins with / */
|
||||
* "-q" for quiet */
|
||||
#define XAUTH_COMMAND "/usr/bin/xauth -q"
|
||||
|
||||
#define DROPBEAR_SFTPSERVER 1
|
||||
|
||||
/* if you want to enable running an sftp server (such as the one included with
|
||||
* OpenSSH), set the path below. If the path isn't defined, sftp will not
|
||||
* be enabled */
|
||||
@@ -315,4 +358,8 @@ be overridden at runtime with -I. 0 disables idle timeouts */
|
||||
/* The default path. This will often get replaced by the shell */
|
||||
#define DEFAULT_PATH "/usr/bin:/bin"
|
||||
|
||||
/* Include verbose debug output, enabled with -v at runtime.
|
||||
* This will add a reasonable amount to your executable size. */
|
||||
#define DEBUG_TRACE 0
|
||||
|
||||
#endif /* DROPBEAR_DEFAULT_OPTIONS_H_ */
|
||||
|
||||
@@ -241,7 +241,7 @@ int main(int argc, char ** argv) {
|
||||
}
|
||||
|
||||
genbits = signkey_generate_get_bits(keytype, bits);
|
||||
fprintf(stderr, "Generating %d bit %s key, this may take a while...\n", genbits, typetext);
|
||||
fprintf(stderr, "Generating %u bit %s key, this may take a while...\n", genbits, typetext);
|
||||
if (signkey_generate(keytype, bits, filename, 0) == DROPBEAR_FAILURE)
|
||||
{
|
||||
dropbear_exit("Failed to generate key.\n");
|
||||
|
||||
8
dss.c
8
dss.c
@@ -139,7 +139,7 @@ void dss_key_free(dropbear_dss_key *key) {
|
||||
* mpint g
|
||||
* mpint y
|
||||
*/
|
||||
void buf_put_dss_pub_key(buffer* buf, dropbear_dss_key *key) {
|
||||
void buf_put_dss_pub_key(buffer* buf, const dropbear_dss_key *key) {
|
||||
|
||||
dropbear_assert(key != NULL);
|
||||
buf_putstring(buf, SSH_SIGNKEY_DSS, SSH_SIGNKEY_DSS_LEN);
|
||||
@@ -151,7 +151,7 @@ void buf_put_dss_pub_key(buffer* buf, dropbear_dss_key *key) {
|
||||
}
|
||||
|
||||
/* Same as buf_put_dss_pub_key, but with the private "x" key appended */
|
||||
void buf_put_dss_priv_key(buffer* buf, dropbear_dss_key *key) {
|
||||
void buf_put_dss_priv_key(buffer* buf, const dropbear_dss_key *key) {
|
||||
|
||||
dropbear_assert(key != NULL);
|
||||
buf_put_dss_pub_key(buf, key);
|
||||
@@ -162,7 +162,7 @@ void buf_put_dss_priv_key(buffer* buf, dropbear_dss_key *key) {
|
||||
#if DROPBEAR_SIGNKEY_VERIFY
|
||||
/* Verify a DSS signature (in buf) made on data by the key given.
|
||||
* returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */
|
||||
int buf_dss_verify(buffer* buf, dropbear_dss_key *key, buffer *data_buf) {
|
||||
int buf_dss_verify(buffer* buf, const dropbear_dss_key *key, const buffer *data_buf) {
|
||||
unsigned char msghash[SHA1_HASH_SIZE];
|
||||
hash_state hs;
|
||||
int ret = DROPBEAR_FAILURE;
|
||||
@@ -280,7 +280,7 @@ out:
|
||||
|
||||
/* Sign the data presented with key, writing the signature contents
|
||||
* to the buffer */
|
||||
void buf_put_dss_sign(buffer* buf, dropbear_dss_key *key, buffer *data_buf) {
|
||||
void buf_put_dss_sign(buffer* buf, const dropbear_dss_key *key, const buffer *data_buf) {
|
||||
unsigned char msghash[SHA1_HASH_SIZE];
|
||||
unsigned int writelen;
|
||||
unsigned int i;
|
||||
|
||||
8
dss.h
8
dss.h
@@ -44,14 +44,14 @@ typedef struct {
|
||||
#define DSS_P_BITS 1024
|
||||
#define DSS_Q_BITS 160
|
||||
|
||||
void buf_put_dss_sign(buffer* buf, dropbear_dss_key *key, buffer *data_buf);
|
||||
void buf_put_dss_sign(buffer* buf, const dropbear_dss_key *key, const buffer *data_buf);
|
||||
#if DROPBEAR_SIGNKEY_VERIFY
|
||||
int buf_dss_verify(buffer* buf, dropbear_dss_key *key, buffer *data_buf);
|
||||
int buf_dss_verify(buffer* buf, const dropbear_dss_key *key, const buffer *data_buf);
|
||||
#endif
|
||||
int buf_get_dss_pub_key(buffer* buf, dropbear_dss_key *key);
|
||||
int buf_get_dss_priv_key(buffer* buf, dropbear_dss_key *key);
|
||||
void buf_put_dss_pub_key(buffer* buf, dropbear_dss_key *key);
|
||||
void buf_put_dss_priv_key(buffer* buf, dropbear_dss_key *key);
|
||||
void buf_put_dss_pub_key(buffer* buf, const dropbear_dss_key *key);
|
||||
void buf_put_dss_priv_key(buffer* buf, const dropbear_dss_key *key);
|
||||
void dss_key_free(dropbear_dss_key *key);
|
||||
|
||||
#endif /* DROPBEAR_DSS */
|
||||
|
||||
41
ecc.c
41
ecc.c
@@ -82,7 +82,7 @@ ecc_key * new_ecc_key(void) {
|
||||
|
||||
/* Copied from libtomcrypt ecc_import.c (version there is static), modified
|
||||
for different mp_int pointer without LTC_SOURCE */
|
||||
static int ecc_is_point(ecc_key *key)
|
||||
static int ecc_is_point(const ecc_key *key)
|
||||
{
|
||||
mp_int *prime, *b, *t1, *t2;
|
||||
int err;
|
||||
@@ -213,7 +213,7 @@ ecc_key * buf_get_ecc_raw_pubkey(buffer *buf, const struct dropbear_ecc_curve *c
|
||||
|
||||
/* a modified version of libtomcrypt's "ecc_shared_secret" to output
|
||||
a mp_int instead. */
|
||||
mp_int * dropbear_ecc_shared_secret(ecc_key *public_key, ecc_key *private_key)
|
||||
mp_int * dropbear_ecc_shared_secret(ecc_key *public_key, const ecc_key *private_key)
|
||||
{
|
||||
ecc_point *result = NULL;
|
||||
mp_int *prime = NULL, *shared_secret = NULL;
|
||||
@@ -221,46 +221,41 @@ mp_int * dropbear_ecc_shared_secret(ecc_key *public_key, ecc_key *private_key)
|
||||
|
||||
/* type valid? */
|
||||
if (private_key->type != PK_PRIVATE) {
|
||||
goto done;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (private_key->dp != public_key->dp) {
|
||||
goto done;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* make new point */
|
||||
result = ltc_ecc_new_point();
|
||||
if (result == NULL) {
|
||||
goto done;
|
||||
goto out;
|
||||
}
|
||||
|
||||
prime = m_malloc(sizeof(*prime));
|
||||
m_mp_init(prime);
|
||||
|
||||
if (mp_read_radix(prime, (char *)private_key->dp->prime, 16) != CRYPT_OK) {
|
||||
goto done;
|
||||
goto out;
|
||||
}
|
||||
if (ltc_mp.ecc_ptmul(private_key->k, &public_key->pubkey, result, prime, 1) != CRYPT_OK) {
|
||||
goto done;
|
||||
goto out;
|
||||
}
|
||||
|
||||
shared_secret = m_malloc(sizeof(*shared_secret));
|
||||
m_mp_init(shared_secret);
|
||||
if (mp_copy(result->x, shared_secret) != CRYPT_OK) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
mp_clear(prime);
|
||||
m_free(prime);
|
||||
ltc_ecc_del_point(result);
|
||||
|
||||
err = DROPBEAR_SUCCESS;
|
||||
done:
|
||||
if (err == DROPBEAR_SUCCESS) {
|
||||
shared_secret = m_malloc(sizeof(*shared_secret));
|
||||
m_mp_init(shared_secret);
|
||||
mp_copy(result->x, shared_secret);
|
||||
}
|
||||
|
||||
if (prime) {
|
||||
mp_clear(prime);
|
||||
m_free(prime);
|
||||
}
|
||||
if (result)
|
||||
{
|
||||
ltc_ecc_del_point(result);
|
||||
}
|
||||
|
||||
out:
|
||||
if (err == DROPBEAR_FAILURE) {
|
||||
dropbear_exit("ECC error");
|
||||
}
|
||||
|
||||
2
ecc.h
2
ecc.h
@@ -29,7 +29,7 @@ void buf_put_ecc_raw_pubkey_string(buffer *buf, ecc_key *key);
|
||||
ecc_key * buf_get_ecc_raw_pubkey(buffer *buf, const struct dropbear_ecc_curve *curve);
|
||||
int buf_get_ecc_privkey_string(buffer *buf, ecc_key *key);
|
||||
|
||||
mp_int * dropbear_ecc_shared_secret(ecc_key *pub_key, ecc_key *priv_key);
|
||||
mp_int * dropbear_ecc_shared_secret(ecc_key *pub_key, const ecc_key *priv_key);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
6
ecdsa.c
6
ecdsa.c
@@ -15,7 +15,7 @@ int signkey_is_ecdsa(enum signkey_type type)
|
||||
|| type == DROPBEAR_SIGNKEY_ECDSA_NISTP521;
|
||||
}
|
||||
|
||||
enum signkey_type ecdsa_signkey_type(ecc_key * key) {
|
||||
enum signkey_type ecdsa_signkey_type(const ecc_key * key) {
|
||||
#if DROPBEAR_ECC_256
|
||||
if (key->dp == ecc_curve_nistp256.dp) {
|
||||
return DROPBEAR_SIGNKEY_ECDSA_NISTP256;
|
||||
@@ -154,7 +154,7 @@ void buf_put_ecdsa_priv_key(buffer *buf, ecc_key *key) {
|
||||
buf_putmpint(buf, key->k);
|
||||
}
|
||||
|
||||
void buf_put_ecdsa_sign(buffer *buf, ecc_key *key, buffer *data_buf) {
|
||||
void buf_put_ecdsa_sign(buffer *buf, const ecc_key *key, const buffer *data_buf) {
|
||||
/* Based on libtomcrypt's ecc_sign_hash but without the asn1 */
|
||||
int err = DROPBEAR_FAILURE;
|
||||
struct dropbear_ecc_curve *curve = NULL;
|
||||
@@ -272,7 +272,7 @@ out:
|
||||
}
|
||||
|
||||
|
||||
int buf_ecdsa_verify(buffer *buf, ecc_key *key, buffer *data_buf) {
|
||||
int buf_ecdsa_verify(buffer *buf, const ecc_key *key, const buffer *data_buf) {
|
||||
/* Based on libtomcrypt's ecc_verify_hash but without the asn1 */
|
||||
int ret = DROPBEAR_FAILURE;
|
||||
hash_state hs;
|
||||
|
||||
6
ecdsa.h
6
ecdsa.h
@@ -23,10 +23,10 @@ ecc_key *buf_get_ecdsa_pub_key(buffer* buf);
|
||||
ecc_key *buf_get_ecdsa_priv_key(buffer *buf);
|
||||
void buf_put_ecdsa_pub_key(buffer *buf, ecc_key *key);
|
||||
void buf_put_ecdsa_priv_key(buffer *buf, ecc_key *key);
|
||||
enum signkey_type ecdsa_signkey_type(ecc_key * key);
|
||||
enum signkey_type ecdsa_signkey_type(const ecc_key * key);
|
||||
|
||||
void buf_put_ecdsa_sign(buffer *buf, ecc_key *key, buffer *data_buf);
|
||||
int buf_ecdsa_verify(buffer *buf, ecc_key *key, buffer *data_buf);
|
||||
void buf_put_ecdsa_sign(buffer *buf, const ecc_key *key, const buffer *data_buf);
|
||||
int buf_ecdsa_verify(buffer *buf, const ecc_key *key, const buffer *data_buf);
|
||||
/* Returns 1 on success */
|
||||
int signkey_is_ecdsa(enum signkey_type type);
|
||||
|
||||
|
||||
20
gendss.c
20
gendss.c
@@ -37,11 +37,11 @@
|
||||
|
||||
#if DROPBEAR_DSS
|
||||
|
||||
static void getq(dropbear_dss_key *key);
|
||||
static void getp(dropbear_dss_key *key, unsigned int size);
|
||||
static void getg(dropbear_dss_key *key);
|
||||
static void getx(dropbear_dss_key *key);
|
||||
static void gety(dropbear_dss_key *key);
|
||||
static void getq(const dropbear_dss_key *key);
|
||||
static void getp(const dropbear_dss_key *key, unsigned int size);
|
||||
static void getg(const dropbear_dss_key *key);
|
||||
static void getx(const dropbear_dss_key *key);
|
||||
static void gety(const dropbear_dss_key *key);
|
||||
|
||||
dropbear_dss_key * gen_dss_priv_key(unsigned int size) {
|
||||
|
||||
@@ -65,7 +65,7 @@ dropbear_dss_key * gen_dss_priv_key(unsigned int size) {
|
||||
|
||||
}
|
||||
|
||||
static void getq(dropbear_dss_key *key) {
|
||||
static void getq(const dropbear_dss_key *key) {
|
||||
|
||||
unsigned char buf[QSIZE];
|
||||
|
||||
@@ -83,7 +83,7 @@ static void getq(dropbear_dss_key *key) {
|
||||
}
|
||||
}
|
||||
|
||||
static void getp(dropbear_dss_key *key, unsigned int size) {
|
||||
static void getp(const dropbear_dss_key *key, unsigned int size) {
|
||||
|
||||
DEF_MP_INT(tempX);
|
||||
DEF_MP_INT(tempC);
|
||||
@@ -142,7 +142,7 @@ static void getp(dropbear_dss_key *key, unsigned int size) {
|
||||
m_free(buf);
|
||||
}
|
||||
|
||||
static void getg(dropbear_dss_key * key) {
|
||||
static void getg(const dropbear_dss_key * key) {
|
||||
|
||||
DEF_MP_INT(div);
|
||||
DEF_MP_INT(h);
|
||||
@@ -179,12 +179,12 @@ static void getg(dropbear_dss_key * key) {
|
||||
mp_clear_multi(&div, &h, &val, NULL);
|
||||
}
|
||||
|
||||
static void getx(dropbear_dss_key *key) {
|
||||
static void getx(const dropbear_dss_key *key) {
|
||||
|
||||
gen_random_mpint(key->q, key->x);
|
||||
}
|
||||
|
||||
static void gety(dropbear_dss_key *key) {
|
||||
static void gety(const dropbear_dss_key *key) {
|
||||
|
||||
if (mp_exptmod(key->g, key->x, key->p, key->y) != MP_OKAY) {
|
||||
fprintf(stderr, "DSS key generation failed\n");
|
||||
|
||||
2
kex.h
2
kex.h
@@ -51,7 +51,7 @@ void kexecdh_comb_key(struct kex_ecdh_param *param, buffer *pub_them,
|
||||
#if DROPBEAR_CURVE25519
|
||||
struct kex_curve25519_param *gen_kexcurve25519_param(void);
|
||||
void free_kexcurve25519_param(struct kex_curve25519_param *param);
|
||||
void kexcurve25519_comb_key(struct kex_curve25519_param *param, buffer *pub_them,
|
||||
void kexcurve25519_comb_key(const struct kex_curve25519_param *param, const buffer *pub_them,
|
||||
sign_key *hostkey);
|
||||
#endif
|
||||
|
||||
|
||||
18
keyimport.c
18
keyimport.c
@@ -55,9 +55,9 @@ static const unsigned char OID_SEC521R1_BLOB[] = {0x2b, 0x81, 0x04, 0x00, 0x23};
|
||||
((unsigned long)(unsigned char)(cp)[3]))
|
||||
|
||||
static int openssh_encrypted(const char *filename);
|
||||
static sign_key *openssh_read(const char *filename, char *passphrase);
|
||||
static sign_key *openssh_read(const char *filename, const char *passphrase);
|
||||
static int openssh_write(const char *filename, sign_key *key,
|
||||
char *passphrase);
|
||||
const char *passphrase);
|
||||
|
||||
static int dropbear_write(const char*filename, sign_key * key);
|
||||
static sign_key *dropbear_read(const char* filename);
|
||||
@@ -83,7 +83,7 @@ int import_encrypted(const char* filename, int filetype) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
sign_key *import_read(const char *filename, char *passphrase, int filetype) {
|
||||
sign_key *import_read(const char *filename, const char *passphrase, int filetype) {
|
||||
|
||||
if (filetype == KEYFILE_OPENSSH) {
|
||||
return openssh_read(filename, passphrase);
|
||||
@@ -97,7 +97,7 @@ sign_key *import_read(const char *filename, char *passphrase, int filetype) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int import_write(const char *filename, sign_key *key, char *passphrase,
|
||||
int import_write(const char *filename, sign_key *key, const char *passphrase,
|
||||
int filetype) {
|
||||
|
||||
if (filetype == KEYFILE_OPENSSH) {
|
||||
@@ -194,7 +194,7 @@ out:
|
||||
)
|
||||
|
||||
/* cpl has to be less than 100 */
|
||||
static void base64_encode_fp(FILE * fp, unsigned char *data,
|
||||
static void base64_encode_fp(FILE * fp, const unsigned char *data,
|
||||
int datalen, int cpl)
|
||||
{
|
||||
unsigned char out[100];
|
||||
@@ -509,7 +509,7 @@ static int openssh_encrypted(const char *filename)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static sign_key *openssh_read(const char *filename, char * UNUSED(passphrase))
|
||||
static sign_key *openssh_read(const char *filename, const char * UNUSED(passphrase))
|
||||
{
|
||||
struct openssh_key *key;
|
||||
unsigned char *p;
|
||||
@@ -828,7 +828,7 @@ static sign_key *openssh_read(const char *filename, char * UNUSED(passphrase))
|
||||
}
|
||||
|
||||
static int openssh_write(const char *filename, sign_key *key,
|
||||
char *passphrase)
|
||||
const char *passphrase)
|
||||
{
|
||||
buffer * keyblob = NULL;
|
||||
buffer * extrablob = NULL; /* used for calculated values to write */
|
||||
@@ -870,7 +870,7 @@ static int openssh_write(const char *filename, sign_key *key,
|
||||
*/
|
||||
numbers[0].start = zero; numbers[0].bytes = 1; zero[0] = '\0';
|
||||
|
||||
#ifdef DROPBEAR_RSA
|
||||
#if DROPBEAR_RSA
|
||||
if (key->type == DROPBEAR_SIGNKEY_RSA) {
|
||||
|
||||
if (key->rsakey->p == NULL || key->rsakey->q == NULL) {
|
||||
@@ -966,7 +966,7 @@ static int openssh_write(const char *filename, sign_key *key,
|
||||
}
|
||||
#endif /* DROPBEAR_RSA */
|
||||
|
||||
#ifdef DROPBEAR_DSS
|
||||
#if DROPBEAR_DSS
|
||||
if (key->type == DROPBEAR_SIGNKEY_DSS) {
|
||||
|
||||
/* p */
|
||||
|
||||
@@ -34,9 +34,9 @@ enum {
|
||||
KEYFILE_SSHCOM
|
||||
};
|
||||
|
||||
int import_write(const char *filename, sign_key *key, char *passphrase,
|
||||
int import_write(const char *filename, sign_key *key, const char *passphrase,
|
||||
int filetype);
|
||||
sign_key *import_read(const char *filename, char *passphrase, int filetype);
|
||||
sign_key *import_read(const char *filename, const char *passphrase, int filetype);
|
||||
int import_encrypted(const char* filename, int filetype);
|
||||
|
||||
#endif /* DROPBEAR_KEYIMPORT_H_ */
|
||||
|
||||
135
libtomcrypt/.travis.yml
Normal file
135
libtomcrypt/.travis.yml
Normal file
@@ -0,0 +1,135 @@
|
||||
dist: trusty
|
||||
sudo: required
|
||||
|
||||
language: c
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.8
|
||||
packages:
|
||||
- clang-3.8
|
||||
|
||||
install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install libtommath-dev
|
||||
|
||||
before_script:
|
||||
- gem install coveralls-lcov
|
||||
- curl http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz | tar xz
|
||||
- export PATH=$PATH:`pwd`/lcov-1.11/bin
|
||||
- curl -s https://packagecloud.io/install/repositories/libtom/packages/script.deb.sh | sudo bash
|
||||
- sudo apt-get install libtfm-dev=0.13-5
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
- /^release\/.*$/
|
||||
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
script:
|
||||
- bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile V=1" "-DUSE_LTM -DLTM_DESC" "-ltommath"
|
||||
- bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile.shared V=1" "-DUSE_TFM -DTFM_DESC" "-ltfm"
|
||||
env:
|
||||
- |
|
||||
BUILDSCRIPT="check_source.sh"
|
||||
BUILDNAME="CHECK_SOURCES"
|
||||
BUILDOPTIONS=" "
|
||||
- |
|
||||
BUILDSCRIPT="scan_build.sh"
|
||||
BUILDNAME="SCAN_BUILD"
|
||||
BUILDOPTIONS=" "
|
||||
- |
|
||||
BUILDSCRIPT="coverage.sh"
|
||||
BUILDNAME="COVERAGE"
|
||||
BUILDOPTIONS=" "
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="STOCK"
|
||||
BUILDOPTIONS=" "
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="EASY"
|
||||
BUILDOPTIONS="-DLTC_EASY"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="SMALL"
|
||||
BUILDOPTIONS="-DLTC_SMALL_CODE"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="NOTABLES"
|
||||
BUILDOPTIONS="-DLTC_NO_TABLES"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="SMALL+NOTABLES"
|
||||
BUILDOPTIONS="-DLTC_SMALL_CODE -DLTC_NO_TABLES"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="CLEANSTACK"
|
||||
BUILDOPTIONS="-DLTC_CLEAN_STACK"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="CLEANSTACK+SMALL"
|
||||
BUILDOPTIONS="-DLTC_SMALL_CODE -DLTC_CLEAN_STACK"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="CLEANSTACK+NOTABLES"
|
||||
BUILDOPTIONS="-DLTC_NO_TABLES -DLTC_CLEAN_STACK"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="CLEANSTACK+NOTABLES+SMALL"
|
||||
BUILDOPTIONS="-DLTC_NO_TABLES -DLTC_CLEAN_STACK -DLTC_SMALL_CODE"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="NO_FAST"
|
||||
BUILDOPTIONS="-DLTC_NO_FAST"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="NO_FAST+NOTABLES"
|
||||
BUILDOPTIONS="-DLTC_NO_FAST -DLTC_NO_TABLES"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="NO_ASM"
|
||||
BUILDOPTIONS="-DLTC_NO_ASM"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="NO_TIMING_RESISTANCE"
|
||||
BUILDOPTIONS="-DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="CLEANSTACK+NOTABLES+SMALL+NO_ASM+NO_TIMING_RESISTANCE"
|
||||
BUILDOPTIONS="-DLTC_CLEAN_STACK -DLTC_NO_TABLES -DLTC_SMALL_CODE -DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="PTHREAD"
|
||||
BUILDOPTIONS="-DLTC_PTHREAD"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="CLEANSTACK+NOTABLES+SMALL+NO_ASM+NO_TIMING_RESISTANCE+PTHREAD"
|
||||
BUILDOPTIONS="-DLTC_CLEAN_STACK -DLTC_NO_TABLES -DLTC_SMALL_CODE -DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING -DLTC_PTHREAD"
|
||||
- |
|
||||
BUILDSCRIPT="testbuild.sh"
|
||||
BUILDNAME="NOTEST"
|
||||
BUILDOPTIONS="-DLTC_NO_TEST"
|
||||
- |
|
||||
BUILDSCRIPT="testbuild.sh"
|
||||
BUILDNAME="NOFILE"
|
||||
BUILDOPTIONS="-DLTC_NO_FILE"
|
||||
|
||||
after_failure:
|
||||
- cat test_std.txt
|
||||
- cat test_err.txt
|
||||
- cat tv.txt
|
||||
|
||||
after_script:
|
||||
- cat gcc_1.txt
|
||||
- cat gcc_2.txt
|
||||
|
||||
notifications:
|
||||
irc: "chat.freenode.net#libtom-notifications"
|
||||
@@ -1,5 +1,29 @@
|
||||
LibTomCrypt is licensed under DUAL licensing terms.
|
||||
|
||||
Choose and use the license of your needs.
|
||||
|
||||
[LICENSE #1]
|
||||
|
||||
LibTomCrypt is public domain. As should all quality software be.
|
||||
|
||||
Tom St Denis
|
||||
|
||||
[/LICENSE #1]
|
||||
|
||||
[LICENSE #2]
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||
|
||||
[/LICENSE #2]
|
||||
|
||||
@@ -1,188 +1,154 @@
|
||||
# MAKEFILE for linux GCC
|
||||
# MAKEFILE that is intended to be compatible with any kind of make (GNU make, BSD make, ...)
|
||||
# works on: Linux, *BSD, Cygwin, AIX, HP-UX and hopefully other UNIX systems
|
||||
#
|
||||
# Tom St Denis
|
||||
# Modified by Clay Culver
|
||||
|
||||
# The version
|
||||
VERSION=1.17
|
||||
|
||||
PLATFORM := $(shell uname | sed -e 's/_.*//')
|
||||
# Please do not use here neither any special make syntax nor any unusual tools/utilities!
|
||||
#
|
||||
# BEWARE: variables OBJECTS, TOBJECTS, HEADERS, VERSION are updated via ./updatemakes.sh
|
||||
|
||||
### USAGE:
|
||||
#
|
||||
# make -f makefile.unix all
|
||||
# ./test
|
||||
# make -f makefile.unix install
|
||||
#
|
||||
#Or:
|
||||
#
|
||||
# make -f makefile.unix CFLAGS="-O3 -DUSE_LTM -DLTM_DESC -I/path/to/libtommath" EXTRALIBS=/path/to/libtommath/libtommath.a all
|
||||
# ./test
|
||||
# make -f makefile.unix PREFIX=/opt/libtom install
|
||||
#
|
||||
#Or if you are using Intel C compiler you might need something like:
|
||||
#
|
||||
# make -f makefile.unix CC=icc AR=xiar CFLAGS="-fast -DUSE_LTM -DLTM_DESC -I/path/to/libtommath" EXTRALIBS=/path/to/libtommath/libtommath.a all
|
||||
#
|
||||
|
||||
# Dropbear can build out of tree
|
||||
VPATH=@srcdir@
|
||||
srcdir=@srcdir@
|
||||
|
||||
# Compiler and Linker Names
|
||||
#CC=gcc
|
||||
#LD=ld
|
||||
#The following can be overridden from command line e.g. "make -f makefile.unix CC=gcc ARFLAGS=rcs"
|
||||
DESTDIR =
|
||||
PREFIX = /usr/local
|
||||
LIBPATH = $(PREFIX)/lib
|
||||
INCPATH = $(PREFIX)/include
|
||||
DATAPATH = $(PREFIX)/share/doc/libtomcrypt/pdf
|
||||
BINPATH = $(PREFIX)/bin
|
||||
# Dropbear passes paths from parent makefile
|
||||
#CC = cc
|
||||
#AR = ar
|
||||
ARFLAGS = r
|
||||
#RANLIB = ranlib
|
||||
#CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath
|
||||
EXTRALIBS = ../libtommath/libtommath.a
|
||||
|
||||
# Archiver [makes .a files]
|
||||
#AR=ar
|
||||
#ARFLAGS=r
|
||||
#Compilation flags
|
||||
LTC_CFLAGS = -Isrc/headers/ -I$(srcdir)/src/headers/ -I../ -I$(srcdir)/../ -DLTC_SOURCE -I../libtommath/ -I$(srcdir)/../libtommath/ $(CFLAGS)
|
||||
LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS)
|
||||
VERSION=1.18.1
|
||||
|
||||
ifndef MAKE
|
||||
MAKE=make
|
||||
endif
|
||||
#Libraries to be created (this makefile builds only static libraries)
|
||||
LIBMAIN_S =libtomcrypt.a
|
||||
|
||||
# ranlib tools
|
||||
ifndef RANLIB
|
||||
ifeq ($(PLATFORM), Darwin)
|
||||
RANLIB=ranlib -c
|
||||
else
|
||||
RANLIB=ranlib
|
||||
endif
|
||||
endif
|
||||
|
||||
# Compilation flags. Note the += does not write over the user's CFLAGS!
|
||||
# The rest of the flags come from the parent Dropbear makefile
|
||||
CFLAGS += -c -Isrc/headers/ -I$(srcdir)/src/headers/ -I../ -I$(srcdir)/../ -DLTC_SOURCE -I../libtommath/ -I$(srcdir)/../libtommath/
|
||||
|
||||
# additional warnings (newer GCC 3.4 and higher)
|
||||
ifdef GCC_34
|
||||
CFLAGS += -Wsystem-headers -Wdeclaration-after-statement -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wmissing-prototypes \
|
||||
-Wmissing-declarations -Wpointer-arith
|
||||
endif
|
||||
|
||||
ifndef IGNORE_SPEED
|
||||
|
||||
# optimize for SPEED
|
||||
#CFLAGS += -O3 -funroll-loops
|
||||
|
||||
# add -fomit-frame-pointer. hinders debugging!
|
||||
#CFLAGS += -fomit-frame-pointer
|
||||
|
||||
# optimize for SIZE
|
||||
#CFLAGS += -Os -DLTC_SMALL_CODE
|
||||
|
||||
endif
|
||||
|
||||
# older GCCs can't handle the "rotate with immediate" ROLc/RORc/etc macros
|
||||
# define this to help
|
||||
#CFLAGS += -DLTC_NO_ROLC
|
||||
|
||||
# compile for DEBUGING (required for ccmalloc checking!!!)
|
||||
#CFLAGS += -g3 -DLTC_NO_ASM
|
||||
|
||||
#Output filenames for various targets.
|
||||
ifndef LIBNAME
|
||||
LIBNAME=libtomcrypt.a
|
||||
endif
|
||||
ifndef LIBTEST
|
||||
LIBTEST=libtomcrypt_prof.a
|
||||
endif
|
||||
LIBTEST_S=$(LIBTEST)
|
||||
|
||||
HASH=hashsum
|
||||
CRYPT=encrypt
|
||||
SMALL=small
|
||||
PROF=x86_prof
|
||||
TV=tv_gen
|
||||
MULTI=multi
|
||||
TIMING=timing
|
||||
TEST=test
|
||||
|
||||
#LIBPATH-The directory for libtomcrypt to be installed to.
|
||||
#INCPATH-The directory to install the header files for libtomcrypt.
|
||||
#DATAPATH-The directory to install the pdf docs.
|
||||
ifndef DESTDIR
|
||||
DESTDIR=
|
||||
endif
|
||||
|
||||
ifndef LIBPATH
|
||||
LIBPATH=/usr/lib
|
||||
endif
|
||||
ifndef INCPATH
|
||||
INCPATH=/usr/include
|
||||
endif
|
||||
ifndef DATAPATH
|
||||
DATAPATH=/usr/share/doc/libtomcrypt/pdf
|
||||
endif
|
||||
|
||||
#Who do we install as?
|
||||
ifdef INSTALL_USER
|
||||
USER=$(INSTALL_USER)
|
||||
else
|
||||
USER=root
|
||||
endif
|
||||
|
||||
ifdef INSTALL_GROUP
|
||||
GROUP=$(INSTALL_GROUP)
|
||||
else
|
||||
GROUP=wheel
|
||||
endif
|
||||
|
||||
#List of objects to compile.
|
||||
#START_INS
|
||||
OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \
|
||||
src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o src/ciphers/kseed.o \
|
||||
src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o src/ciphers/rc6.o \
|
||||
src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/safer/safer_tab.o \
|
||||
src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \
|
||||
src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \
|
||||
src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \
|
||||
src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \
|
||||
#List of objects to compile (all goes to libtomcrypt.a)
|
||||
OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \
|
||||
src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \
|
||||
src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \
|
||||
src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \
|
||||
src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \
|
||||
src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \
|
||||
src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \
|
||||
src/encauth/ccm/ccm_test.o src/encauth/chachapoly/chacha20poly1305_add_aad.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_decrypt.o src/encauth/chachapoly/chacha20poly1305_done.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_encrypt.o src/encauth/chachapoly/chacha20poly1305_init.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_memory.o src/encauth/chachapoly/chacha20poly1305_setiv.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_test.o src/encauth/eax/eax_addheader.o \
|
||||
src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \
|
||||
src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \
|
||||
src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \
|
||||
src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \
|
||||
src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \
|
||||
src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \
|
||||
src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \
|
||||
src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o \
|
||||
src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_encrypt.o \
|
||||
src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o src/encauth/ocb/ocb_shift_xor.o \
|
||||
src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \
|
||||
src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \
|
||||
src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \
|
||||
src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \
|
||||
src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \
|
||||
src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \
|
||||
src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \
|
||||
src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \
|
||||
src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o src/encauth/ocb3/ocb3_int_ntz.o \
|
||||
src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o src/hashes/blake2b.o \
|
||||
src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \
|
||||
src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \
|
||||
src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \
|
||||
src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \
|
||||
src/hashes/sha2/sha256.o src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o \
|
||||
src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o \
|
||||
src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o \
|
||||
src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \
|
||||
src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \
|
||||
src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \
|
||||
src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \
|
||||
src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \
|
||||
src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \
|
||||
src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \
|
||||
src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \
|
||||
src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/blake2/blake2bmac.o \
|
||||
src/mac/blake2/blake2bmac_file.o src/mac/blake2/blake2bmac_memory.o \
|
||||
src/mac/blake2/blake2bmac_memory_multi.o src/mac/blake2/blake2bmac_test.o src/mac/blake2/blake2smac.o \
|
||||
src/mac/blake2/blake2smac_file.o src/mac/blake2/blake2smac_memory.o \
|
||||
src/mac/blake2/blake2smac_memory_multi.o src/mac/blake2/blake2smac_test.o src/mac/f9/f9_done.o \
|
||||
src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \
|
||||
src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \
|
||||
src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \
|
||||
src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \
|
||||
src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \
|
||||
src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \
|
||||
src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \
|
||||
src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \
|
||||
src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \
|
||||
src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \
|
||||
src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \
|
||||
src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \
|
||||
src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \
|
||||
src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \
|
||||
src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \
|
||||
src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \
|
||||
src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \
|
||||
src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \
|
||||
src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \
|
||||
src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \
|
||||
src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \
|
||||
src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \
|
||||
src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \
|
||||
src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \
|
||||
src/math/radix_to_bin.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \
|
||||
src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \
|
||||
src/misc/compare_testvector.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \
|
||||
src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \
|
||||
src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \
|
||||
src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \
|
||||
src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \
|
||||
src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \
|
||||
src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \
|
||||
src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \
|
||||
src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \
|
||||
src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \
|
||||
src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o \
|
||||
src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \
|
||||
src/misc/crypt/crypt_register_all_ciphers.o src/misc/crypt/crypt_register_all_hashes.o \
|
||||
src/misc/crypt/crypt_register_all_prngs.o src/misc/crypt/crypt_register_cipher.o \
|
||||
src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \
|
||||
src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \
|
||||
src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/pkcs5/pkcs_5_1.o \
|
||||
src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o \
|
||||
src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o \
|
||||
src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o \
|
||||
src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o \
|
||||
src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o \
|
||||
src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o \
|
||||
src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o \
|
||||
src/modes/ecb/ecb_encrypt.o src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o \
|
||||
src/modes/f8/f8_encrypt.o src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o \
|
||||
src/modes/f8/f8_test_mode.o src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o \
|
||||
src/modes/lrw/lrw_encrypt.o src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o \
|
||||
src/modes/lrw/lrw_setiv.o src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o \
|
||||
src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o src/modes/ofb/ofb_encrypt.o \
|
||||
src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o src/modes/ofb/ofb_start.o \
|
||||
src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o src/modes/xts/xts_encrypt.o \
|
||||
src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o src/modes/xts/xts_test.o \
|
||||
src/pk/asn1/der/bit/der_decode_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \
|
||||
src/pk/asn1/der/bit/der_length_bit_string.o src/pk/asn1/der/boolean/der_decode_boolean.o \
|
||||
src/pk/asn1/der/boolean/der_encode_boolean.o src/pk/asn1/der/boolean/der_length_boolean.o \
|
||||
src/pk/asn1/der/choice/der_decode_choice.o src/pk/asn1/der/ia5/der_decode_ia5_string.o \
|
||||
src/pk/asn1/der/ia5/der_encode_ia5_string.o src/pk/asn1/der/ia5/der_length_ia5_string.o \
|
||||
src/pk/asn1/der/integer/der_decode_integer.o src/pk/asn1/der/integer/der_encode_integer.o \
|
||||
src/pk/asn1/der/integer/der_length_integer.o \
|
||||
src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \
|
||||
src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \
|
||||
src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \
|
||||
src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \
|
||||
src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \
|
||||
src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \
|
||||
src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \
|
||||
src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \
|
||||
src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \
|
||||
src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \
|
||||
src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \
|
||||
src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \
|
||||
src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o src/modes/lrw/lrw_encrypt.o \
|
||||
src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o src/modes/lrw/lrw_setiv.o \
|
||||
src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \
|
||||
src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \
|
||||
src/modes/ofb/ofb_start.o src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o \
|
||||
src/modes/xts/xts_encrypt.o src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o \
|
||||
src/modes/xts/xts_test.o src/pk/asn1/der/bit/der_decode_bit_string.o \
|
||||
src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \
|
||||
src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \
|
||||
src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \
|
||||
src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \
|
||||
src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \
|
||||
src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \
|
||||
src/pk/asn1/der/generalizedtime/der_length_generalizedtime.o \
|
||||
src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \
|
||||
src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \
|
||||
src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \
|
||||
src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \
|
||||
src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \
|
||||
src/pk/asn1/der/object_identifier/der_length_object_identifier.o \
|
||||
@@ -194,22 +160,32 @@ src/pk/asn1/der/printable_string/der_length_printable_string.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_ex.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_multi.o \
|
||||
src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_ex.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_multi.o src/pk/asn1/der/sequence/der_length_sequence.o \
|
||||
src/pk/asn1/der/sequence/der_sequence_free.o src/pk/asn1/der/set/der_encode_set.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_multi.o \
|
||||
src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \
|
||||
src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \
|
||||
src/pk/asn1/der/sequence/der_sequence_shrink.o src/pk/asn1/der/set/der_encode_set.o \
|
||||
src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \
|
||||
src/pk/asn1/der/short_integer/der_encode_short_integer.o \
|
||||
src/pk/asn1/der/short_integer/der_length_short_integer.o src/pk/asn1/der/utctime/der_decode_utctime.o \
|
||||
src/pk/asn1/der/utctime/der_encode_utctime.o src/pk/asn1/der/utctime/der_length_utctime.o \
|
||||
src/pk/asn1/der/utf8/der_decode_utf8_string.o src/pk/asn1/der/utf8/der_encode_utf8_string.o \
|
||||
src/pk/asn1/der/utf8/der_length_utf8_string.o src/pk/dsa/dsa_decrypt_key.o \
|
||||
src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \
|
||||
src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \
|
||||
src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc_ansi_x963_export.o \
|
||||
src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o src/pk/ecc/ecc_decrypt_key.o \
|
||||
src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \
|
||||
src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \
|
||||
src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \
|
||||
src/pk/asn1/der/short_integer/der_length_short_integer.o \
|
||||
src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \
|
||||
src/pk/asn1/der/teletex_string/der_length_teletex_string.o \
|
||||
src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \
|
||||
src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \
|
||||
src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \
|
||||
src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_key.o \
|
||||
src/pk/dh/dh_free.o src/pk/dh/dh_generate_key.o src/pk/dh/dh_import.o src/pk/dh/dh_set.o \
|
||||
src/pk/dh/dh_set_pg_dhparam.o src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o \
|
||||
src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o \
|
||||
src/pk/dsa/dsa_generate_key.o src/pk/dsa/dsa_generate_pqg.o src/pk/dsa/dsa_import.o \
|
||||
src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_set.o src/pk/dsa/dsa_set_pqg_dsaparam.o \
|
||||
src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o \
|
||||
src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o src/pk/ecc/ecc_ansi_x963_export.o \
|
||||
src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o \
|
||||
src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o \
|
||||
src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o \
|
||||
src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \
|
||||
src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \
|
||||
src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \
|
||||
src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \
|
||||
@@ -219,166 +195,105 @@ src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mg
|
||||
src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \
|
||||
src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \
|
||||
src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \
|
||||
src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_import.o \
|
||||
src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o \
|
||||
src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \
|
||||
src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_pkcs8.o src/pk/rsa/rsa_import_x509.o \
|
||||
src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_set.o src/pk/rsa/rsa_sign_hash.o \
|
||||
src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o \
|
||||
src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \
|
||||
src/prngs/sprng.o src/prngs/yarrow.o
|
||||
src/prngs/sprng.o src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \
|
||||
src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \
|
||||
src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \
|
||||
src/stream/rc4/rc4_stream.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128_stream.o \
|
||||
src/stream/sober128/sober128_test.o
|
||||
|
||||
HEADERS=src/headers/tomcrypt_cfg.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \
|
||||
src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cipher.h \
|
||||
src/headers/tomcrypt_pk.h src/headers/tomcrypt_hash.h src/headers/tomcrypt_math.h \
|
||||
src/headers/tomcrypt_misc.h src/headers/tomcrypt.h src/headers/tomcrypt_pkcs.h \
|
||||
src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h
|
||||
#List of test objects to compile (all goes to libtomcrypt_prof.a)
|
||||
TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_test.o tests/dh_test.o \
|
||||
tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \
|
||||
tests/modes_test.o tests/mpi_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o \
|
||||
tests/pkcs_1_emsa_test.o tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o \
|
||||
tests/prng_test.o tests/rotate_test.o tests/rsa_test.o tests/store_test.o tests/test.o
|
||||
|
||||
#END_INS
|
||||
#The following headers will be installed by "make install"
|
||||
HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \
|
||||
src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \
|
||||
src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \
|
||||
src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \
|
||||
src/headers/tomcrypt_prng.h
|
||||
|
||||
TESTOBJECTS=demos/test.o
|
||||
HASHOBJECTS=demos/hashsum.o
|
||||
CRYPTOBJECTS=demos/encrypt.o
|
||||
SMALLOBJECTS=demos/small.o
|
||||
TVS=demos/tv_gen.o
|
||||
MULTIS=demos/multi.o
|
||||
TIMINGS=demos/timing.o
|
||||
TESTS=demos/test.o
|
||||
#The default rule for make builds the libtomcrypt.a library (static)
|
||||
default: $(LIBMAIN_S)
|
||||
|
||||
#Files left over from making the crypt.pdf.
|
||||
LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out
|
||||
#SPECIAL: AES comes in two flavours - enc+dec and enc-only
|
||||
src/ciphers/aes/aes_enc.o: $(srcdir)/src/ciphers/aes/aes.c $(srcdir)/src/ciphers/aes/aes_tab.c
|
||||
$(CC) $(LTC_CFLAGS) -DENCRYPT_ONLY -c $(srcdir)/src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o
|
||||
|
||||
#Compressed filenames
|
||||
COMPRESSED=crypt-$(VERSION).tar.bz2 crypt-$(VERSION).zip
|
||||
|
||||
#The default rule for make builds the libtomcrypt library.
|
||||
default:library
|
||||
|
||||
#ciphers come in two flavours... enc+dec and enc
|
||||
src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
$(CC) $(CFLAGS) -DENCRYPT_ONLY -c $< -o src/ciphers/aes/aes_enc.o
|
||||
|
||||
#These are the rules to make certain object files.
|
||||
src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c
|
||||
src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c
|
||||
src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c
|
||||
src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
|
||||
|
||||
#This rule makes the libtomcrypt library.
|
||||
library: $(LIBNAME)
|
||||
#SPECIAL: these are the rules to make certain object files
|
||||
src/ciphers/aes/aes.o: $(srcdir)/src/ciphers/aes/aes.c $(srcdir)/src/ciphers/aes/aes_tab.c
|
||||
src/ciphers/twofish/twofish.o: $(srcdir)/src/ciphers/twofish/twofish.c $(srcdir)/src/ciphers/twofish/twofish_tab.c
|
||||
src/hashes/whirl/whirl.o: $(srcdir)/src/hashes/whirl/whirl.c $(srcdir)/src/hashes/whirl/whirltab.c
|
||||
src/hashes/sha2/sha512.o: $(srcdir)/src/hashes/sha2/sha512.c $(srcdir)/src/hashes/sha2/sha384.c
|
||||
src/hashes/sha2/sha512_224.o: $(srcdir)/src/hashes/sha2/sha512.c $(srcdir)/src/hashes/sha2/sha512_224.c
|
||||
src/hashes/sha2/sha512_256.o: $(srcdir)/src/hashes/sha2/sha512.c $(srcdir)/src/hashes/sha2/sha512_256.c
|
||||
src/hashes/sha2/sha256.o: $(srcdir)/src/hashes/sha2/sha256.c $(srcdir)/src/hashes/sha2/sha224.c
|
||||
|
||||
#Dependencies on *.h
|
||||
$(OBJECTS): $(HEADERS)
|
||||
$(TOBJECTS): $(HEADERS) tests/tomcrypt_test.h
|
||||
|
||||
testprof/$(LIBTEST):
|
||||
cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) $(MAKE)
|
||||
#This is necessary for compatibility with BSD make (namely on OpenBSD)
|
||||
.SUFFIXES: .o .c
|
||||
.c.o:
|
||||
$(CC) $(LTC_CFLAGS) -c $< -o $@
|
||||
|
||||
$(LIBNAME): $(OBJECTS)
|
||||
$(AR) $(ARFLAGS) $@ $(OBJECTS)
|
||||
#Create libtomcrypt.a
|
||||
$(LIBMAIN_S): $(OBJECTS)
|
||||
$(AR) $(ARFLAGS) $@ $(OBJECTS)
|
||||
$(RANLIB) $@
|
||||
|
||||
#This rule makes the hash program included with libtomcrypt
|
||||
hashsum: library $(HASHOBJECTS)
|
||||
$(CC) $(HASHOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(HASH) $(WARN)
|
||||
#Demo tools/utilities
|
||||
hashsum: demos/hashsum.o $(LIBMAIN_S)
|
||||
$(CC) demos/hashsum.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
ltcrypt: demos/ltcrypt.o $(LIBMAIN_S)
|
||||
$(CC) demos/ltcrypt.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
small: demos/small.o $(LIBMAIN_S)
|
||||
$(CC) demos/small.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
tv_gen: demos/tv_gen.o $(LIBMAIN_S)
|
||||
$(CC) demos/tv_gen.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
sizes: demos/sizes.o $(LIBMAIN_S)
|
||||
$(CC) demos/sizes.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
constants: demos/constants.o $(LIBMAIN_S)
|
||||
$(CC) demos/constants.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
timing: demos/timing.o $(LIBMAIN_S)
|
||||
$(CC) demos/timing.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
|
||||
#makes the crypt program
|
||||
crypt: library $(CRYPTOBJECTS)
|
||||
$(CC) $(CRYPTOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(CRYPT) $(WARN)
|
||||
#Tests
|
||||
test: $(TOBJECTS) $(LIBMAIN_S)
|
||||
$(CC) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
@echo "NOTICE: start the tests by: ./test"
|
||||
|
||||
#makes the small program
|
||||
small: library $(SMALLOBJECTS)
|
||||
$(CC) $(SMALLOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(SMALL) $(WARN)
|
||||
all: $(LIBMAIN_S) hashsum ltcrypt small tv_gen sizes constants timing test
|
||||
|
||||
tv_gen: library $(TVS)
|
||||
$(CC) $(LDFLAGS) $(TVS) $(LIBNAME) $(EXTRALIBS) -o $(TV)
|
||||
|
||||
multi: library $(MULTIS)
|
||||
$(CC) $(MULTIS) $(LIBNAME) $(EXTRALIBS) -o $(MULTI)
|
||||
|
||||
timing: library testprof/$(LIBTEST) $(TIMINGS)
|
||||
$(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING)
|
||||
|
||||
test: library testprof/$(LIBTEST) $(TESTS)
|
||||
$(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST)
|
||||
|
||||
#This rule installs the library and the header files. This must be run
|
||||
#as root in order to have a high enough permission to write to the correct
|
||||
#directories and to set the owner and group to root.
|
||||
ifndef NODOCS
|
||||
install: library docs
|
||||
else
|
||||
install: library
|
||||
endif
|
||||
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
|
||||
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
|
||||
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(DATAPATH)
|
||||
install -g $(GROUP) -o $(USER) $(LIBNAME) $(DESTDIR)$(LIBPATH)
|
||||
install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH)
|
||||
ifndef NODOCS
|
||||
install -g $(GROUP) -o $(USER) doc/crypt.pdf $(DESTDIR)$(DATAPATH)
|
||||
endif
|
||||
|
||||
install_test: testprof/$(LIBTEST)
|
||||
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
|
||||
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
|
||||
install -g $(GROUP) -o $(USER) testprof/$(LIBTEST) $(DESTDIR)$(LIBPATH)
|
||||
|
||||
profile:
|
||||
CFLAGS="$(CFLAGS) -fprofile-generate" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov"
|
||||
./timing
|
||||
rm -f timing `find . -type f | grep [.][ao] | xargs`
|
||||
CFLAGS="$(CFLAGS) -fprofile-use" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov"
|
||||
|
||||
|
||||
#This rule cleans the source tree of all compiled code, not including the pdf
|
||||
#documentation.
|
||||
#NOTE: this makefile works also on cygwin, thus we need to delete *.exe
|
||||
clean:
|
||||
-rm -f $(OBJECTS)
|
||||
-rm -f libtomcrypt.a
|
||||
-@rm -f $(OBJECTS) $(TOBJECTS)
|
||||
-@rm -f $(LIBMAIN_S)
|
||||
-@rm -f demos/*.o *_tv.txt
|
||||
-@rm -f test constants sizes tv_gen hashsum ltcrypt small timing
|
||||
-@rm -f test.exe constants.exe sizes.exe tv_gen.exe hashsum.exe ltcrypt.exe small.exe timing.exe
|
||||
|
||||
#build the doxy files (requires Doxygen, tetex and patience)
|
||||
doxy:
|
||||
doxygen
|
||||
cd doc/doxygen/latex ; ${MAKE} ; mv -f refman.pdf ../../.
|
||||
echo The huge doxygen PDF should be available as doc/refman.pdf
|
||||
#Install the library + headers
|
||||
install: $(LIBMAIN_S) $(HEADERS)
|
||||
@mkdir -p $(DESTDIR)$(INCPATH) $(DESTDIR)$(LIBPATH)/pkgconfig
|
||||
@cp $(LIBMAIN_S) $(DESTDIR)$(LIBPATH)/
|
||||
@cp $(HEADERS) $(DESTDIR)$(INCPATH)/
|
||||
@sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc
|
||||
|
||||
#This builds the crypt.pdf file. Note that the rm -f *.pdf has been removed
|
||||
#from the clean command! This is because most people would like to keep the
|
||||
#nice pre-compiled crypt.pdf that comes with libtomcrypt! We only need to
|
||||
#delete it if we are rebuilding it.
|
||||
docs: crypt.tex
|
||||
rm -f doc/crypt.pdf $(LEFTOVERS)
|
||||
echo "hello" > crypt.ind
|
||||
latex crypt > /dev/null
|
||||
latex crypt > /dev/null
|
||||
makeindex crypt.idx > /dev/null
|
||||
perl fixupind.pl
|
||||
latex crypt > /dev/null
|
||||
dvipdf crypt
|
||||
mv -ivf crypt.pdf doc/crypt.pdf
|
||||
rm -f $(LEFTOVERS)
|
||||
#Install useful tools
|
||||
install_bins: hashsum
|
||||
@mkdir -p $(DESTDIR)$(BINPATH)
|
||||
@cp hashsum $(DESTDIR)$(BINPATH)/
|
||||
|
||||
docdvi: crypt.tex
|
||||
echo hello > crypt.ind
|
||||
latex crypt > /dev/null
|
||||
latex crypt > /dev/null
|
||||
makeindex crypt.idx
|
||||
perl fixupind.pl
|
||||
latex crypt > /dev/null
|
||||
latex crypt > /dev/null
|
||||
|
||||
#zipup the project (take that!)
|
||||
no_oops: clean
|
||||
cd .. ; cvs commit
|
||||
echo Scanning for scratch/dirty files
|
||||
find . -type f | grep -v CVS | xargs -n 1 bash mess.sh
|
||||
|
||||
zipup: no_oops docs
|
||||
cd .. ; rm -rf crypt* libtomcrypt-$(VERSION) ; mkdir libtomcrypt-$(VERSION) ; \
|
||||
cp -R ./libtomcrypt/* ./libtomcrypt-$(VERSION)/ ; \
|
||||
cd libtomcrypt-$(VERSION) ; rm -rf `find . -type d | grep CVS | xargs` ; cd .. ; \
|
||||
tar -cjvf crypt-$(VERSION).tar.bz2 libtomcrypt-$(VERSION) ; \
|
||||
zip -9r crypt-$(VERSION).zip libtomcrypt-$(VERSION) ; \
|
||||
gpg -b -a crypt-$(VERSION).tar.bz2 ; gpg -b -a crypt-$(VERSION).zip ; \
|
||||
mv -fv crypt* ~ ; rm -rf libtomcrypt-$(VERSION)
|
||||
|
||||
|
||||
# $Source$ */
|
||||
# $Revision$ */
|
||||
# $Date$ */
|
||||
#Install documentation
|
||||
install_docs: doc/crypt.pdf
|
||||
@mkdir -p $(DESTDIR)$(DATAPATH)
|
||||
@cp doc/crypt.pdf $(DESTDIR)$(DATAPATH)/
|
||||
|
||||
51
libtomcrypt/build.sh
Normal file → Executable file
51
libtomcrypt/build.sh
Normal file → Executable file
@@ -1,20 +1,59 @@
|
||||
#!/bin/bash
|
||||
echo "$1 ($2, $3)..."
|
||||
|
||||
make clean 1>/dev/null 2>/dev/null
|
||||
|
||||
echo -n "building..."
|
||||
CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" make -j4 -f $3 test tv_gen 1>gcc_1.txt 2>gcc_2.txt || (echo "build $1 failed see gcc_2.txt for more information" && cat gcc_2.txt && exit 1)
|
||||
|
||||
if [ -f /proc/cpuinfo ]
|
||||
then
|
||||
MAKE_JOBS=$(( ($(cat /proc/cpuinfo | grep -E '^processor[[:space:]]*:' | tail -n -1 | cut -d':' -f2) + 1) * 2 + 1 ))
|
||||
else
|
||||
MAKE_JOBS=8
|
||||
fi
|
||||
|
||||
CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" make -j$MAKE_JOBS -f $3 all_test 1>gcc_1.txt 2>gcc_2.txt
|
||||
mret=$?
|
||||
cnt=$(wc -l < gcc_2.txt)
|
||||
# ignore 1 line since ar prints to stderr instead of stdout and ar is called for
|
||||
# $(LIBNAME)
|
||||
if [[ $mret -ne 0 ]] || [[ $cnt -gt 1 ]]; then
|
||||
echo "build $1 failed! printing gcc_2.txt now for convenience"
|
||||
cat gcc_2.txt
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -n "testing..."
|
||||
|
||||
if [ -a test ] && [ -f test ] && [ -x test ]; then
|
||||
((./test >test_std.txt 2>test_err.txt && ./tv_gen > tv.txt) && echo "$1 test passed." && echo "y" > testok.txt) || (echo "$1 test failed" && cat test_err.txt && exit 1)
|
||||
((./test >test_std.txt 2>test_err.txt && ./tv_gen > tv.txt) && echo "$1 test passed." && echo "y" > testok.txt) || (echo "$1 test failed, look at test_err.txt or tv.txt" && exit 1)
|
||||
if find *_tv.txt -type f 1>/dev/null 2>/dev/null ; then
|
||||
for f in *_tv.txt; do if (diff --ignore-case $f notes/$f) then true; else (echo "tv_gen $f failed" && rm -f testok.txt && exit 1); fi; done
|
||||
for f in *_tv.txt; do
|
||||
# check for lines starting with '<' ($f might be a subset of notes/$f)
|
||||
difftroubles=$(diff -i -w -B $f notes/$f | grep '^<')
|
||||
if [ -n "$difftroubles" ]; then
|
||||
echo "FAILURE: $f"
|
||||
diff -i -w -B $f notes/$f
|
||||
echo "tv_gen $f failed" && rm -f testok.txt && exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ -a testok.txt ] && [ -f testok.txt ]; then
|
||||
if [ "$LTC_COVERAGE" != "" ]; then
|
||||
./coverage_more.sh > test_coverage_more.txt || exit 1
|
||||
lcov_opts="--capture --no-external --directory src -q"
|
||||
lcov_out=$(echo coverage_$1_$2_$3 | tr ' -=+' '_')".info"
|
||||
lcov $lcov_opts --output-file $lcov_out
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
exit 1
|
||||
|
||||
# $Source: /cvs/libtom/libtomcrypt/build.sh,v $
|
||||
# $Revision: 1.9 $
|
||||
# $Date: 2006/03/18 14:10:55 $
|
||||
# ref: $Format:%D$
|
||||
# git commit: $Format:%H$
|
||||
# commit time: $Format:%ai$
|
||||
|
||||
@@ -1,3 +1,67 @@
|
||||
January 22nd, 2018
|
||||
v1.18.1
|
||||
-- Fix wrong SHA3 blocksizes, thanks to Claus Fischer for reporting this via Mail (PR #329)
|
||||
-- Fix NULL-pointer dereference in `ccm_memory()` with LTC_CLEAN_STACK enabled (PR #327)
|
||||
-- Fix `ccm_process()` being unable to process input buffers longer than 256 bytes (PR #326)
|
||||
-- Fix the `register_all_{ciphers,hashes,prngs}()` return values (PR #316)
|
||||
-- Fix some typos, warnings and duplicate prototypes in code & doc (PR's #310 #320 #321 #335)
|
||||
-- Fix possible undefined behavior with LTC_PTHREAD (PR #337)
|
||||
-- Fix some DER bugs (PR #339)
|
||||
-- Fix CTR-mode when accelerator is used (OP-TEE/optee_os #2086)
|
||||
-- Fix installation procedure (Issue #340)
|
||||
|
||||
October 10th, 2017
|
||||
v1.18.0
|
||||
-- Bugfix multi2
|
||||
-- Bugfix Noekeon
|
||||
-- Bugfix XTEA
|
||||
-- Bugfix rng_get_bytes() on windows where we could read from c:\dev\random
|
||||
-- Fixed the Bleichbacher Signature attack in PKCS#1 v1.5 EMSA, thanks to Alex Dent
|
||||
-- Fixed a potential cache-based timing attack in CCM, thanks to Sebastian Verschoor
|
||||
-- Fix GCM counter reuse and potential timing attacks in EAX, OCB and OCBv3,
|
||||
thanks to Raphaël Jamet
|
||||
-- Implement hardened RSA operations when CRT is used
|
||||
-- Enabled timing resistant calculations of ECC and RSA operations per default
|
||||
-- Applied some patches from the OLPC project regarding PKCS#1 and preventing
|
||||
the hash algorithms from overflowing
|
||||
-- Larry Bugbee contributed the necessary stuff to more easily call libtomcrypt
|
||||
from a dynamic language like Python, as shown in his pyTomCrypt
|
||||
-- Nikos Mavrogiannopoulos contributed RSA blinding and export of RSA and DSA keys
|
||||
in OpenSSL/GnuTLS compatible format
|
||||
-- Patrick Pelletier contributed a smart volley of patches
|
||||
-- Christopher Brown contributed some patches and additions to ASN.1/DER
|
||||
-- Pascal Brand of STMicroelectronics contributed patches regarding CCM, the
|
||||
XTS mode and RSA private key operations with keys without CRT parameters
|
||||
-- RC2 now also works with smaller key-sizes
|
||||
-- Improved/extended several tests & demos
|
||||
-- Hardened DSA and RSA by testing (through Karel's perl-CryptX)
|
||||
against Google's "Wycheproof" and Kudelski Security's "CDF"
|
||||
-- Fixed all compiler warnings
|
||||
-- Fixed several build issues on FreeBSD, NetBSD, Linux x32 ABI, HP-UX/IA64,
|
||||
Mac OS X, Windows (32&64bit, Cygwin, MingW & MSVC) ...
|
||||
-- Re-worked all makefiles
|
||||
-- Re-worked most PRNG's
|
||||
-- The code is now verified by a linter, thanks to Francois Perrad
|
||||
-- Documentation (crypt.pdf) is now built deterministically, thanks to Michael Stapelberg
|
||||
-- Add Adler32 and CRC32 checksum algorithms
|
||||
-- Add Base64-URL de-/encoding and some strict variants
|
||||
-- Add Blake2b & Blake2s (hash & mac), thanks to Kelvin Sherlock
|
||||
-- Add Camellia block cipher
|
||||
-- Add ChaCha (stream cipher), Poly1305 (mac), ChaCha20Poly1305 (encauth)
|
||||
-- Add constant-time mem-compare mem_neq()
|
||||
-- Add DER GeneralizedTime de-/encoding
|
||||
-- Add DSA and ECC key generation FIPS-186-4 compliance
|
||||
-- Add HKDF, thanks to RyanC (especially for also providing documentation :-) )
|
||||
-- Add OCBv3
|
||||
-- Add PKCS#1 v1.5 mode of SSL3.0
|
||||
-- Add PKCS#1 testvectors from RSA
|
||||
-- Add PKCS#8 & X.509 import for RSA keys
|
||||
-- Add stream cipher API
|
||||
-- Add SHA3 & SHAKE
|
||||
-- Add SHA512/256 and SHA512/224
|
||||
-- Add Triple-DES 2-key mode, thanks to Paul Howarth
|
||||
-- Brought back Diffie-Hellman
|
||||
|
||||
May 12th, 2007
|
||||
v1.17 -- Cryptography Research Inc. contributed another small volley of patches, one to fix __WCHAR_DEFINED__ for BSD platforms,
|
||||
another to silence MSVC warnings.
|
||||
|
||||
15
libtomcrypt/check_source.sh
Executable file
15
libtomcrypt/check_source.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
# output version
|
||||
bash printinfo.sh
|
||||
|
||||
make clean > /dev/null
|
||||
|
||||
echo "checking..."
|
||||
./helper.pl --check-source --check-makefiles --check-defines|| exit 1
|
||||
|
||||
exit 0
|
||||
|
||||
# ref: $Format:%D$
|
||||
# git commit: $Format:%H$
|
||||
# commit time: $Format:%ai$
|
||||
51
libtomcrypt/coverage.sh
Executable file
51
libtomcrypt/coverage.sh
Executable file
@@ -0,0 +1,51 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$TRAVIS_CI" == "private" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$#" != "5" ]; then
|
||||
echo "Usage is: ${0} \"coverage\" \"<prepend CFLAGS>\" \"<makefile>\" \"<append CFLAGS>\" <math library to link to>"
|
||||
echo "CC=gcc ${0} \"coverage\" \" \" \"makefile\" \"-DUSE_LTM -DLTM_DESC -I../libtommath\" ../libtommath/libtommath.a"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
if [ -z "$(echo $CC | grep "gcc")" ]; then
|
||||
echo "no gcc detected, early exit success"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$(echo $3 | grep -v 'makefile[.]')" == "" ]; then
|
||||
echo "only run $0 for the regular makefile, early exit success"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# output version
|
||||
bash printinfo.sh
|
||||
|
||||
bash build.sh " $1" " $2" " $3 COVERAGE=1" "$4" "$5"
|
||||
if [ -a testok.txt ] && [ -f testok.txt ]; then
|
||||
echo
|
||||
else
|
||||
echo
|
||||
echo "Test failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
./coverage_more.sh > test_coverage_more.txt || { rm -f testok.txt && exit 1 ; }
|
||||
|
||||
make lcov-single
|
||||
# if this was executed as './coverage.sh ...' create coverage locally
|
||||
if [[ "${0%% *}" == "./${0##*/}" ]]; then
|
||||
make lcov-html
|
||||
else
|
||||
coveralls-lcov coverage.info
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# ref: $Format:%D$
|
||||
# git commit: $Format:%H$
|
||||
# commit time: $Format:%ai$
|
||||
24
libtomcrypt/coverage_more.sh
Executable file
24
libtomcrypt/coverage_more.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
./sizes
|
||||
./constants
|
||||
|
||||
for i in $(for j in $(echo $(./hashsum -h | awk '/Algorithms/,EOF' | tail -n +2)); do echo $j; done | sort); do echo -n "$i: " && ./hashsum -a $i tests/test.key ; done > hashsum_tv.txt
|
||||
difftroubles=$(diff -i -w -B hashsum_tv.txt notes/hashsum_tv.txt | grep '^<') || true
|
||||
if [ -n "$difftroubles" ]; then
|
||||
echo "FAILURE: hashsum_tv.tx"
|
||||
diff -i -w -B hashsum_tv.txt notes/hashsum_tv.txt
|
||||
echo "hashsum failed"
|
||||
exit 1
|
||||
else
|
||||
echo "hashsum okay"
|
||||
fi
|
||||
|
||||
|
||||
exit 0
|
||||
|
||||
# ref: $Format:%D$
|
||||
# git commit: $Format:%H$
|
||||
# commit time: $Format:%ai$
|
||||
40
libtomcrypt/coverity.sh
Executable file
40
libtomcrypt/coverity.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# -lt 2 ]
|
||||
then
|
||||
echo "usage is: ${0##*/} <path to coverity scan> <extra compiler options>"
|
||||
echo "e.g. \"${0##*/} \"/usr/local/bin/coverity\" \"-DLTM_DESC -I/path/to/libtommath/\"\""
|
||||
exit -1
|
||||
fi
|
||||
|
||||
PATH=$PATH:$1/bin
|
||||
|
||||
make clean
|
||||
rm -r cov-int/
|
||||
|
||||
myCflags=""
|
||||
myCflags="$myCflags -O2 ${2}"
|
||||
myCflags="$myCflags -pipe -Werror -Wpointer-arith -Winit-self -Wextra -Wall -Wformat -Wformat-security"
|
||||
|
||||
CFLAGS="$myCflags" cov-build --dir cov-int make -f makefile.unix $MAKE_OPTS IGNORE_SPEED=1 1>gcc_1.txt
|
||||
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "make failed"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# zipup everything
|
||||
tar caf libtomcrypt.lzma cov-int
|
||||
|
||||
mytoken=$(cat .coverity_token)
|
||||
mymail=$(cat .coverity_mail)
|
||||
myversion=$(git describe --dirty)
|
||||
|
||||
curl -k --form project=libtomcrypt \
|
||||
--form token=${mytoken} \
|
||||
--form email=${mymail} \
|
||||
--form file=@libtomcrypt.lzma \
|
||||
--form version=\"${myversion}\" \
|
||||
--form description="\"libtomcrypt version ${myversion}\"" \
|
||||
https://scan.coverity.com/builds?project=libtom%2Flibtomcrypt
|
||||
86
libtomcrypt/demos/constants.c
Normal file
86
libtomcrypt/demos/constants.c
Normal file
@@ -0,0 +1,86 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
#include "tomcrypt.h"
|
||||
|
||||
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L
|
||||
#include <libgen.h>
|
||||
#else
|
||||
#define basename(x) x
|
||||
#endif
|
||||
|
||||
/**
|
||||
@file demo_crypt_constants.c
|
||||
|
||||
Demo how to get various constants to dynamic languages
|
||||
like Python
|
||||
|
||||
Larry Bugbee, February 2013
|
||||
*/
|
||||
|
||||
static void _print_line(const char* cmd, const char* desc)
|
||||
{
|
||||
printf(" %-16s - %s\n", cmd, desc);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if (argc == 1) {
|
||||
/* given a specific constant name, get and print its value */
|
||||
char name[] = "CTR_COUNTER_BIG_ENDIAN";
|
||||
int value;
|
||||
char *names_list;
|
||||
unsigned int names_list_len;
|
||||
|
||||
if (crypt_get_constant(name, &value) != 0) exit(EXIT_FAILURE);
|
||||
printf("\n %s is %d \n\n", name, value);
|
||||
|
||||
/* get and print the length of the names (and values) list */
|
||||
|
||||
if (crypt_list_all_constants(NULL, &names_list_len) != 0) exit(EXIT_FAILURE);
|
||||
printf(" need to allocate %u bytes \n\n", names_list_len);
|
||||
|
||||
/* get and print the names (and values) list */
|
||||
if ((names_list = malloc(names_list_len)) == NULL) exit(EXIT_FAILURE);
|
||||
if (crypt_list_all_constants(names_list, &names_list_len) != 0) exit(EXIT_FAILURE);
|
||||
printf(" supported constants:\n\n%s\n\n", names_list);
|
||||
free(names_list);
|
||||
} else if (argc == 2) {
|
||||
if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) {
|
||||
char* base = strdup(basename(argv[0]));
|
||||
printf("Usage: %s [-a] [-s name]\n\n", base);
|
||||
_print_line("<no argument>", "The old behavior of the demo");
|
||||
_print_line("-a", "Only lists all constants");
|
||||
_print_line("-s name", "List a single constant given as argument");
|
||||
_print_line("-h", "The help you're looking at");
|
||||
free(base);
|
||||
} else if (strcmp(argv[1], "-a") == 0) {
|
||||
char *names_list;
|
||||
unsigned int names_list_len;
|
||||
/* get and print the length of the names (and values) list */
|
||||
if (crypt_list_all_constants(NULL, &names_list_len) != 0) exit(EXIT_FAILURE);
|
||||
/* get and print the names (and values) list */
|
||||
names_list = malloc(names_list_len);
|
||||
if (crypt_list_all_constants(names_list, &names_list_len) != 0) exit(EXIT_FAILURE);
|
||||
printf("%s\n", names_list);
|
||||
}
|
||||
} else if (argc == 3) {
|
||||
if (strcmp(argv[1], "-s") == 0) {
|
||||
int value;
|
||||
if (crypt_get_constant(argv[2], &value) != 0) exit(EXIT_FAILURE);
|
||||
printf("%s,%u\n", argv[2], value);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* ref: $Format:%D$ */
|
||||
/* git commit: $Format:%H$ */
|
||||
/* commit time: $Format:%ai$ */
|
||||
309
libtomcrypt/demos/demo_dynamic.py
Normal file
309
libtomcrypt/demos/demo_dynamic.py
Normal file
@@ -0,0 +1,309 @@
|
||||
|
||||
|
||||
"""
|
||||
demo_dynamic.py v2b
|
||||
|
||||
This program demonstrates Python's use of the dynamic
|
||||
language support additions to LTC, namely access to LTC
|
||||
constants, struct and union sizes, and the binding of a
|
||||
math package to LTC. Also provided are simple code
|
||||
fragments to illustrate how one might write a Python
|
||||
wrapper for LTC and how an app might call the wrapper.
|
||||
This or a similar model should work for Ruby and other
|
||||
dynamic languages.
|
||||
|
||||
This instance uses Python's ctypes and requires a single
|
||||
.dylib linking together LTC and a math library. Building
|
||||
a single .dylib is needed because LTC wants a fairly tight
|
||||
relationship between itself and the mathlib. (ctypes can
|
||||
load multiple .dylibs, but it does not support this level
|
||||
of tight coupling between otherwise independent libraries.)
|
||||
|
||||
My .dylib was created on OSX/macOS with the following:
|
||||
sudo make -j5 -f makefile.shared \
|
||||
CFLAGS="-DUSE_TFM -DTFM_DESC -I/usr/local/include" \
|
||||
EXTRALIBS=/usr/local/lib/libtfm.a install
|
||||
|
||||
For python 2.7.12 on Ubuntu Xenial the following worked for
|
||||
me (without MPI support):
|
||||
sudo make -f makefile.shared install PREFIX="/usr"
|
||||
|
||||
Reminder: you don't need to bind in a math library unless
|
||||
you are going to use LTC functions that need a
|
||||
mathlib. For example, public key crypto requires
|
||||
a mathlib; hashing and symmetric encryption do not.
|
||||
|
||||
------
|
||||
|
||||
This code was originally written for Python 2.7 with the
|
||||
ctypes standard library. This version is modified to run
|
||||
under both Python 2.7 and 3.6.
|
||||
|
||||
Arguably the biggest change for Python3 has to do with
|
||||
strings. Under Python2, native strings are ASCII bytes and
|
||||
passing them to LTC is natural and requires no conversion.
|
||||
Under Python3 all native strings are Unicode which requires
|
||||
they be converted to bytes before use by LTC.
|
||||
|
||||
Note the following for Python3.
|
||||
- ASCII keys, IVs and other string arguments must be
|
||||
'bytes'. Define them with a 'b' prefix or convert
|
||||
via the 'bytes()' function.
|
||||
- "strings" returned from LTC are bytes and conversion
|
||||
to Unicode might be necessary for proper printing.
|
||||
If so, use <string>.decode('utf-8').
|
||||
- The Python2 'print' statement becomes a function in
|
||||
Python3 which requires parenthesis, eg. 'print()'.
|
||||
|
||||
NB: Unicode is achieved under Python2 by either defining
|
||||
a Unicode string with a 'u' prefix or passing ASCII
|
||||
strings thru the 'unicode()' function.
|
||||
|
||||
Larry Bugbee
|
||||
March 2014 v1
|
||||
August 2017 v2b
|
||||
|
||||
"""
|
||||
|
||||
|
||||
import sys
|
||||
from ctypes import *
|
||||
from ctypes.util import find_library
|
||||
|
||||
# switches to enable/disable selected output
|
||||
SHOW_ALL_CONSTANTS = True
|
||||
SHOW_ALL_SIZES = True
|
||||
SHOW_SELECTED_CONSTANTS = True
|
||||
SHOW_SELECTED_SIZES = True
|
||||
SHOW_BUILD_OPTIONS_ALGS = True
|
||||
SHOW_SHA256_EXAMPLE = True
|
||||
SHOW_CHACHA_EXAMPLE = True
|
||||
|
||||
print(' ')
|
||||
print(' demo_dynamic.py')
|
||||
|
||||
def inprint(s, indent=0):
|
||||
"prints strings indented, including multline strings"
|
||||
for line in s.split('\n'):
|
||||
print(' '*indent + line)
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# load the .dylib
|
||||
|
||||
libname = 'tomcrypt'
|
||||
libpath = find_library(libname)
|
||||
print(' ')
|
||||
print(' path to library %s: %s' % (libname, libpath))
|
||||
|
||||
LTC = cdll.LoadLibrary(libpath)
|
||||
print(' loaded: %s' % LTC)
|
||||
print(' ')
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# get list of all supported constants followed by a list of all
|
||||
# supported sizes. One alternative: these lists may be parsed
|
||||
# and used as needed.
|
||||
|
||||
if SHOW_ALL_CONSTANTS:
|
||||
print('-'*60)
|
||||
print(' all supported constants and their values:')
|
||||
|
||||
# get size to allocate for constants output list
|
||||
str_len = c_int(0)
|
||||
ret = LTC.crypt_list_all_constants(None, byref(str_len))
|
||||
print(' need to allocate %d bytes to build list \n' % str_len.value)
|
||||
|
||||
# allocate that size and get (name, size) pairs, each pair
|
||||
# separated by a newline char.
|
||||
names_sizes = c_buffer(str_len.value)
|
||||
ret = LTC.crypt_list_all_constants(names_sizes, byref(str_len))
|
||||
print(names_sizes.value.decode("utf-8"))
|
||||
print(' ')
|
||||
|
||||
|
||||
if SHOW_ALL_SIZES:
|
||||
print('-'*60)
|
||||
print(' all supported sizes:')
|
||||
|
||||
# get size to allocate for sizes output list
|
||||
str_len = c_int(0)
|
||||
ret = LTC.crypt_list_all_sizes(None, byref(str_len))
|
||||
print(' need to allocate %d bytes to build list \n' % str_len.value)
|
||||
|
||||
# allocate that size and get (name, size) pairs, each pair
|
||||
# separated by a newline char.
|
||||
names_sizes = c_buffer(str_len.value)
|
||||
ret = LTC.crypt_list_all_sizes(names_sizes, byref(str_len))
|
||||
print(names_sizes.value.decode("utf-8"))
|
||||
print(' ')
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# get individually named constants and sizes
|
||||
|
||||
if SHOW_SELECTED_CONSTANTS:
|
||||
print('-'*60)
|
||||
print('\n selected constants:')
|
||||
|
||||
names = [
|
||||
b'ENDIAN_LITTLE',
|
||||
b'ENDIAN_64BITWORD',
|
||||
b'PK_PUBLIC',
|
||||
b'LTC_MILLER_RABIN_REPS',
|
||||
b'CTR_COUNTER_BIG_ENDIAN',
|
||||
]
|
||||
for name in names:
|
||||
const_value = c_int(0)
|
||||
rc = LTC.crypt_get_constant(name, byref(const_value))
|
||||
value = const_value.value
|
||||
print(' %-25s %d' % (name.decode("utf-8"), value))
|
||||
print(' ')
|
||||
|
||||
if SHOW_SELECTED_SIZES:
|
||||
print('-'*60)
|
||||
print('\n selected sizes:')
|
||||
|
||||
names = [
|
||||
b'rijndael_key',
|
||||
b'rsa_key',
|
||||
b'symmetric_CTR',
|
||||
b'twofish_key',
|
||||
b'ecc_point',
|
||||
b'gcm_state',
|
||||
b'sha512_state',
|
||||
]
|
||||
for name in names:
|
||||
size_value = c_int(0)
|
||||
rc = LTC.crypt_get_size(name, byref(size_value))
|
||||
value = size_value.value
|
||||
print(' %-25s %d' % (name.decode("utf-8"), value))
|
||||
print(' ')
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#-------------------------------------------------------------------------------
|
||||
# LibTomCrypt exposes one interesting string that can be accessed
|
||||
# via Python's ctypes module, "crypt_build_settings", which
|
||||
# provides a list of this build's compiler switches and supported
|
||||
# algorithms. If someday LTC exposes other interesting strings,
|
||||
# they can be found with:
|
||||
# nm /usr/local/lib/libtomcrypt.dylib | grep " D "
|
||||
|
||||
def get_named_string(lib, name):
|
||||
return c_char_p.in_dll(lib, name).value.decode("utf-8")
|
||||
|
||||
if SHOW_BUILD_OPTIONS_ALGS:
|
||||
print('-'*60)
|
||||
print('This is a string compiled into LTC showing compile')
|
||||
print('options and algorithms supported by this build \n')
|
||||
# print(get_named_string(LTC, 'crypt_build_settings'))
|
||||
inprint(get_named_string(LTC, 'crypt_build_settings'), 4)
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#-------------------------------------------------------------------------------
|
||||
# here is an example of how Python code can be written to access
|
||||
# LTC's implementation of SHA256 and ChaCha,
|
||||
|
||||
# - - - - - - - - - - - - -
|
||||
# definitions
|
||||
|
||||
from binascii import hexlify, unhexlify
|
||||
|
||||
def _err2str(err):
|
||||
# define return type
|
||||
errstr = LTC.error_to_string
|
||||
errstr.restype = c_char_p
|
||||
# get and return err string
|
||||
return errstr(err)
|
||||
|
||||
def _get_size(name):
|
||||
size = c_int(0)
|
||||
rc = LTC.crypt_get_size(bytes(name), byref(size))
|
||||
if rc != 0:
|
||||
raise Exception('LTC.crypt_get_size(%s) rc = %d' % (name, rc))
|
||||
return size.value
|
||||
|
||||
def _get_constant(name):
|
||||
constant = c_int(0)
|
||||
rc = LTC.crypt_get_constant(bytes(name), byref(constant))
|
||||
if rc != 0:
|
||||
raise Exception('LTC.crypt_get_constant(%s) rc = %d' % (name, rc))
|
||||
return constant.value
|
||||
|
||||
CRYPT_OK = _get_constant(b'CRYPT_OK')
|
||||
|
||||
class SHA256(object):
|
||||
def __init__(self):
|
||||
self.state = c_buffer(_get_size(b'sha256_state'))
|
||||
LTC.sha256_init(byref(self.state))
|
||||
def update(self, data):
|
||||
LTC.sha256_process(byref(self.state), data, len(data))
|
||||
def digest(self):
|
||||
md = c_buffer(32)
|
||||
LTC.sha256_done(byref(self.state), byref(md))
|
||||
return md.raw
|
||||
|
||||
class ChaCha(object):
|
||||
def __init__(self, key, rounds):
|
||||
self.state = c_buffer(_get_size(b'chacha_state'))
|
||||
self.counter = c_int(1)
|
||||
err = LTC.chacha_setup(byref(self.state), key, len(key), rounds)
|
||||
if err != CRYPT_OK:
|
||||
raise Exception('LTC.chacha_setup(), err = %d, "%s"' % (err, _err2str(err)))
|
||||
def set_iv32(self, iv):
|
||||
err = LTC.chacha_ivctr32(byref(self.state), iv, len(iv), byref(self.counter))
|
||||
if err != CRYPT_OK:
|
||||
raise Exception('LTC.chacha_ivctr32(), err = %d, "%s"' % (err, _err2str(err)))
|
||||
def crypt(self, datain):
|
||||
dataout = c_buffer(len(datain))
|
||||
err = LTC.chacha_crypt(byref(self.state), datain, len(datain), byref(dataout))
|
||||
if err != CRYPT_OK:
|
||||
raise Exception('LTC.chacha_crypt(), err = %d, "%s"' % (err, _err2str(err)))
|
||||
return dataout.raw
|
||||
|
||||
# - - - - - - - - - - - - -
|
||||
# a SHA256 app fragment
|
||||
|
||||
if SHOW_SHA256_EXAMPLE:
|
||||
print('-'*60)
|
||||
data = b'hello world' # we want bytes, not Unicode
|
||||
|
||||
sha256 = SHA256()
|
||||
sha256.update(data)
|
||||
md = sha256.digest()
|
||||
|
||||
template = '\n the SHA256 digest for "%s" is %s \n'
|
||||
print(template % (data, hexlify(md)))
|
||||
|
||||
# - - - - - - - - - - - - -
|
||||
# a ChaCha app fragment
|
||||
|
||||
if SHOW_CHACHA_EXAMPLE:
|
||||
print('-'*60)
|
||||
key = b'hownowbrowncow\x00\x00' # exactly 16 or 32 bytes
|
||||
rounds = 12 # common values: 8, 12, 20
|
||||
iv = b'123456789012' # exactly 12 bytes
|
||||
plain = b'Kilroy was here, there, and everywhere!'
|
||||
|
||||
cha = ChaCha(key, rounds)
|
||||
cha.set_iv32(iv)
|
||||
cipher = cha.crypt(plain)
|
||||
|
||||
template = '\n ChaCha%d ciphertext for "%s" is "%s"'
|
||||
print(template % (rounds, plain, hexlify(cipher)))
|
||||
|
||||
cha.set_iv32(iv) # reset to decrypt
|
||||
decrypted = cha.crypt(cipher)
|
||||
|
||||
template = ' ChaCha%d decoded text for "%s" is "%s" \n'
|
||||
print(template % (rounds, plain, decrypted.decode("utf-8")))
|
||||
|
||||
# Footnote: Keys should be erased fm memory as soon as possible after use,
|
||||
# and that includes Python. For a tip on how to do that in Python, see
|
||||
# http://buggywhip.blogspot.com/2010/12/erase-keys-and-credit-card-numbers-in.html
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#-------------------------------------------------------------------------------
|
||||
#-------------------------------------------------------------------------------
|
||||
@@ -1,3 +1,12 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Written by Daniel Richards <kyhwana@world-net.co.nz> 6/7/2002
|
||||
* hash.c: This app uses libtomcrypt to hash either stdin or a file
|
||||
@@ -9,111 +18,283 @@
|
||||
|
||||
#include <tomcrypt.h>
|
||||
|
||||
int errno;
|
||||
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L
|
||||
#include <libgen.h>
|
||||
#else
|
||||
#define basename(x) x
|
||||
#endif
|
||||
|
||||
void register_algs();
|
||||
#if !defined(PATH_MAX) && defined(_MSC_VER)
|
||||
#include <windows.h>
|
||||
#define PATH_MAX MAX_PATH
|
||||
#endif
|
||||
|
||||
/* thanks http://stackoverflow.com/a/8198009 */
|
||||
#define _base(x) ((x >= '0' && x <= '9') ? '0' : \
|
||||
(x >= 'a' && x <= 'f') ? 'a' - 10 : \
|
||||
(x >= 'A' && x <= 'F') ? 'A' - 10 : \
|
||||
'\255')
|
||||
#define HEXOF(x) (x - _base(x))
|
||||
|
||||
static char* hashsum;
|
||||
|
||||
static void cleanup(void)
|
||||
{
|
||||
free(hashsum);
|
||||
}
|
||||
|
||||
static void die(int status)
|
||||
{
|
||||
unsigned long w, x;
|
||||
FILE* o = status == EXIT_SUCCESS ? stdout : stderr;
|
||||
fprintf(o, "usage: %s -a algorithm [-c] [file...]\n\n", hashsum);
|
||||
fprintf(o, "\t-c\tCheck the hash(es) of the file(s) written in [file].\n");
|
||||
fprintf(o, "\t\t(-a not required)\n");
|
||||
fprintf(o, "\nAlgorithms:\n\t");
|
||||
w = 0;
|
||||
for (x = 0; hash_descriptor[x].name != NULL; x++) {
|
||||
w += fprintf(o, "%-14s", hash_descriptor[x].name);
|
||||
if (w >= 70) {
|
||||
fprintf(o, "\n\t");
|
||||
w = 0;
|
||||
}
|
||||
}
|
||||
if (w != 0) fprintf(o, "\n");
|
||||
exit(status);
|
||||
}
|
||||
|
||||
static void printf_hex(unsigned char* hash_buffer, unsigned long w)
|
||||
{
|
||||
unsigned long x;
|
||||
for (x = 0; x < w; x++) {
|
||||
printf("%02x",hash_buffer[x]);
|
||||
}
|
||||
}
|
||||
|
||||
static void check_file(int argn, int argc, char **argv)
|
||||
{
|
||||
int err, failed, invalid;
|
||||
unsigned char is_buffer[MAXBLOCKSIZE], should_buffer[MAXBLOCKSIZE];
|
||||
char buf[PATH_MAX + (MAXBLOCKSIZE * 3)];
|
||||
/* iterate through all files */
|
||||
while(argn < argc) {
|
||||
char* s;
|
||||
FILE* f = fopen(argv[argn], "rb");
|
||||
if(f == NULL) {
|
||||
int n = snprintf(buf, sizeof(buf), "%s: %s", hashsum, argv[argn]);
|
||||
if (n > 0 && n < (int)sizeof(buf))
|
||||
perror(buf);
|
||||
else
|
||||
perror(argv[argn]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
failed = 0;
|
||||
invalid = 0;
|
||||
/* read the file line by line */
|
||||
while((s = fgets(buf, sizeof(buf), f)) != NULL)
|
||||
{
|
||||
int tries, n;
|
||||
unsigned long hash_len, w, x;
|
||||
char* space = strstr(s, " ");
|
||||
|
||||
/* skip lines with comments */
|
||||
if (buf[0] == '#') continue;
|
||||
|
||||
if (space == NULL) {
|
||||
fprintf(stderr, "%s: no properly formatted checksum lines found\n", hashsum);
|
||||
goto ERR;
|
||||
}
|
||||
|
||||
hash_len = space - s;
|
||||
hash_len /= 2;
|
||||
|
||||
if (hash_len > sizeof(should_buffer)) {
|
||||
fprintf(stderr, "%s: hash too long\n", hashsum);
|
||||
goto ERR;
|
||||
}
|
||||
|
||||
/* convert the hex-string back to binary */
|
||||
for (x = 0; x < hash_len; ++x) {
|
||||
should_buffer[x] = HEXOF(s[x*2]) << 4 | HEXOF(s[x*2 + 1]);
|
||||
}
|
||||
|
||||
space++;
|
||||
if (*space != '*') {
|
||||
fprintf(stderr, "%s: unsupported input mode '%c'\n", hashsum, *space);
|
||||
goto ERR;
|
||||
}
|
||||
space++;
|
||||
|
||||
for (n = 0; n < (buf + sizeof(buf)) - space; ++n) {
|
||||
if(iscntrl((int)space[n])) {
|
||||
space[n] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* try all hash algorithms that have the appropriate hash size */
|
||||
tries = 0;
|
||||
for (x = 0; hash_descriptor[x].name != NULL; ++x) {
|
||||
if (hash_descriptor[x].hashsize == hash_len) {
|
||||
tries++;
|
||||
w = sizeof(is_buffer);
|
||||
if ((err = hash_file(x, space, is_buffer, &w)) != CRYPT_OK) {
|
||||
fprintf(stderr, "%s: File hash error: %s: %s\n", hashsum, space, error_to_string(err));
|
||||
ERR:
|
||||
fclose(f);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if(XMEMCMP(should_buffer, is_buffer, w) == 0) {
|
||||
printf("%s: OK\n", space);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} /* for */
|
||||
if (hash_descriptor[x].name == NULL) {
|
||||
if(tries > 0) {
|
||||
printf("%s: FAILED\n", space);
|
||||
failed++;
|
||||
}
|
||||
else {
|
||||
invalid++;
|
||||
}
|
||||
}
|
||||
} /* while */
|
||||
fclose(f);
|
||||
if(invalid) {
|
||||
fprintf(stderr, "%s: WARNING: %d %s is improperly formatted\n", hashsum, invalid, invalid > 1?"lines":"line");
|
||||
}
|
||||
if(failed) {
|
||||
fprintf(stderr, "%s: WARNING: %d computed %s did NOT match\n", hashsum, failed, failed > 1?"checksums":"checksum");
|
||||
}
|
||||
argn++;
|
||||
}
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int idx, x, z;
|
||||
unsigned long w;
|
||||
int idxs[TAB_SIZE], idx, check, y, z, err, argn;
|
||||
unsigned long w, x;
|
||||
unsigned char hash_buffer[MAXBLOCKSIZE];
|
||||
hash_state md;
|
||||
|
||||
hashsum = strdup(basename(argv[0]));
|
||||
atexit(cleanup);
|
||||
|
||||
/* You need to register algorithms before using them */
|
||||
register_algs();
|
||||
if (argc < 2) {
|
||||
printf("usage: ./hash algorithm file [file ...]\n");
|
||||
printf("Algorithms:\n");
|
||||
for (x = 0; hash_descriptor[x].name != NULL; x++) {
|
||||
printf(" %s (%d)\n", hash_descriptor[x].name, hash_descriptor[x].ID);
|
||||
}
|
||||
exit(EXIT_SUCCESS);
|
||||
register_all_ciphers();
|
||||
register_all_hashes();
|
||||
if (argc > 1 && (strcmp("-h", argv[1]) == 0 || strcmp("--help", argv[1]) == 0)) {
|
||||
die(EXIT_SUCCESS);
|
||||
}
|
||||
if (argc < 3) {
|
||||
die(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
idx = find_hash(argv[1]);
|
||||
if (idx == -1) {
|
||||
fprintf(stderr, "\nInvalid hash specified on command line.\n");
|
||||
return -1;
|
||||
for (x = 0; x < sizeof(idxs)/sizeof(idxs[0]); ++x) {
|
||||
idxs[x] = -2;
|
||||
}
|
||||
argn = 1;
|
||||
check = 0;
|
||||
idx = 0;
|
||||
|
||||
while(argn < argc){
|
||||
if(strcmp("-a", argv[argn]) == 0) {
|
||||
argn++;
|
||||
if(argn < argc) {
|
||||
idxs[idx] = find_hash(argv[argn]);
|
||||
if (idxs[idx] == -1) {
|
||||
struct {
|
||||
const char* is;
|
||||
const char* should;
|
||||
} shasum_compat[] =
|
||||
{
|
||||
#ifdef LTC_SHA1
|
||||
{ "1", sha1_desc.name },
|
||||
#endif
|
||||
#ifdef LTC_SHA224
|
||||
{ "224", sha224_desc.name },
|
||||
#endif
|
||||
#ifdef LTC_SHA256
|
||||
{ "256", sha256_desc.name },
|
||||
#endif
|
||||
#ifdef LTC_SHA384
|
||||
{ "384", sha384_desc.name },
|
||||
#endif
|
||||
#ifdef LTC_SHA512
|
||||
{ "512", sha512_desc.name },
|
||||
#endif
|
||||
#ifdef LTC_SHA512_224
|
||||
{ "512224", sha512_224_desc.name },
|
||||
#endif
|
||||
#ifdef LTC_SHA512_256
|
||||
{ "512256", sha512_256_desc.name },
|
||||
#endif
|
||||
{ NULL, NULL }
|
||||
};
|
||||
for (x = 0; shasum_compat[x].is != NULL; ++x) {
|
||||
if(XSTRCMP(shasum_compat[x].is, argv[argn]) == 0) {
|
||||
idxs[idx] = find_hash(shasum_compat[x].should);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (idxs[idx] == -1) {
|
||||
fprintf(stderr, "%s: Unrecognized algorithm\n", hashsum);
|
||||
die(EXIT_FAILURE);
|
||||
}
|
||||
idx++;
|
||||
if ((size_t)idx >= sizeof(idxs)/sizeof(idxs[0])) {
|
||||
fprintf(stderr, "%s: Too many '-a' options chosen\n", hashsum);
|
||||
die(EXIT_FAILURE);
|
||||
}
|
||||
argn++;
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
die(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
if(strcmp("-c", argv[argn]) == 0) {
|
||||
check = 1;
|
||||
argn++;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (argc == 2) {
|
||||
hash_descriptor[idx].init(&md);
|
||||
do {
|
||||
x = fread(hash_buffer, 1, sizeof(hash_buffer), stdin);
|
||||
hash_descriptor[idx].process(&md, hash_buffer, x);
|
||||
} while (x == sizeof(hash_buffer));
|
||||
hash_descriptor[idx].done(&md, hash_buffer);
|
||||
for (x = 0; x < (int)hash_descriptor[idx].hashsize; x++) {
|
||||
printf("%02x",hash_buffer[x]);
|
||||
if (check == 1) {
|
||||
check_file(argn, argc, argv);
|
||||
}
|
||||
|
||||
if (argc == argn) {
|
||||
w = sizeof(hash_buffer);
|
||||
if ((err = hash_filehandle(idxs[0], stdin, hash_buffer, &w)) != CRYPT_OK) {
|
||||
fprintf(stderr, "%s: File hash error: %s\n", hashsum, error_to_string(err));
|
||||
return EXIT_FAILURE;
|
||||
} else {
|
||||
for (x = 0; x < w; x++) {
|
||||
printf("%02x",hash_buffer[x]);
|
||||
}
|
||||
printf(" *-\n");
|
||||
}
|
||||
printf(" (stdin)\n");
|
||||
} else {
|
||||
for (z = 2; z < argc; z++) {
|
||||
w = sizeof(hash_buffer);
|
||||
if ((errno = hash_file(idx,argv[z],hash_buffer,&w)) != CRYPT_OK) {
|
||||
printf("File hash error: %s\n", error_to_string(errno));
|
||||
} else {
|
||||
for (x = 0; x < (int)hash_descriptor[idx].hashsize; x++) {
|
||||
printf("%02x",hash_buffer[x]);
|
||||
}
|
||||
printf(" %s\n", argv[z]);
|
||||
for (z = argn; z < argc; z++) {
|
||||
for (y = 0; y < idx; ++y) {
|
||||
w = sizeof(hash_buffer);
|
||||
if ((err = hash_file(idxs[y],argv[z],hash_buffer,&w)) != CRYPT_OK) {
|
||||
fprintf(stderr, "%s: File hash error: %s\n", hashsum, error_to_string(err));
|
||||
return EXIT_FAILURE;
|
||||
} else {
|
||||
printf_hex(hash_buffer, w);
|
||||
printf(" *%s\n", argv[z]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
void register_algs(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
#ifdef LTC_TIGER
|
||||
register_hash (&tiger_desc);
|
||||
#endif
|
||||
#ifdef LTC_MD2
|
||||
register_hash (&md2_desc);
|
||||
#endif
|
||||
#ifdef LTC_MD4
|
||||
register_hash (&md4_desc);
|
||||
#endif
|
||||
#ifdef LTC_MD5
|
||||
register_hash (&md5_desc);
|
||||
#endif
|
||||
#ifdef LTC_SHA1
|
||||
register_hash (&sha1_desc);
|
||||
#endif
|
||||
#ifdef LTC_SHA224
|
||||
register_hash (&sha224_desc);
|
||||
#endif
|
||||
#ifdef LTC_SHA256
|
||||
register_hash (&sha256_desc);
|
||||
#endif
|
||||
#ifdef LTC_SHA384
|
||||
register_hash (&sha384_desc);
|
||||
#endif
|
||||
#ifdef LTC_SHA512
|
||||
register_hash (&sha512_desc);
|
||||
#endif
|
||||
#ifdef LTC_RIPEMD128
|
||||
register_hash (&rmd128_desc);
|
||||
#endif
|
||||
#ifdef LTC_RIPEMD160
|
||||
register_hash (&rmd160_desc);
|
||||
#endif
|
||||
#ifdef LTC_WHIRLPOOL
|
||||
register_hash (&whirlpool_desc);
|
||||
#endif
|
||||
#ifdef LTC_CHC_HASH
|
||||
register_hash(&chc_desc);
|
||||
if ((err = chc_register(register_cipher(&aes_enc_desc))) != CRYPT_OK) {
|
||||
printf("chc_register error: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/* $Source$ */
|
||||
/* $Revision$ */
|
||||
/* $Date$ */
|
||||
/* ref: $Format:%D$ */
|
||||
/* git commit: $Format:%H$ */
|
||||
/* commit time: $Format:%ai$ */
|
||||
|
||||
205
libtomcrypt/demos/ltcrypt.c
Normal file
205
libtomcrypt/demos/ltcrypt.c
Normal file
@@ -0,0 +1,205 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/* encrypt V1.1 Fri Oct 18 04:28:03 NZDT 2002 */
|
||||
/* File de/encryption, using libtomcrypt */
|
||||
/* Written by Daniel Richards <kyhwana@world-net.co.nz> */
|
||||
/* Help from Tom St Denis with various bits */
|
||||
/* This code is public domain, no rights reserved. */
|
||||
/* Encrypts by default, -d flag enables decryption */
|
||||
/* ie: ./encrypt blowfish story.txt story.ct */
|
||||
/* ./encrypt -d blowfish story.ct story.pt */
|
||||
|
||||
#include <tomcrypt.h>
|
||||
|
||||
int usage(char *name)
|
||||
{
|
||||
int x;
|
||||
|
||||
printf("Usage encrypt: %s cipher infile outfile\n", name);
|
||||
printf("Usage decrypt: %s -d cipher infile outfile\n", name);
|
||||
printf("Usage test: %s -t cipher\nCiphers:\n", name);
|
||||
for (x = 0; cipher_descriptor[x].name != NULL; x++) {
|
||||
printf("%s\n",cipher_descriptor[x].name);
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
unsigned char plaintext[512],ciphertext[512];
|
||||
unsigned char tmpkey[512], key[MAXBLOCKSIZE], IV[MAXBLOCKSIZE];
|
||||
unsigned char inbuf[512]; /* i/o block size */
|
||||
unsigned long outlen, y, ivsize, x, decrypt;
|
||||
symmetric_CTR ctr;
|
||||
int cipher_idx, hash_idx, ks;
|
||||
char *infile, *outfile, *cipher;
|
||||
prng_state prng;
|
||||
FILE *fdin, *fdout;
|
||||
int err;
|
||||
|
||||
/* register algs, so they can be printed */
|
||||
register_all_ciphers();
|
||||
register_all_hashes();
|
||||
register_all_prngs();
|
||||
|
||||
if (argc < 4) {
|
||||
if ((argc > 2) && (!strcmp(argv[1], "-t"))) {
|
||||
cipher = argv[2];
|
||||
cipher_idx = find_cipher(cipher);
|
||||
if (cipher_idx == -1) {
|
||||
printf("Invalid cipher %s entered on command line.\n", cipher);
|
||||
exit(-1);
|
||||
} /* if */
|
||||
if (cipher_descriptor[cipher_idx].test)
|
||||
{
|
||||
if (cipher_descriptor[cipher_idx].test() != CRYPT_OK)
|
||||
{
|
||||
printf("Error when testing cipher %s.\n", cipher);
|
||||
exit(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Testing cipher %s succeeded.\n", cipher);
|
||||
exit(0);
|
||||
} /* if ... else */
|
||||
} /* if */
|
||||
}
|
||||
return usage(argv[0]);
|
||||
}
|
||||
|
||||
if (!strcmp(argv[1], "-d")) {
|
||||
decrypt = 1;
|
||||
cipher = argv[2];
|
||||
infile = argv[3];
|
||||
outfile = argv[4];
|
||||
} else {
|
||||
decrypt = 0;
|
||||
cipher = argv[1];
|
||||
infile = argv[2];
|
||||
outfile = argv[3];
|
||||
}
|
||||
|
||||
/* file handles setup */
|
||||
fdin = fopen(infile,"rb");
|
||||
if (fdin == NULL) {
|
||||
perror("Can't open input for reading");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
fdout = fopen(outfile,"wb");
|
||||
if (fdout == NULL) {
|
||||
perror("Can't open output for writing");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
cipher_idx = find_cipher(cipher);
|
||||
if (cipher_idx == -1) {
|
||||
printf("Invalid cipher entered on command line.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
hash_idx = find_hash("sha256");
|
||||
if (hash_idx == -1) {
|
||||
printf("LTC_SHA256 not found...?\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
ivsize = cipher_descriptor[cipher_idx].block_length;
|
||||
ks = hash_descriptor[hash_idx].hashsize;
|
||||
if (cipher_descriptor[cipher_idx].keysize(&ks) != CRYPT_OK) {
|
||||
printf("Invalid keysize???\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
printf("\nEnter key: ");
|
||||
if(fgets((char *)tmpkey,sizeof(tmpkey), stdin) == NULL)
|
||||
exit(-1);
|
||||
outlen = sizeof(key);
|
||||
if ((err = hash_memory(hash_idx,tmpkey,strlen((char *)tmpkey),key,&outlen)) != CRYPT_OK) {
|
||||
printf("Error hashing key: %s\n", error_to_string(err));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (decrypt) {
|
||||
/* Need to read in IV */
|
||||
if (fread(IV,1,ivsize,fdin) != ivsize) {
|
||||
printf("Error reading IV from input.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if ((err = ctr_start(cipher_idx,IV,key,ks,0,CTR_COUNTER_LITTLE_ENDIAN,&ctr)) != CRYPT_OK) {
|
||||
printf("ctr_start error: %s\n",error_to_string(err));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* IV done */
|
||||
do {
|
||||
y = fread(inbuf,1,sizeof(inbuf),fdin);
|
||||
|
||||
if ((err = ctr_decrypt(inbuf,plaintext,y,&ctr)) != CRYPT_OK) {
|
||||
printf("ctr_decrypt error: %s\n", error_to_string(err));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (fwrite(plaintext,1,y,fdout) != y) {
|
||||
printf("Error writing to file.\n");
|
||||
exit(-1);
|
||||
}
|
||||
} while (y == sizeof(inbuf));
|
||||
fclose(fdin);
|
||||
fclose(fdout);
|
||||
|
||||
} else { /* encrypt */
|
||||
/* Setup yarrow for random bytes for IV */
|
||||
|
||||
if ((err = rng_make_prng(128, find_prng("yarrow"), &prng, NULL)) != CRYPT_OK) {
|
||||
printf("Error setting up PRNG, %s\n", error_to_string(err));
|
||||
}
|
||||
|
||||
/* You can use rng_get_bytes on platforms that support it */
|
||||
/* x = rng_get_bytes(IV,ivsize,NULL);*/
|
||||
x = yarrow_read(IV,ivsize,&prng);
|
||||
if (x != ivsize) {
|
||||
printf("Error reading PRNG for IV required.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (fwrite(IV,1,ivsize,fdout) != ivsize) {
|
||||
printf("Error writing IV to output.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if ((err = ctr_start(cipher_idx,IV,key,ks,0,CTR_COUNTER_LITTLE_ENDIAN,&ctr)) != CRYPT_OK) {
|
||||
printf("ctr_start error: %s\n",error_to_string(err));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
do {
|
||||
y = fread(inbuf,1,sizeof(inbuf),fdin);
|
||||
|
||||
if ((err = ctr_encrypt(inbuf,ciphertext,y,&ctr)) != CRYPT_OK) {
|
||||
printf("ctr_encrypt error: %s\n", error_to_string(err));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (fwrite(ciphertext,1,y,fdout) != y) {
|
||||
printf("Error writing to output.\n");
|
||||
exit(-1);
|
||||
}
|
||||
} while (y == sizeof(inbuf));
|
||||
fclose(fdout);
|
||||
fclose(fdin);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ref: $Format:%D$ */
|
||||
/* git commit: $Format:%H$ */
|
||||
/* commit time: $Format:%ai$ */
|
||||
397
libtomcrypt/demos/openssl-enc.c
Normal file
397
libtomcrypt/demos/openssl-enc.c
Normal file
@@ -0,0 +1,397 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Demo to do the rough equivalent of:
|
||||
*
|
||||
* openssl enc -aes-256-cbc -pass pass:foobar -in infile -out outfile -p
|
||||
*
|
||||
* Compilation:
|
||||
*
|
||||
* $(CC) -I /path/to/headers -L .../libs \
|
||||
* -o openssl-enc \
|
||||
* openssl-enc.c -ltomcrypt
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* ./openssl-enc <enc|dec> infile outfile "passphrase" [salt]
|
||||
*
|
||||
* If provided, the salt must be EXACTLY a 16-char hex string.
|
||||
*
|
||||
* Demo is an example of:
|
||||
*
|
||||
* - (When decrypting) yanking salt out of the OpenSSL "Salted__..." header
|
||||
* - OpenSSL-compatible key derivation (in OpenSSL's modified PKCS#5v1 approach)
|
||||
* - Grabbing an Initialization Vector from the key generator
|
||||
* - Performing simple block encryption using AES
|
||||
* - PKCS#7-type padding (which hopefully can get ripped out of this demo and
|
||||
* made a libtomcrypt thing someday).
|
||||
*
|
||||
* This program is free for all purposes without any express guarantee it
|
||||
* works. If you really want to see a license here, assume the WTFPL :-)
|
||||
*
|
||||
* BJ Black, bblack@barracuda.com, https://wjblack.com
|
||||
*
|
||||
* BUGS:
|
||||
* Passing a password on a command line is a HORRIBLE idea. Don't use
|
||||
* this program for serious work!
|
||||
*/
|
||||
|
||||
#include <tomcrypt.h>
|
||||
|
||||
#ifndef LTC_RIJNDAEL
|
||||
#error Cannot compile this demo; Rijndael (AES) required
|
||||
#endif
|
||||
#ifndef LTC_CBC_MODE
|
||||
#error Cannot compile this demo; CBC mode required
|
||||
#endif
|
||||
#ifndef LTC_PKCS_5
|
||||
#error Cannot compile this demo; PKCS5 required
|
||||
#endif
|
||||
#ifndef LTC_RNG_GET_BYTES
|
||||
#error Cannot compile this demo; random generator required
|
||||
#endif
|
||||
#ifndef LTC_MD5
|
||||
#error Cannot compile this demo; MD5 required
|
||||
#endif
|
||||
|
||||
/* OpenSSL by default only runs one hash round */
|
||||
#define OPENSSL_ITERATIONS 1
|
||||
/* Use aes-256-cbc, so 256 bits of key, 128 of IV */
|
||||
#define KEY_LENGTH (256>>3)
|
||||
#define IV_LENGTH (128>>3)
|
||||
/* PKCS#5v1 requires exactly an 8-byte salt */
|
||||
#define SALT_LENGTH 8
|
||||
/* The header OpenSSL puts on an encrypted file */
|
||||
static char salt_header[] = { 'S', 'a', 'l', 't', 'e', 'd', '_', '_' };
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* A simple way to handle the possibility that a block may increase in size
|
||||
after padding. */
|
||||
union paddable {
|
||||
unsigned char unpad[1024];
|
||||
unsigned char pad[1024+MAXBLOCKSIZE];
|
||||
};
|
||||
|
||||
/*
|
||||
* Print usage and exit with a bad status (and perror() if any errno).
|
||||
*
|
||||
* Input: argv[0] and the error string
|
||||
* Output: <no return>
|
||||
* Side Effects: print messages and barf (does exit(3))
|
||||
*/
|
||||
void barf(const char *pname, const char *err)
|
||||
{
|
||||
printf("Usage: %s <enc|dec> infile outfile passphrase [salt]\n", pname);
|
||||
printf("\n");
|
||||
printf(" # encrypts infile->outfile, random salt\n");
|
||||
printf(" %s enc infile outfile \"passphrase\"\n", pname);
|
||||
printf("\n");
|
||||
printf(" # encrypts infile->outfile, salt from cmdline\n");
|
||||
printf(" %s enc infile outfile pass 0123456789abcdef\n", pname);
|
||||
printf("\n");
|
||||
printf(" # decrypts infile->outfile, pulls salt from infile\n");
|
||||
printf(" %s dec infile outfile pass\n", pname);
|
||||
printf("\n");
|
||||
printf(" # decrypts infile->outfile, salt specified\n");
|
||||
printf(" # (don't try to read the salt from infile)\n");
|
||||
printf(" %s dec infile outfile pass 0123456789abcdef"
|
||||
"\n", pname);
|
||||
printf("\n");
|
||||
printf("Application Error: %s\n", err);
|
||||
if(errno)
|
||||
perror(" System Error");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse a salt value passed in on the cmdline.
|
||||
*
|
||||
* Input: string passed in and a buf to put it in (exactly 8 bytes!)
|
||||
* Output: CRYPT_OK if parsed OK, CRYPT_ERROR if not
|
||||
* Side Effects: none
|
||||
*/
|
||||
int parse_hex_salt(unsigned char *in, unsigned char *out)
|
||||
{
|
||||
int idx;
|
||||
for(idx=0; idx<SALT_LENGTH; idx++)
|
||||
if(sscanf((char*)in+idx*2, "%02hhx", out+idx) != 1)
|
||||
return CRYPT_ERROR;
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse the Salted__[+8 bytes] from an OpenSSL-compatible file header.
|
||||
*
|
||||
* Input: file to read from and a to put the salt in (exactly 8 bytes!)
|
||||
* Output: CRYPT_OK if parsed OK, CRYPT_ERROR if not
|
||||
* Side Effects: infile's read pointer += 16
|
||||
*/
|
||||
int parse_openssl_header(FILE *in, unsigned char *out)
|
||||
{
|
||||
unsigned char tmp[SALT_LENGTH];
|
||||
if(fread(tmp, 1, sizeof(tmp), in) != sizeof(tmp))
|
||||
return CRYPT_ERROR;
|
||||
if(memcmp(tmp, salt_header, sizeof(tmp)))
|
||||
return CRYPT_ERROR;
|
||||
if(fread(tmp, 1, sizeof(tmp), in) != sizeof(tmp))
|
||||
return CRYPT_ERROR;
|
||||
memcpy(out, tmp, sizeof(tmp));
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Dump a hexed stream of bytes (convenience func).
|
||||
*
|
||||
* Input: buf to read from, length
|
||||
* Output: none
|
||||
* Side Effects: bytes printed as a hex blob, no lf at the end
|
||||
*/
|
||||
void dump_bytes(unsigned char *in, unsigned long len)
|
||||
{
|
||||
unsigned long idx;
|
||||
for(idx=0; idx<len; idx++)
|
||||
printf("%02hhX", *(in+idx));
|
||||
}
|
||||
|
||||
/*
|
||||
* Pad or unpad a message using PKCS#7 padding.
|
||||
* Padding will add 1-(blocksize) bytes and unpadding will remove that amount.
|
||||
* Set is_padding to 1 to pad, 0 to unpad.
|
||||
*
|
||||
* Input: paddable buffer, size read, block length of cipher, mode
|
||||
* Output: number of bytes after padding resp. after unpadding
|
||||
* Side Effects: none
|
||||
*/
|
||||
size_t pkcs7_pad(union paddable *buf, size_t nb, int block_length,
|
||||
int is_padding)
|
||||
{
|
||||
unsigned char padval;
|
||||
off_t idx;
|
||||
|
||||
if(is_padding) {
|
||||
/* We are PADDING this block (and therefore adding bytes) */
|
||||
/* The pad value in PKCS#7 is the number of bytes remaining in
|
||||
the block, so for a 16-byte block and 3 bytes left, it's
|
||||
0x030303. In the oddball case where nb is an exact multiple
|
||||
multiple of block_length, set the padval to blocksize (i.e.
|
||||
add one full block) */
|
||||
padval = (unsigned char) (block_length - (nb % block_length));
|
||||
padval = padval ? padval : block_length;
|
||||
|
||||
memset(buf->pad+nb, padval, padval);
|
||||
return nb+padval;
|
||||
} else {
|
||||
/* We are UNPADDING this block (and removing bytes)
|
||||
We really just need to verify that the pad bytes are correct,
|
||||
so start at the end of the string and work backwards. */
|
||||
|
||||
/* Figure out what the padlength should be by looking at the
|
||||
last byte */
|
||||
idx = nb-1;
|
||||
padval = buf->pad[idx];
|
||||
|
||||
/* padval must be nonzero and <= block length */
|
||||
if(padval <= 0 || padval > block_length)
|
||||
return 0;
|
||||
|
||||
/* First byte's accounted for; do the rest */
|
||||
idx--;
|
||||
|
||||
while(idx >= (off_t)(nb-padval))
|
||||
if(buf->pad[idx] != padval)
|
||||
return 0;
|
||||
else
|
||||
idx--;
|
||||
|
||||
/* If we got here, the pad checked out, so return a smaller
|
||||
number of bytes than nb (basically where we left off+1) */
|
||||
return idx+1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Perform an encrypt/decrypt operation to/from files using AES+CBC+PKCS7 pad.
|
||||
* Set encrypt to 1 to encrypt, 0 to decrypt.
|
||||
*
|
||||
* Input: in/out files, key, iv, and mode
|
||||
* Output: CRYPT_OK if no error
|
||||
* Side Effects: bytes slurped from infile, pushed to outfile, fds updated.
|
||||
*/
|
||||
int do_crypt(FILE *infd, FILE *outfd, unsigned char *key, unsigned char *iv,
|
||||
int encrypt)
|
||||
{
|
||||
union paddable inbuf, outbuf;
|
||||
int cipher, ret;
|
||||
symmetric_CBC cbc;
|
||||
size_t nb;
|
||||
|
||||
/* Register your cipher! */
|
||||
cipher = register_cipher(&aes_desc);
|
||||
if(cipher == -1)
|
||||
return CRYPT_INVALID_CIPHER;
|
||||
|
||||
/* Start a CBC session with cipher/key/val params */
|
||||
ret = cbc_start(cipher, iv, key, KEY_LENGTH, 0, &cbc);
|
||||
if( ret != CRYPT_OK )
|
||||
return -1;
|
||||
|
||||
do {
|
||||
/* Get bytes from the source */
|
||||
nb = fread(inbuf.unpad, 1, sizeof(inbuf.unpad), infd);
|
||||
if(!nb)
|
||||
return encrypt ? CRYPT_OK : CRYPT_ERROR;
|
||||
|
||||
/* Barf if we got a read error */
|
||||
if(ferror(infd))
|
||||
return CRYPT_ERROR;
|
||||
|
||||
if(encrypt) {
|
||||
/* We're encrypting, so pad first (if at EOF) and then
|
||||
crypt */
|
||||
if(feof(infd))
|
||||
nb = pkcs7_pad(&inbuf, nb,
|
||||
aes_desc.block_length, 1);
|
||||
|
||||
ret = cbc_encrypt(inbuf.pad, outbuf.pad, nb, &cbc);
|
||||
if(ret != CRYPT_OK)
|
||||
return ret;
|
||||
|
||||
} else {
|
||||
/* We're decrypting, so decrypt and then unpad if at
|
||||
EOF */
|
||||
ret = cbc_decrypt(inbuf.unpad, outbuf.unpad, nb, &cbc);
|
||||
if( ret != CRYPT_OK )
|
||||
return ret;
|
||||
|
||||
if( feof(infd) )
|
||||
nb = pkcs7_pad(&outbuf, nb,
|
||||
aes_desc.block_length, 0);
|
||||
if(nb == 0)
|
||||
/* The file didn't decrypt correctly */
|
||||
return CRYPT_ERROR;
|
||||
|
||||
}
|
||||
|
||||
/* Push bytes to outfile */
|
||||
if(fwrite(outbuf.unpad, 1, nb, outfd) != nb)
|
||||
return CRYPT_ERROR;
|
||||
|
||||
} while(!feof(infd));
|
||||
|
||||
/* Close up */
|
||||
cbc_done(&cbc);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/* Convenience macro for the various barfable places below */
|
||||
#define BARF(a) { \
|
||||
if(infd) fclose(infd); \
|
||||
if(outfd) { fclose(outfd); remove(argv[3]); } \
|
||||
barf(argv[0], a); \
|
||||
}
|
||||
/*
|
||||
* The main routine. Mostly validate cmdline params, open files, run the KDF,
|
||||
* and do the crypt.
|
||||
*/
|
||||
int main(int argc, char *argv[]) {
|
||||
unsigned char salt[SALT_LENGTH];
|
||||
FILE *infd = NULL, *outfd = NULL;
|
||||
int encrypt = -1;
|
||||
int hash = -1;
|
||||
int ret;
|
||||
unsigned char keyiv[KEY_LENGTH + IV_LENGTH];
|
||||
unsigned long keyivlen = (KEY_LENGTH + IV_LENGTH);
|
||||
unsigned char *key, *iv;
|
||||
|
||||
/* Check proper number of cmdline args */
|
||||
if(argc < 5 || argc > 6)
|
||||
BARF("Invalid number of arguments");
|
||||
|
||||
/* Check proper mode of operation */
|
||||
if (!strncmp(argv[1], "enc", 3))
|
||||
encrypt = 1;
|
||||
else if(!strncmp(argv[1], "dec", 3))
|
||||
encrypt = 0;
|
||||
else
|
||||
BARF("Bad command name");
|
||||
|
||||
/* Check we can open infile/outfile */
|
||||
infd = fopen(argv[2], "rb");
|
||||
if(infd == NULL)
|
||||
BARF("Could not open infile");
|
||||
outfd = fopen(argv[3], "wb");
|
||||
if(outfd == NULL)
|
||||
BARF("Could not open outfile");
|
||||
|
||||
/* Get the salt from wherever */
|
||||
if(argc == 6) {
|
||||
/* User-provided */
|
||||
if(parse_hex_salt((unsigned char*) argv[5], salt) != CRYPT_OK)
|
||||
BARF("Bad user-specified salt");
|
||||
} else if(!strncmp(argv[1], "enc", 3)) {
|
||||
/* Encrypting; get from RNG */
|
||||
if(rng_get_bytes(salt, sizeof(salt), NULL) != sizeof(salt))
|
||||
BARF("Not enough random data");
|
||||
} else {
|
||||
/* Parse from infile (decrypt only) */
|
||||
if(parse_openssl_header(infd, salt) != CRYPT_OK)
|
||||
BARF("Invalid OpenSSL header in infile");
|
||||
}
|
||||
|
||||
/* Fetch the MD5 hasher for PKCS#5 */
|
||||
hash = register_hash(&md5_desc);
|
||||
if(hash == -1)
|
||||
BARF("Could not register MD5 hash");
|
||||
|
||||
/* Set things to a sane initial state */
|
||||
zeromem(keyiv, sizeof(keyiv));
|
||||
key = keyiv + 0; /* key comes first */
|
||||
iv = keyiv + KEY_LENGTH; /* iv comes next */
|
||||
|
||||
/* Run the key derivation from the provided passphrase. This gets us
|
||||
the key and iv. */
|
||||
ret = pkcs_5_alg1_openssl((unsigned char*)argv[4], strlen(argv[4]), salt,
|
||||
OPENSSL_ITERATIONS, hash, keyiv, &keyivlen );
|
||||
if(ret != CRYPT_OK)
|
||||
BARF("Could not derive key/iv from passphrase");
|
||||
|
||||
/* Display the salt/key/iv like OpenSSL cmdline does when -p */
|
||||
printf("salt="); dump_bytes(salt, sizeof(salt)); printf("\n");
|
||||
printf("key="); dump_bytes(key, KEY_LENGTH); printf("\n");
|
||||
printf("iv ="); dump_bytes(iv, IV_LENGTH ); printf("\n");
|
||||
|
||||
/* If we're encrypting, write the salt header as OpenSSL does */
|
||||
if(!strncmp(argv[1], "enc", 3)) {
|
||||
if(fwrite(salt_header, 1, sizeof(salt_header), outfd) !=
|
||||
sizeof(salt_header) )
|
||||
BARF("Error writing salt header to outfile");
|
||||
if(fwrite(salt, 1, sizeof(salt), outfd) != sizeof(salt))
|
||||
BARF("Error writing salt to outfile");
|
||||
}
|
||||
|
||||
/* At this point, the files are open, the salt has been figured out,
|
||||
and we're ready to pump data through crypt. */
|
||||
|
||||
/* Do the crypt operation */
|
||||
if(do_crypt(infd, outfd, key, iv, encrypt) != CRYPT_OK)
|
||||
BARF("Error during crypt operation");
|
||||
|
||||
/* Clean up */
|
||||
fclose(infd); fclose(outfd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ref: $Format:%D$ */
|
||||
/* git commit: $Format:%H$ */
|
||||
/* commit time: $Format:%ai$ */
|
||||
79
libtomcrypt/demos/sizes.c
Normal file
79
libtomcrypt/demos/sizes.c
Normal file
@@ -0,0 +1,79 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
#include "tomcrypt.h"
|
||||
|
||||
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L
|
||||
#include <libgen.h>
|
||||
#else
|
||||
#define basename(x) x
|
||||
#endif
|
||||
/**
|
||||
@file demo_crypt_sizes.c
|
||||
|
||||
Demo how to get various sizes to dynamic languages
|
||||
like Python - Larry Bugbee, February 2013
|
||||
*/
|
||||
|
||||
static void _print_line(const char* cmd, const char* desc)
|
||||
{
|
||||
printf(" %-16s - %s\n", cmd, desc);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if (argc == 1) {
|
||||
/* given a specific size name, get and print its size */
|
||||
char name[] = "ltc_hash_descriptor";
|
||||
unsigned int size;
|
||||
char *sizes_list;
|
||||
unsigned int sizes_list_len;
|
||||
if (crypt_get_size(name, &size) != 0) exit(EXIT_FAILURE);
|
||||
printf("\n size of '%s' is %u \n\n", name, size);
|
||||
|
||||
/* get and print the length of the names (and sizes) list */
|
||||
if (crypt_list_all_sizes(NULL, &sizes_list_len) != 0) exit(EXIT_FAILURE);
|
||||
printf(" need to allocate %u bytes \n\n", sizes_list_len);
|
||||
|
||||
/* get and print the names (and sizes) list */
|
||||
sizes_list = malloc(sizes_list_len);
|
||||
if (crypt_list_all_sizes(sizes_list, &sizes_list_len) != 0) exit(EXIT_FAILURE);
|
||||
printf(" supported sizes:\n\n%s\n\n", sizes_list);
|
||||
} else if (argc == 2) {
|
||||
if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) {
|
||||
char* base = strdup(basename(argv[0]));
|
||||
printf("Usage: %s [-a] [-s name]\n\n", base);
|
||||
_print_line("<no argument>", "The old behavior of the demo");
|
||||
_print_line("-a", "Only lists all sizes");
|
||||
_print_line("-s name", "List a single size given as argument");
|
||||
_print_line("-h", "The help you're looking at");
|
||||
free(base);
|
||||
} else if (strcmp(argv[1], "-a") == 0) {
|
||||
char *sizes_list;
|
||||
unsigned int sizes_list_len;
|
||||
/* get and print the length of the names (and sizes) list */
|
||||
if (crypt_list_all_sizes(NULL, &sizes_list_len) != 0) exit(EXIT_FAILURE);
|
||||
/* get and print the names (and sizes) list */
|
||||
sizes_list = malloc(sizes_list_len);
|
||||
if (crypt_list_all_sizes(sizes_list, &sizes_list_len) != 0) exit(EXIT_FAILURE);
|
||||
printf("%s\n", sizes_list);
|
||||
}
|
||||
} else if (argc == 3) {
|
||||
if (strcmp(argv[1], "-s") == 0) {
|
||||
unsigned int size;
|
||||
if (crypt_get_size(argv[2], &size) != 0) exit(EXIT_FAILURE);
|
||||
printf("%s,%u\n", argv[2], size);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ref: $Format:%D$ */
|
||||
/* git commit: $Format:%H$ */
|
||||
/* commit time: $Format:%ai$ */
|
||||
@@ -1,3 +1,11 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
/* small demo app that just includes a cipher/hash/prng */
|
||||
#include <tomcrypt.h>
|
||||
|
||||
@@ -9,6 +17,6 @@ int main(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* $Source$ */
|
||||
/* $Revision$ */
|
||||
/* $Date$ */
|
||||
/* ref: $Format:%D$ */
|
||||
/* git commit: $Format:%H$ */
|
||||
/* commit time: $Format:%ai$ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,129 +1,25 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
#include <tomcrypt.h>
|
||||
|
||||
void reg_algs(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
#ifdef LTC_RIJNDAEL
|
||||
register_cipher (&aes_desc);
|
||||
#endif
|
||||
#ifdef LTC_BLOWFISH
|
||||
register_cipher (&blowfish_desc);
|
||||
#endif
|
||||
#ifdef LTC_XTEA
|
||||
register_cipher (&xtea_desc);
|
||||
#endif
|
||||
#ifdef LTC_RC5
|
||||
register_cipher (&rc5_desc);
|
||||
#endif
|
||||
#ifdef LTC_RC6
|
||||
register_cipher (&rc6_desc);
|
||||
#endif
|
||||
#ifdef LTC_SAFERP
|
||||
register_cipher (&saferp_desc);
|
||||
#endif
|
||||
#ifdef LTC_TWOFISH
|
||||
register_cipher (&twofish_desc);
|
||||
#endif
|
||||
#ifdef LTC_SAFER
|
||||
register_cipher (&safer_k64_desc);
|
||||
register_cipher (&safer_sk64_desc);
|
||||
register_cipher (&safer_k128_desc);
|
||||
register_cipher (&safer_sk128_desc);
|
||||
#endif
|
||||
#ifdef LTC_RC2
|
||||
register_cipher (&rc2_desc);
|
||||
#endif
|
||||
#ifdef LTC_DES
|
||||
register_cipher (&des_desc);
|
||||
register_cipher (&des3_desc);
|
||||
#endif
|
||||
#ifdef LTC_CAST5
|
||||
register_cipher (&cast5_desc);
|
||||
#endif
|
||||
#ifdef LTC_NOEKEON
|
||||
register_cipher (&noekeon_desc);
|
||||
#endif
|
||||
#ifdef LTC_SKIPJACK
|
||||
register_cipher (&skipjack_desc);
|
||||
#endif
|
||||
#ifdef LTC_ANUBIS
|
||||
register_cipher (&anubis_desc);
|
||||
#endif
|
||||
#ifdef LTC_KHAZAD
|
||||
register_cipher (&khazad_desc);
|
||||
#endif
|
||||
|
||||
#ifdef LTC_TIGER
|
||||
register_hash (&tiger_desc);
|
||||
#endif
|
||||
#ifdef LTC_MD2
|
||||
register_hash (&md2_desc);
|
||||
#endif
|
||||
#ifdef LTC_MD4
|
||||
register_hash (&md4_desc);
|
||||
#endif
|
||||
#ifdef LTC_MD5
|
||||
register_hash (&md5_desc);
|
||||
#endif
|
||||
#ifdef LTC_SHA1
|
||||
register_hash (&sha1_desc);
|
||||
#endif
|
||||
#ifdef LTC_SHA224
|
||||
register_hash (&sha224_desc);
|
||||
#endif
|
||||
#ifdef LTC_SHA256
|
||||
register_hash (&sha256_desc);
|
||||
#endif
|
||||
#ifdef LTC_SHA384
|
||||
register_hash (&sha384_desc);
|
||||
#endif
|
||||
#ifdef LTC_SHA512
|
||||
register_hash (&sha512_desc);
|
||||
#endif
|
||||
#ifdef LTC_RIPEMD128
|
||||
register_hash (&rmd128_desc);
|
||||
#endif
|
||||
#ifdef LTC_RIPEMD160
|
||||
register_hash (&rmd160_desc);
|
||||
#endif
|
||||
#ifdef LTC_WHIRLPOOL
|
||||
register_hash (&whirlpool_desc);
|
||||
#endif
|
||||
#ifdef LTC_CHC_HASH
|
||||
register_hash(&chc_desc);
|
||||
if ((err = chc_register(register_cipher(&aes_desc))) != CRYPT_OK) {
|
||||
printf("chc_register error: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_LTM
|
||||
ltc_mp = ltm_desc;
|
||||
#elif defined(USE_TFM)
|
||||
ltc_mp = tfm_desc;
|
||||
#elif defined(USE_GMP)
|
||||
ltc_mp = gmp_desc;
|
||||
#else
|
||||
extern ltc_math_descriptor EXT_MATH_LIB;
|
||||
ltc_mp = EXT_MATH_LIB;
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
void hash_gen(void)
|
||||
{
|
||||
unsigned char md[MAXBLOCKSIZE], *buf;
|
||||
unsigned long outlen, x, y, z;
|
||||
FILE *out;
|
||||
int err;
|
||||
|
||||
|
||||
out = fopen("hash_tv.txt", "w");
|
||||
if (out == NULL) {
|
||||
perror("can't open hash_tv");
|
||||
}
|
||||
|
||||
|
||||
fprintf(out, "Hash Test Vectors:\n\nThese are the hashes of nn bytes '00 01 02 03 .. (nn-1)'\n\n");
|
||||
for (x = 0; hash_descriptor[x].name != NULL; x++) {
|
||||
buf = XMALLOC(2 * hash_descriptor[x].blocksize + 1);
|
||||
@@ -160,16 +56,16 @@ void cipher_gen(void)
|
||||
int err, kl, lastkl;
|
||||
FILE *out;
|
||||
symmetric_key skey;
|
||||
|
||||
|
||||
out = fopen("cipher_tv.txt", "w");
|
||||
|
||||
fprintf(out,
|
||||
|
||||
fprintf(out,
|
||||
"Cipher Test Vectors\n\nThese are test encryptions with key of nn bytes '00 01 02 03 .. (nn-1)' and original PT of the same style.\n"
|
||||
"The output of step N is used as the key and plaintext for step N+1 (key bytes repeated as required to fill the key)\n\n");
|
||||
|
||||
|
||||
for (x = 0; cipher_descriptor[x].name != NULL; x++) {
|
||||
fprintf(out, "Cipher: %s\n", cipher_descriptor[x].name);
|
||||
|
||||
|
||||
/* three modes, smallest, medium, large keys */
|
||||
lastkl = 10000;
|
||||
for (y = 0; y < 3; y++) {
|
||||
@@ -199,7 +95,7 @@ void cipher_gen(void)
|
||||
printf("setup error: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
for (z = 0; (int)z < cipher_descriptor[x].block_length; z++) {
|
||||
pt[z] = (unsigned char)z;
|
||||
}
|
||||
@@ -226,7 +122,7 @@ void cipher_gen(void)
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fclose(out);
|
||||
}
|
||||
}
|
||||
|
||||
void hmac_gen(void)
|
||||
{
|
||||
@@ -234,17 +130,17 @@ void hmac_gen(void)
|
||||
int x, y, z, err;
|
||||
FILE *out;
|
||||
unsigned long len;
|
||||
|
||||
|
||||
out = fopen("hmac_tv.txt", "w");
|
||||
|
||||
fprintf(out,
|
||||
"LTC_HMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are LTC_HMACed. The initial key is\n"
|
||||
"of the same format (the same length as the HASH output size). The LTC_HMAC key in step N+1 is the LTC_HMAC output of\n"
|
||||
fprintf(out,
|
||||
"HMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are HMACed. The initial key is\n"
|
||||
"of the same format (the same length as the HASH output size). The HMAC key in step N+1 is the HMAC output of\n"
|
||||
"step N.\n\n");
|
||||
|
||||
for (x = 0; hash_descriptor[x].name != NULL; x++) {
|
||||
fprintf(out, "LTC_HMAC-%s\n", hash_descriptor[x].name);
|
||||
|
||||
fprintf(out, "HMAC-%s\n", hash_descriptor[x].name);
|
||||
|
||||
/* initial key */
|
||||
for (y = 0; y < (int)hash_descriptor[x].hashsize; y++) {
|
||||
key[y] = (y&255);
|
||||
@@ -255,7 +151,7 @@ void hmac_gen(void)
|
||||
perror("Can't malloc memory");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
for (y = 0; y <= (int)(hash_descriptor[x].blocksize * 2); y++) {
|
||||
for (z = 0; z < y; z++) {
|
||||
input[z] = (unsigned char)(z & 255);
|
||||
@@ -279,19 +175,20 @@ void hmac_gen(void)
|
||||
}
|
||||
fclose(out);
|
||||
}
|
||||
|
||||
|
||||
void omac_gen(void)
|
||||
{
|
||||
#ifdef LTC_OMAC
|
||||
unsigned char key[MAXBLOCKSIZE], output[MAXBLOCKSIZE], input[MAXBLOCKSIZE*2+2];
|
||||
int err, x, y, z, kl;
|
||||
FILE *out;
|
||||
unsigned long len;
|
||||
|
||||
|
||||
out = fopen("omac_tv.txt", "w");
|
||||
|
||||
fprintf(out,
|
||||
"LTC_OMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are LTC_OMAC'ed. The initial key is\n"
|
||||
"of the same format (length specified per cipher). The LTC_OMAC key in step N+1 is the LTC_OMAC output of\n"
|
||||
fprintf(out,
|
||||
"OMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are OMAC'ed. The initial key is\n"
|
||||
"of the same format (length specified per cipher). The OMAC key in step N+1 is the OMAC output of\n"
|
||||
"step N (repeated as required to fill the array).\n\n");
|
||||
|
||||
for (x = 0; cipher_descriptor[x].name != NULL; x++) {
|
||||
@@ -303,13 +200,13 @@ void omac_gen(void)
|
||||
if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) {
|
||||
kl = cipher_descriptor[x].max_key_length;
|
||||
}
|
||||
fprintf(out, "LTC_OMAC-%s (%d byte key)\n", cipher_descriptor[x].name, kl);
|
||||
|
||||
fprintf(out, "OMAC-%s (%d byte key)\n", cipher_descriptor[x].name, kl);
|
||||
|
||||
/* initial key/block */
|
||||
for (y = 0; y < kl; y++) {
|
||||
key[y] = (y & 255);
|
||||
}
|
||||
|
||||
|
||||
for (y = 0; y <= (int)(cipher_descriptor[x].block_length*2); y++) {
|
||||
for (z = 0; z < y; z++) {
|
||||
input[z] = (unsigned char)(z & 255);
|
||||
@@ -333,20 +230,22 @@ void omac_gen(void)
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fclose(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
void pmac_gen(void)
|
||||
{
|
||||
#ifdef LTC_PMAC
|
||||
unsigned char key[MAXBLOCKSIZE], output[MAXBLOCKSIZE], input[MAXBLOCKSIZE*2+2];
|
||||
int err, x, y, z, kl;
|
||||
FILE *out;
|
||||
unsigned long len;
|
||||
|
||||
|
||||
out = fopen("pmac_tv.txt", "w");
|
||||
|
||||
fprintf(out,
|
||||
"PMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are LTC_OMAC'ed. The initial key is\n"
|
||||
"of the same format (length specified per cipher). The LTC_OMAC key in step N+1 is the LTC_OMAC output of\n"
|
||||
fprintf(out,
|
||||
"PMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are PMAC'ed. The initial key is\n"
|
||||
"of the same format (length specified per cipher). The PMAC key in step N+1 is the PMAC output of\n"
|
||||
"step N (repeated as required to fill the array).\n\n");
|
||||
|
||||
for (x = 0; cipher_descriptor[x].name != NULL; x++) {
|
||||
@@ -359,12 +258,12 @@ void pmac_gen(void)
|
||||
kl = cipher_descriptor[x].max_key_length;
|
||||
}
|
||||
fprintf(out, "PMAC-%s (%d byte key)\n", cipher_descriptor[x].name, kl);
|
||||
|
||||
|
||||
/* initial key/block */
|
||||
for (y = 0; y < kl; y++) {
|
||||
key[y] = (y & 255);
|
||||
}
|
||||
|
||||
|
||||
for (y = 0; y <= (int)(cipher_descriptor[x].block_length*2); y++) {
|
||||
for (z = 0; z < y; z++) {
|
||||
input[z] = (unsigned char)(z & 255);
|
||||
@@ -388,13 +287,15 @@ void pmac_gen(void)
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fclose(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
void eax_gen(void)
|
||||
{
|
||||
#ifdef LTC_EAX_MODE
|
||||
int err, kl, x, y1, z;
|
||||
FILE *out;
|
||||
unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], header[MAXBLOCKSIZE*2],
|
||||
unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], header[MAXBLOCKSIZE*2],
|
||||
plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE];
|
||||
unsigned long len;
|
||||
|
||||
@@ -418,7 +319,7 @@ void eax_gen(void)
|
||||
for (z = 0; z < kl; z++) {
|
||||
key[z] = (z & 255);
|
||||
}
|
||||
|
||||
|
||||
for (y1 = 0; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){
|
||||
for (z = 0; z < y1; z++) {
|
||||
plaintext[z] = (unsigned char)(z & 255);
|
||||
@@ -448,13 +349,15 @@ void eax_gen(void)
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fclose(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ocb_gen(void)
|
||||
{
|
||||
#ifdef LTC_OCB_MODE
|
||||
int err, kl, x, y1, z;
|
||||
FILE *out;
|
||||
unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2],
|
||||
unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2],
|
||||
plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE];
|
||||
unsigned long len;
|
||||
|
||||
@@ -483,7 +386,7 @@ void ocb_gen(void)
|
||||
for (z = 0; z < cipher_descriptor[x].block_length; z++) {
|
||||
nonce[z] = z;
|
||||
}
|
||||
|
||||
|
||||
for (y1 = 0; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){
|
||||
for (z = 0; z < y1; z++) {
|
||||
plaintext[z] = (unsigned char)(z & 255);
|
||||
@@ -511,14 +414,81 @@ void ocb_gen(void)
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fclose(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ocb3_gen(void)
|
||||
{
|
||||
#ifdef LTC_OCB3_MODE
|
||||
int err, kl, x, y1, z, noncelen;
|
||||
FILE *out;
|
||||
unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2],
|
||||
plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE];
|
||||
unsigned long len;
|
||||
|
||||
out = fopen("ocb3_tv.txt", "w");
|
||||
fprintf(out, "OCB3 Test Vectors. Uses the 00010203...NN-1 pattern for nonce/plaintext/key. The outputs\n"
|
||||
"are of the form ciphertext,tag for a given NN. The key for step N>1 is the tag of the previous\n"
|
||||
"step repeated sufficiently. The nonce is fixed throughout. AAD is fixed to 3 bytes (ASCII) 'AAD'.\n\n");
|
||||
|
||||
for (x = 0; cipher_descriptor[x].name != NULL; x++) {
|
||||
kl = cipher_descriptor[x].block_length;
|
||||
|
||||
/* skip ciphers which do not have 64 or 128 bit block sizes */
|
||||
if (kl != 16) continue;
|
||||
|
||||
if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) {
|
||||
kl = cipher_descriptor[x].max_key_length;
|
||||
}
|
||||
fprintf(out, "OCB3-%s (%d byte key)\n", cipher_descriptor[x].name, kl);
|
||||
|
||||
/* the key */
|
||||
for (z = 0; z < kl; z++) {
|
||||
key[z] = (z & 255);
|
||||
}
|
||||
|
||||
/* fixed nonce */
|
||||
noncelen = MIN(15, cipher_descriptor[x].block_length);
|
||||
for (z = 0; z < noncelen; z++) {
|
||||
nonce[z] = z;
|
||||
}
|
||||
|
||||
for (y1 = 0; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){
|
||||
for (z = 0; z < y1; z++) {
|
||||
plaintext[z] = (unsigned char)(z & 255);
|
||||
}
|
||||
len = 16;
|
||||
if ((err = ocb3_encrypt_authenticate_memory(x, key, kl, nonce, noncelen, (unsigned char*)"AAD", 3, plaintext, y1, plaintext, tag, &len)) != CRYPT_OK) {
|
||||
printf("Error OCB3'ing: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
fprintf(out, "%3d: ", y1);
|
||||
for (z = 0; z < y1; z++) {
|
||||
fprintf(out, "%02X", plaintext[z]);
|
||||
}
|
||||
fprintf(out, ", ");
|
||||
for (z = 0; z <(int)len; z++) {
|
||||
fprintf(out, "%02X", tag[z]);
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
|
||||
/* forward the key */
|
||||
for (z = 0; z < kl; z++) {
|
||||
key[z] = tag[z % len];
|
||||
}
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fclose(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ccm_gen(void)
|
||||
{
|
||||
#ifdef LTC_CCM_MODE
|
||||
int err, kl, x, y1, z;
|
||||
FILE *out;
|
||||
unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2],
|
||||
unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2],
|
||||
plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE];
|
||||
unsigned long len;
|
||||
|
||||
@@ -547,7 +517,7 @@ void ccm_gen(void)
|
||||
for (z = 0; z < cipher_descriptor[x].block_length; z++) {
|
||||
nonce[z] = z;
|
||||
}
|
||||
|
||||
|
||||
for (y1 = 0; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){
|
||||
for (z = 0; z < y1; z++) {
|
||||
plaintext[z] = (unsigned char)(z & 255);
|
||||
@@ -557,6 +527,10 @@ void ccm_gen(void)
|
||||
printf("Error CCM'ing: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (len == 0) {
|
||||
printf("Error CCM'ing: zero length\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
fprintf(out, "%3d: ", y1);
|
||||
for (z = 0; z < y1; z++) {
|
||||
fprintf(out, "%02X", plaintext[z]);
|
||||
@@ -575,10 +549,12 @@ void ccm_gen(void)
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fclose(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
void gcm_gen(void)
|
||||
{
|
||||
#ifdef LTC_GCM_MODE
|
||||
int err, kl, x, y1, z;
|
||||
FILE *out;
|
||||
unsigned char key[MAXBLOCKSIZE], plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE];
|
||||
@@ -604,8 +580,8 @@ void gcm_gen(void)
|
||||
for (z = 0; z < kl; z++) {
|
||||
key[z] = (z & 255);
|
||||
}
|
||||
|
||||
for (y1 = 0; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){
|
||||
|
||||
for (y1 = 1; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){
|
||||
for (z = 0; z < y1; z++) {
|
||||
plaintext[z] = (unsigned char)(z & 255);
|
||||
}
|
||||
@@ -614,6 +590,10 @@ void gcm_gen(void)
|
||||
printf("Error GCM'ing: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (len == 0) {
|
||||
printf("Error GCM'ing: zero length\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
fprintf(out, "%3d: ", y1);
|
||||
for (z = 0; z < y1; z++) {
|
||||
fprintf(out, "%02X", plaintext[z]);
|
||||
@@ -632,19 +612,20 @@ void gcm_gen(void)
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fclose(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
void base64_gen(void)
|
||||
{
|
||||
FILE *out;
|
||||
unsigned char dst[256], src[32];
|
||||
unsigned long x, y, len;
|
||||
|
||||
unsigned char dst[256], src[32], ch;
|
||||
unsigned long x, len;
|
||||
|
||||
out = fopen("base64_tv.txt", "w");
|
||||
fprintf(out, "Base64 vectors. These are the base64 encodings of the strings 00,01,02...NN-1\n\n");
|
||||
for (x = 0; x <= 32; x++) {
|
||||
for (y = 0; y < x; y++) {
|
||||
src[y] = y;
|
||||
for (ch = 0; ch < x; ch++) {
|
||||
src[ch] = ch;
|
||||
}
|
||||
len = sizeof(dst);
|
||||
base64_encode(src, x, dst, &len);
|
||||
@@ -681,7 +662,7 @@ void ecc_gen(void)
|
||||
mp_read_radix(modulus, (char *)ltc_ecc_sets[x].prime, 16);
|
||||
mp_read_radix(G->x, (char *)ltc_ecc_sets[x].Gx, 16);
|
||||
mp_read_radix(G->y, (char *)ltc_ecc_sets[x].Gy, 16);
|
||||
mp_set(G->z, 1);
|
||||
mp_set(G->z, 1);
|
||||
|
||||
while (mp_cmp(k, order) == LTC_MP_LT) {
|
||||
ltc_mp.ecc_ptmul(k, G, R, modulus, 1);
|
||||
@@ -699,11 +680,12 @@ void ecc_gen(void)
|
||||
|
||||
void lrw_gen(void)
|
||||
{
|
||||
#ifdef LTC_LRW_MODE
|
||||
FILE *out;
|
||||
unsigned char tweak[16], key[16], iv[16], buf[1024];
|
||||
int x, y, err;
|
||||
symmetric_LRW lrw;
|
||||
|
||||
|
||||
/* initialize default key and tweak */
|
||||
for (x = 0; x < 16; x++) {
|
||||
tweak[x] = key[x] = iv[x] = x;
|
||||
@@ -760,27 +742,61 @@ void lrw_gen(void)
|
||||
lrw_done(&lrw);
|
||||
}
|
||||
fclose(out);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
reg_algs();
|
||||
register_all_ciphers();
|
||||
register_all_hashes();
|
||||
register_all_prngs();
|
||||
#ifdef USE_LTM
|
||||
ltc_mp = ltm_desc;
|
||||
#elif defined(USE_TFM)
|
||||
ltc_mp = tfm_desc;
|
||||
#elif defined(USE_GMP)
|
||||
ltc_mp = gmp_desc;
|
||||
#elif defined(EXT_MATH_LIB)
|
||||
extern ltc_math_descriptor EXT_MATH_LIB;
|
||||
ltc_mp = EXT_MATH_LIB;
|
||||
#else
|
||||
fprintf(stderr, "No MPI provider available\n");
|
||||
exit(EXIT_FAILURE);
|
||||
#endif
|
||||
|
||||
printf("Generating hash vectors..."); fflush(stdout); hash_gen(); printf("done\n");
|
||||
printf("Generating cipher vectors..."); fflush(stdout); cipher_gen(); printf("done\n");
|
||||
printf("Generating LTC_HMAC vectors..."); fflush(stdout); hmac_gen(); printf("done\n");
|
||||
printf("Generating LTC_OMAC vectors..."); fflush(stdout); omac_gen(); printf("done\n");
|
||||
printf("Generating HMAC vectors..."); fflush(stdout); hmac_gen(); printf("done\n");
|
||||
#ifdef LTC_OMAC
|
||||
printf("Generating OMAC vectors..."); fflush(stdout); omac_gen(); printf("done\n");
|
||||
#endif
|
||||
#ifdef LTC_PMAC
|
||||
printf("Generating PMAC vectors..."); fflush(stdout); pmac_gen(); printf("done\n");
|
||||
#endif
|
||||
#ifdef LTC_EAX_MODE
|
||||
printf("Generating EAX vectors..."); fflush(stdout); eax_gen(); printf("done\n");
|
||||
#endif
|
||||
#ifdef LTC_OCB_MODE
|
||||
printf("Generating OCB vectors..."); fflush(stdout); ocb_gen(); printf("done\n");
|
||||
#endif
|
||||
#ifdef LTC_OCB3_MODE
|
||||
printf("Generating OCB3 vectors..."); fflush(stdout); ocb3_gen(); printf("done\n");
|
||||
#endif
|
||||
#ifdef LTC_CCM_MODE
|
||||
printf("Generating CCM vectors..."); fflush(stdout); ccm_gen(); printf("done\n");
|
||||
#endif
|
||||
#ifdef LTC_GCM_MODE
|
||||
printf("Generating GCM vectors..."); fflush(stdout); gcm_gen(); printf("done\n");
|
||||
printf("Generating LTC_BASE64 vectors..."); fflush(stdout); base64_gen(); printf("done\n");
|
||||
#endif
|
||||
printf("Generating BASE64 vectors..."); fflush(stdout); base64_gen(); printf("done\n");
|
||||
printf("Generating MATH vectors..."); fflush(stdout); math_gen(); printf("done\n");
|
||||
printf("Generating ECC vectors..."); fflush(stdout); ecc_gen(); printf("done\n");
|
||||
#ifdef LTC_LRW_MODE
|
||||
printf("Generating LRW vectors..."); fflush(stdout); lrw_gen(); printf("done\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* $Source$ */
|
||||
/* $Revision$ */
|
||||
/* $Date$ */
|
||||
/* ref: $Format:%D$ */
|
||||
/* git commit: $Format:%H$ */
|
||||
/* commit time: $Format:%ai$ */
|
||||
|
||||
2430
libtomcrypt/doc/Doxyfile
Normal file
2430
libtomcrypt/doc/Doxyfile
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
BIN
libtomcrypt/doc/libtomsm.png
Normal file
BIN
libtomcrypt/doc/libtomsm.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
63
libtomcrypt/doc/makefile
Normal file
63
libtomcrypt/doc/makefile
Normal file
@@ -0,0 +1,63 @@
|
||||
ifeq ($V,1)
|
||||
silent=
|
||||
silent_stdout=
|
||||
else
|
||||
silent=@
|
||||
silent_stdout= > /dev/null
|
||||
endif
|
||||
|
||||
#Files left over from making the crypt.pdf.
|
||||
LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out *.lof
|
||||
|
||||
#build the doxy files (requires Doxygen, tetex and patience)
|
||||
.PHONY: doxygen
|
||||
doxygen:
|
||||
doxygen $(silent_stdout)
|
||||
|
||||
patched_doxygen:
|
||||
(cat Doxyfile && echo "HAVE_DOT=no") | doxygen - $(silent_stdout)
|
||||
|
||||
doxy: patched_doxygen
|
||||
${MAKE} -C doxygen/latex $(silent_stdout) && mv -f doxygen/latex/refman.pdf .
|
||||
@echo The huge doxygen PDF should be available as doc/refman.pdf
|
||||
|
||||
#This builds the crypt.pdf file. Note that the rm -f *.pdf has been removed
|
||||
#from the clean command! This is because most people would like to keep the
|
||||
#nice pre-compiled crypt.pdf that comes with libtomcrypt! We only need to
|
||||
#delete it if we are rebuilding it.
|
||||
docs crypt.pdf: crypt.tex
|
||||
rm -f crypt.pdf $(LEFTOVERS)
|
||||
cp crypt.tex crypt.bak
|
||||
touch -r crypt.tex crypt.bak
|
||||
(printf "%s" "\def\fixedpdfdate{"; date +'D:%Y%m%d%H%M%S%:z' -d @$$(stat --format=%Y crypt.tex) | sed "s/:\([0-9][0-9]\)$$/'\1'}/g") > crypt-deterministic.tex
|
||||
printf "%s\n" "\pdfinfo{" >> crypt-deterministic.tex
|
||||
printf "%s\n" " /CreationDate (\fixedpdfdate)" >> crypt-deterministic.tex
|
||||
printf "%s\n}\n" " /ModDate (\fixedpdfdate)" >> crypt-deterministic.tex
|
||||
cat crypt.tex >> crypt-deterministic.tex
|
||||
mv crypt-deterministic.tex crypt.tex
|
||||
touch -r crypt.bak crypt.tex
|
||||
echo "hello" > crypt.ind
|
||||
latex crypt $(silent_stdout)
|
||||
latex crypt $(silent_stdout)
|
||||
makeindex crypt.idx $(silent_stdout)
|
||||
perl ../helper.pl --fixupind crypt.ind
|
||||
pdflatex crypt $(silent_stdout)
|
||||
sed -b -i 's,^/ID \[.*\]$$,/ID [<0> <0>],g' crypt.pdf
|
||||
mv crypt.bak crypt.tex
|
||||
rm -f $(LEFTOVERS)
|
||||
|
||||
docdvi: crypt.tex
|
||||
echo hello > crypt.ind
|
||||
latex crypt $(silent_stdout)
|
||||
latex crypt $(silent_stdout)
|
||||
makeindex crypt.idx
|
||||
perl ../helper.pl --fixupind crypt.ind
|
||||
latex crypt $(silent_stdout)
|
||||
latex crypt $(silent_stdout)
|
||||
|
||||
termdoc: docdvi
|
||||
dvi2tty crypt.dvi -w120
|
||||
|
||||
clean:
|
||||
rm -f $(LEFTOVERS)
|
||||
rm -rf doxygen/
|
||||
384
libtomcrypt/helper.pl
Executable file
384
libtomcrypt/helper.pl
Executable file
@@ -0,0 +1,384 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Getopt::Long;
|
||||
use File::Find 'find';
|
||||
use File::Basename 'basename';
|
||||
use File::Glob 'bsd_glob';
|
||||
|
||||
sub read_file {
|
||||
my $f = shift;
|
||||
open my $fh, "<", $f or die "FATAL: read_rawfile() cannot open file '$f': $!";
|
||||
binmode $fh;
|
||||
return do { local $/; <$fh> };
|
||||
}
|
||||
|
||||
sub write_file {
|
||||
my ($f, $data) = @_;
|
||||
die "FATAL: write_file() no data" unless defined $data;
|
||||
open my $fh, ">", $f or die "FATAL: write_file() cannot open file '$f': $!";
|
||||
binmode $fh;
|
||||
print $fh $data or die "FATAL: write_file() cannot write to '$f': $!";
|
||||
close $fh or die "FATAL: write_file() cannot close '$f': $!";
|
||||
return;
|
||||
}
|
||||
|
||||
sub check_source {
|
||||
my @all_files = (bsd_glob("makefile*"), bsd_glob("*.sh"), bsd_glob("*.pl"));
|
||||
find({ wanted=>sub { push @all_files, $_ if -f $_ }, no_chdir=>1 }, qw/src tests demos/);
|
||||
|
||||
my $fails = 0;
|
||||
for my $file (sort @all_files) {
|
||||
next unless $file =~ /\.(c|h|pl|py|sh)$/ || basename($file) =~ /^makefile/i;
|
||||
my $troubles = {};
|
||||
my $lineno = 1;
|
||||
my $content = read_file($file);
|
||||
push @{$troubles->{crlf_line_end}}, '?' if $content =~ /\r/;
|
||||
for my $l (split /\n/, $content) {
|
||||
push @{$troubles->{merge_conflict}}, $lineno if $l =~ /^(<<<<<<<|=======|>>>>>>>)([^<=>]|$)/;
|
||||
push @{$troubles->{trailing_space}}, $lineno if $l =~ / $/;
|
||||
push @{$troubles->{tab}}, $lineno if $l =~ /\t/ && basename($file) !~ /^makefile/i;
|
||||
push @{$troubles->{non_ascii_char}}, $lineno if $l =~ /[^[:ascii:]]/;
|
||||
push @{$troubles->{cpp_comment}}, $lineno if $file =~ /\.(c|h)$/ && ($l =~ /\s\/\// || $l =~ /\/\/\s/);
|
||||
# in ./src we prefer using XMEMCPY, XMALLOC, XFREE ...
|
||||
push @{$troubles->{unwanted_memcpy}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemcpy\s*\(/;
|
||||
push @{$troubles->{unwanted_malloc}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmalloc\s*\(/;
|
||||
push @{$troubles->{unwanted_realloc}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\brealloc\s*\(/;
|
||||
push @{$troubles->{unwanted_calloc}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bcalloc\s*\(/;
|
||||
push @{$troubles->{unwanted_free}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bfree\s*\(/;
|
||||
push @{$troubles->{unwanted_memset}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemset\s*\(/;
|
||||
push @{$troubles->{unwanted_memcpy}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemcpy\s*\(/;
|
||||
push @{$troubles->{unwanted_memmove}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemmove\s*\(/;
|
||||
push @{$troubles->{unwanted_memcmp}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemcmp\s*\(/;
|
||||
push @{$troubles->{unwanted_strcmp}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bstrcmp\s*\(/;
|
||||
push @{$troubles->{unwanted_clock}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bclock\s*\(/;
|
||||
push @{$troubles->{unwanted_qsort}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bqsort\s*\(/;
|
||||
push @{$troubles->{sizeof_no_brackets}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bsizeof\s*[^\(]/;
|
||||
if ($file =~ m|src/.*\.c$| &&
|
||||
$file !~ m|src/ciphers/.*\.c$| &&
|
||||
$file !~ m|src/hashes/.*\.c$| &&
|
||||
$file !~ m|src/math/.+_desc.c$| &&
|
||||
$file !~ m|src/stream/sober128/sober128_stream.c$| &&
|
||||
$l =~ /^static(\s+[a-zA-Z0-9_]+)+\s+([^_][a-zA-Z0-9_]+)\s*\(/) {
|
||||
push @{$troubles->{staticfunc_name}}, "$lineno($2)";
|
||||
}
|
||||
$lineno++;
|
||||
}
|
||||
for my $k (sort keys %$troubles) {
|
||||
warn "[$k] $file line:" . join(",", @{$troubles->{$k}}) . "\n";
|
||||
$fails++;
|
||||
}
|
||||
}
|
||||
|
||||
warn( $fails > 0 ? "check-source: FAIL $fails\n" : "check-source: PASS\n" );
|
||||
return $fails;
|
||||
}
|
||||
|
||||
sub check_defines {
|
||||
my $fails = 0;
|
||||
my $cust_h = read_file("src/headers/tomcrypt_custom.h");
|
||||
my $cryp_c = read_file("src/misc/crypt/crypt.c");
|
||||
$cust_h =~ s|/\*.*?\*/||sg; # remove comments
|
||||
$cryp_c =~ s|/\*.*?\*/||sg; # remove comments
|
||||
my %def = map { $_ => 1 } map { my $x = $_; $x =~ s/^\s*#define\s+(LTC_\S+).*$/$1/; $x } grep { /^\s*#define\s+LTC_\S+/ } split /\n/, $cust_h;
|
||||
for my $d (sort keys %def) {
|
||||
next if $d =~ /^LTC_(DH\d+|ECC\d+|ECC_\S+|MPI|MUTEX_\S+\(x\)|NO_\S+)$/;
|
||||
warn "$d missing in src/misc/crypt/crypt.c\n" and $fails++ if $cryp_c !~ /\Q$d\E/;
|
||||
}
|
||||
warn( $fails > 0 ? "check-defines: FAIL $fails\n" : "check-defines: PASS\n" );
|
||||
return $fails;
|
||||
}
|
||||
|
||||
sub check_descriptor {
|
||||
my $which = shift;
|
||||
my $what = shift;
|
||||
my @src;
|
||||
my @descriptors;
|
||||
find({ wanted => sub { push @src, $_ if $_ =~ /\.c$/ }, no_chdir=>1 }, "./src/${which}/");
|
||||
for my $f (@src) {
|
||||
my @n = map { my $x = $_; $x =~ s/^.*?ltc_${what}_descriptor\s+(\S+).*$/$1/; $x } grep { $_ =~ /ltc_${what}_descriptor/ } split /\n/, read_file($f);
|
||||
push @descriptors, @n if @n;
|
||||
}
|
||||
my $fails = 0;
|
||||
for my $d (@descriptors) {
|
||||
for my $f ("./src/misc/crypt/crypt_register_all_${which}.c") {
|
||||
my $txt = read_file($f);
|
||||
warn "$d missing in $f\n" and $fails++ if $txt !~ /\Q$d\E/;
|
||||
}
|
||||
}
|
||||
for my $d (@descriptors) {
|
||||
for my $f ("./tests/test.c") {
|
||||
my $txt = read_file($f);
|
||||
warn "$d missing in $f\n" and $fails++ if $txt !~ /\Q$d\E/;
|
||||
}
|
||||
}
|
||||
my $name = sprintf("%-17s", "check-${which}:");
|
||||
warn( $fails > 0 ? "${name}FAIL $fails\n" : "${name}PASS\n" );
|
||||
return $fails;
|
||||
}
|
||||
|
||||
sub check_descriptors {
|
||||
my $fails = 0;
|
||||
$fails = $fails + check_descriptor("ciphers", "cipher");
|
||||
$fails = $fails + check_descriptor("hashes", "hash");
|
||||
$fails = $fails + check_descriptor("prngs", "prng");
|
||||
return $fails;
|
||||
}
|
||||
|
||||
sub check_comments {
|
||||
my $fails = 0;
|
||||
my $first_comment = <<'MARKER';
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
MARKER
|
||||
my $last_comment = <<'MARKER';
|
||||
/* ref: $Format:%D$ */
|
||||
/* git commit: $Format:%H$ */
|
||||
/* commit time: $Format:%ai$ */
|
||||
MARKER
|
||||
my @all_files;
|
||||
find({ wanted=> sub { push @all_files, $_ if $_ =~ /\.(c|h)$/ }, no_chdir=>1 }, 'demos', 'src', 'tests');
|
||||
for my $f (@all_files) {
|
||||
my $txt = read_file($f);
|
||||
if ($txt !~ /^\Q$first_comment\E/s) {
|
||||
warn "[first_comment] $f\n";
|
||||
$fails++;
|
||||
}
|
||||
if ($txt !~ /\Q$last_comment\E\s*$/s) {
|
||||
warn "[last_comment] $f\n";
|
||||
$fails++;
|
||||
}
|
||||
}
|
||||
warn( $fails > 0 ? "check-comments: FAIL $fails\n" : "check-comments: PASS\n" );
|
||||
return $fails;
|
||||
}
|
||||
|
||||
sub prepare_variable {
|
||||
my ($varname, @list) = @_;
|
||||
my $output = "$varname=";
|
||||
my $len = length($output);
|
||||
foreach my $obj (sort @list) {
|
||||
$len = $len + length $obj;
|
||||
$obj =~ s/\*/\$/;
|
||||
if ($len > 100) {
|
||||
$output .= "\\\n";
|
||||
$len = length $obj;
|
||||
}
|
||||
$output .= $obj . ' ';
|
||||
}
|
||||
$output =~ s/ $//;
|
||||
return $output;
|
||||
}
|
||||
|
||||
sub prepare_msvc_files_xml {
|
||||
my ($all, $exclude_re, $targets) = @_;
|
||||
my $last = [];
|
||||
my $depth = 2;
|
||||
|
||||
# sort files in the same order as visual studio (ugly, I know)
|
||||
my @parts = ();
|
||||
for my $orig (@$all) {
|
||||
my $p = $orig;
|
||||
$p =~ s|/|/~|g;
|
||||
$p =~ s|/~([^/]+)$|/$1|g;
|
||||
# now we have: 'src/pk/rsa/rsa_verify_hash.c' > 'src/~pk/~rsa/rsa_verify_hash.c'
|
||||
my @l = map { sprintf "% -99s", $_ } split /\//, $p;
|
||||
push @parts, [ $orig, join(':', @l) ];
|
||||
}
|
||||
my @sorted = map { $_->[0] } sort { $a->[1] cmp $b->[1] } @parts;
|
||||
|
||||
my $files = "<Files>\r\n";
|
||||
for my $full (@sorted) {
|
||||
my @items = split /\//, $full; # split by '/'
|
||||
$full =~ s|/|\\|g; # replace '/' bt '\'
|
||||
shift @items; # drop first one (src)
|
||||
pop @items; # drop last one (filename.ext)
|
||||
my $current = \@items;
|
||||
if (join(':', @$current) ne join(':', @$last)) {
|
||||
my $common = 0;
|
||||
$common++ while ($last->[$common] && $current->[$common] && $last->[$common] eq $current->[$common]);
|
||||
my $back = @$last - $common;
|
||||
if ($back > 0) {
|
||||
$files .= ("\t" x --$depth) . "</Filter>\r\n" for (1..$back);
|
||||
}
|
||||
my $fwd = [ @$current ]; splice(@$fwd, 0, $common);
|
||||
for my $i (0..scalar(@$fwd) - 1) {
|
||||
$files .= ("\t" x $depth) . "<Filter\r\n";
|
||||
$files .= ("\t" x $depth) . "\tName=\"$fwd->[$i]\"\r\n";
|
||||
$files .= ("\t" x $depth) . "\t>\r\n";
|
||||
$depth++;
|
||||
}
|
||||
$last = $current;
|
||||
}
|
||||
$files .= ("\t" x $depth) . "<File\r\n";
|
||||
$files .= ("\t" x $depth) . "\tRelativePath=\"$full\"\r\n";
|
||||
$files .= ("\t" x $depth) . "\t>\r\n";
|
||||
if ($full =~ $exclude_re) {
|
||||
for (@$targets) {
|
||||
$files .= ("\t" x $depth) . "\t<FileConfiguration\r\n";
|
||||
$files .= ("\t" x $depth) . "\t\tName=\"$_\"\r\n";
|
||||
$files .= ("\t" x $depth) . "\t\tExcludedFromBuild=\"true\"\r\n";
|
||||
$files .= ("\t" x $depth) . "\t\t>\r\n";
|
||||
$files .= ("\t" x $depth) . "\t\t<Tool\r\n";
|
||||
$files .= ("\t" x $depth) . "\t\t\tName=\"VCCLCompilerTool\"\r\n";
|
||||
$files .= ("\t" x $depth) . "\t\t\tAdditionalIncludeDirectories=\"\"\r\n";
|
||||
$files .= ("\t" x $depth) . "\t\t\tPreprocessorDefinitions=\"\"\r\n";
|
||||
$files .= ("\t" x $depth) . "\t\t/>\r\n";
|
||||
$files .= ("\t" x $depth) . "\t</FileConfiguration>\r\n";
|
||||
}
|
||||
}
|
||||
########### aes_enc "hack" disabled - discussion: https://github.com/libtom/libtomcrypt/pull/158
|
||||
# if ($full eq 'src\ciphers\aes\aes.c') { #hack
|
||||
# my %cmd = (
|
||||
# 'Debug|Win32' => [ 'Debug/aes.obj;Debug/aes_enc.obj', 'cl /nologo /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Debug/libtomcrypt.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c $(InputPath)
cl /nologo /DENCRYPT_ONLY /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Debug/libtomcrypt.pch" /YX /Fo"Debug/aes_enc.obj" /Fd"Debug/" /FD /GZ /c $(InputPath)
' ],
|
||||
# 'Release|Win32' => [ 'Release/aes.obj;Release/aes_enc.obj', 'cl /nologo /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Release/libtomcrypt.pch" /YX /Fo"Release/" /Fd"Release/" /FD /GZ /c $(InputPath)
cl /nologo /DENCRYPT_ONLY /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Release/libtomcrypt.pch" /YX /Fo"Release/aes_enc.obj" /Fd"Release/" /FD /GZ /c $(InputPath)
' ],
|
||||
# );
|
||||
# for (@$targets) {
|
||||
# next unless $cmd{$_};
|
||||
# $files .= ("\t" x $depth) . "\t<FileConfiguration\r\n";
|
||||
# $files .= ("\t" x $depth) . "\t\tName=\"$_\"\r\n";
|
||||
# $files .= ("\t" x $depth) . "\t\t>\r\n";
|
||||
# $files .= ("\t" x $depth) . "\t\t<Tool\r\n";
|
||||
# $files .= ("\t" x $depth) . "\t\t\tName=\"VCCustomBuildTool\"\r\n";
|
||||
# $files .= ("\t" x $depth) . "\t\t\tCommandLine=\"$cmd{$_}[1]\"\r\n";
|
||||
# $files .= ("\t" x $depth) . "\t\t\tOutputs=\"$cmd{$_}[0]\"\r\n";
|
||||
# $files .= ("\t" x $depth) . "\t\t/>\r\n";
|
||||
# $files .= ("\t" x $depth) . "\t</FileConfiguration>\r\n";
|
||||
# }
|
||||
# }
|
||||
$files .= ("\t" x $depth) . "</File>\r\n";
|
||||
}
|
||||
$files .= ("\t" x --$depth) . "</Filter>\r\n" for (@$last);
|
||||
$files .= "\t</Files>";
|
||||
return $files;
|
||||
}
|
||||
|
||||
sub patch_file {
|
||||
my ($content, @variables) = @_;
|
||||
for my $v (@variables) {
|
||||
if ($v =~ /^([A-Z0-9_]+)\s*=.*$/si) {
|
||||
my $name = $1;
|
||||
$content =~ s/\n\Q$name\E\b.*?[^\\]\n/\n$v\n/s;
|
||||
}
|
||||
else {
|
||||
die "patch_file failed: " . substr($v, 0, 30) . "..";
|
||||
}
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
sub version_from_tomcrypt_h {
|
||||
my $h = read_file(shift);
|
||||
if ($h =~ /\n#define\s*SCRYPT\s*"([0-9]+)\.([0-9]+)\.([0-9]+)(.*)"/s) {
|
||||
return "VERSION_PC=$1.$2.$3", "VERSION_LT=1:1", "VERSION=$1.$2.$3$4", "PROJECT_NUMBER=$1.$2.$3$4";
|
||||
}
|
||||
else {
|
||||
die "#define SCRYPT not found in tomcrypt.h";
|
||||
}
|
||||
}
|
||||
|
||||
sub process_makefiles {
|
||||
my $write = shift;
|
||||
my $changed_count = 0;
|
||||
my @c = ();
|
||||
find({ no_chdir => 1, wanted => sub { push @c, $_ if -f $_ && $_ =~ /\.c$/ && $_ !~ /tab.c$/ } }, 'src');
|
||||
my @h = ();
|
||||
find({ no_chdir => 1, wanted => sub { push @h, $_ if -f $_ && $_ =~ /\.h$/ && $_ !~ /dh_static.h$/ } }, 'src');
|
||||
my @all = ();
|
||||
find({ no_chdir => 1, wanted => sub { push @all, $_ if -f $_ && $_ =~ /\.(c|h)$/ } }, 'src');
|
||||
my @t = qw();
|
||||
find({ no_chdir => 1, wanted => sub { push @t, $_ if $_ =~ /(common|no_prng|_tests?|test).c$/ } }, 'tests');
|
||||
|
||||
my @o = sort ('src/ciphers/aes/aes_enc.o', map { my $x = $_; $x =~ s/\.c$/.o/; $x } @c);
|
||||
my $var_o = prepare_variable("OBJECTS", @o);
|
||||
my $var_h = prepare_variable("HEADERS", (sort @h));
|
||||
(my $var_obj = $var_o) =~ s/\.o\b/.obj/sg;
|
||||
|
||||
my $var_to = prepare_variable("TOBJECTS", sort map { my $x = $_; $x =~ s/\.c$/.o/; $x } @t);
|
||||
(my $var_tobj = $var_to) =~ s/\.o\b/.obj/sg;
|
||||
|
||||
my @ver_version = version_from_tomcrypt_h("src/headers/tomcrypt.h");
|
||||
|
||||
# update MSVC project files
|
||||
my $msvc_files = prepare_msvc_files_xml(\@all, qr/tab\.c$/, ['Debug|Win32', 'Release|Win32', 'Debug|x64', 'Release|x64']);
|
||||
for my $m (qw/libtomcrypt_VS2008.vcproj/) {
|
||||
my $old = read_file($m);
|
||||
my $new = $old;
|
||||
$new =~ s|<Files>.*</Files>|$msvc_files|s;
|
||||
if ($old ne $new) {
|
||||
write_file($m, $new) if $write;
|
||||
warn "changed: $m\n";
|
||||
$changed_count++;
|
||||
}
|
||||
}
|
||||
|
||||
# update OBJECTS + HEADERS in makefile*
|
||||
for my $m (qw/ makefile makefile.shared makefile.unix makefile.mingw makefile.msvc makefile_include.mk doc\/Doxyfile /) {
|
||||
my $old = read_file($m);
|
||||
my $new = $m eq 'makefile.msvc' ? patch_file($old, $var_obj, $var_h, $var_tobj, @ver_version)
|
||||
: patch_file($old, $var_o, $var_h, $var_to, @ver_version);
|
||||
if ($old ne $new) {
|
||||
write_file($m, $new) if $write;
|
||||
warn "changed: $m\n";
|
||||
$changed_count++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($write) {
|
||||
return 0; # no failures
|
||||
}
|
||||
else {
|
||||
warn( $changed_count > 0 ? "check-makefiles: FAIL $changed_count\n" : "check-makefiles: PASS\n" );
|
||||
return $changed_count;
|
||||
}
|
||||
}
|
||||
|
||||
sub die_usage {
|
||||
die <<"MARKER";
|
||||
usage: $0 -s OR $0 --check-source
|
||||
$0 -c OR $0 --check-descriptors
|
||||
$0 -d OR $0 --check-defines
|
||||
$0 -o OR $0 --check-comments
|
||||
$0 -m OR $0 --check-makefiles
|
||||
$0 -a OR $0 --check-all
|
||||
$0 -u OR $0 --update-makefiles
|
||||
$0 --fixupind crypt.ind
|
||||
MARKER
|
||||
}
|
||||
|
||||
GetOptions( "s|check-source" => \my $check_source,
|
||||
"c|check-descriptors" => \my $check_descriptors,
|
||||
"d|check-defines" => \my $check_defines,
|
||||
"o|check-comments" => \my $check_comments,
|
||||
"m|check-makefiles" => \my $check_makefiles,
|
||||
"a|check-all" => \my $check_all,
|
||||
"u|update-makefiles" => \my $update_makefiles,
|
||||
"f|fixupind=s" => \my $fixupind,
|
||||
"h|help" => \my $help
|
||||
) or die_usage;
|
||||
|
||||
if ($fixupind) {
|
||||
my $txt = read_file($fixupind);
|
||||
$txt =~ s/^([^\n]*\n)/$1\n\\addcontentsline{toc}{chapter}{Index}\n/s;
|
||||
write_file($fixupind, $txt);
|
||||
exit 0;
|
||||
}
|
||||
|
||||
my $failure;
|
||||
$failure ||= check_source() if $check_all || $check_source;
|
||||
$failure ||= check_defines() if $check_all || $check_defines;
|
||||
$failure ||= check_descriptors() if $check_all || $check_descriptors;
|
||||
$failure ||= check_comments() if $check_all || $check_comments;
|
||||
$failure ||= process_makefiles(0) if $check_all || $check_makefiles;
|
||||
$failure ||= process_makefiles(1) if $update_makefiles;
|
||||
|
||||
die_usage unless defined $failure;
|
||||
exit $failure ? 1 : 0;
|
||||
288
libtomcrypt/makefile.mingw
Normal file
288
libtomcrypt/makefile.mingw
Normal file
@@ -0,0 +1,288 @@
|
||||
# MAKEFILE for MS Windows (mingw + gcc + gmake)
|
||||
#
|
||||
# BEWARE: variables OBJECTS, TOBJECTS, HEADERS, VERSION are updated via ./updatemakes.sh
|
||||
|
||||
### USAGE:
|
||||
# Open a command prompt with gcc + gmake in PATH and start:
|
||||
#
|
||||
# gmake -f makefile.mingw all
|
||||
# test.exe
|
||||
# gmake -f makefile.mingw PREFIX=c:\devel\libtom install
|
||||
#
|
||||
#Or:
|
||||
#
|
||||
# gmake -f makefile.mingw CFLAGS="-O3 -DUSE_LTM -DLTM_DESC -Ic:/path/to/libtommath" EXTRALIBS="-Lc:/path/to/libtommath -ltommath" all
|
||||
#
|
||||
|
||||
#The following can be overridden from command line e.g. make -f makefile.mingw CC=gcc ARFLAGS=rcs
|
||||
PREFIX = c:\mingw
|
||||
CC = gcc
|
||||
AR = ar
|
||||
ARFLAGS = r
|
||||
RANLIB = ranlib
|
||||
STRIP = strip
|
||||
CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath
|
||||
EXTRALIBS = -L../libtommath -ltommath
|
||||
|
||||
#Compilation flags
|
||||
LTC_CFLAGS = -Isrc/headers -Itests -DLTC_SOURCE $(CFLAGS)
|
||||
LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS)
|
||||
VERSION=1.18.1
|
||||
|
||||
#Libraries to be created
|
||||
LIBMAIN_S =libtomcrypt.a
|
||||
LIBMAIN_I =libtomcrypt.dll.a
|
||||
LIBMAIN_D =libtomcrypt.dll
|
||||
|
||||
#List of objects to compile (all goes to libtomcrypt.a)
|
||||
OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \
|
||||
src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \
|
||||
src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \
|
||||
src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \
|
||||
src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \
|
||||
src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \
|
||||
src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \
|
||||
src/encauth/ccm/ccm_test.o src/encauth/chachapoly/chacha20poly1305_add_aad.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_decrypt.o src/encauth/chachapoly/chacha20poly1305_done.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_encrypt.o src/encauth/chachapoly/chacha20poly1305_init.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_memory.o src/encauth/chachapoly/chacha20poly1305_setiv.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_test.o src/encauth/eax/eax_addheader.o \
|
||||
src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \
|
||||
src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \
|
||||
src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \
|
||||
src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \
|
||||
src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \
|
||||
src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \
|
||||
src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \
|
||||
src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \
|
||||
src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \
|
||||
src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \
|
||||
src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \
|
||||
src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \
|
||||
src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \
|
||||
src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o src/encauth/ocb3/ocb3_int_ntz.o \
|
||||
src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o src/hashes/blake2b.o \
|
||||
src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \
|
||||
src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \
|
||||
src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \
|
||||
src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \
|
||||
src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \
|
||||
src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \
|
||||
src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/blake2/blake2bmac.o \
|
||||
src/mac/blake2/blake2bmac_file.o src/mac/blake2/blake2bmac_memory.o \
|
||||
src/mac/blake2/blake2bmac_memory_multi.o src/mac/blake2/blake2bmac_test.o src/mac/blake2/blake2smac.o \
|
||||
src/mac/blake2/blake2smac_file.o src/mac/blake2/blake2smac_memory.o \
|
||||
src/mac/blake2/blake2smac_memory_multi.o src/mac/blake2/blake2smac_test.o src/mac/f9/f9_done.o \
|
||||
src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \
|
||||
src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \
|
||||
src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \
|
||||
src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \
|
||||
src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \
|
||||
src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \
|
||||
src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \
|
||||
src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \
|
||||
src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \
|
||||
src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \
|
||||
src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \
|
||||
src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \
|
||||
src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \
|
||||
src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \
|
||||
src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \
|
||||
src/math/radix_to_bin.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \
|
||||
src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \
|
||||
src/misc/compare_testvector.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \
|
||||
src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \
|
||||
src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \
|
||||
src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \
|
||||
src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \
|
||||
src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \
|
||||
src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \
|
||||
src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \
|
||||
src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \
|
||||
src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \
|
||||
src/misc/crypt/crypt_register_all_ciphers.o src/misc/crypt/crypt_register_all_hashes.o \
|
||||
src/misc/crypt/crypt_register_all_prngs.o src/misc/crypt/crypt_register_cipher.o \
|
||||
src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \
|
||||
src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \
|
||||
src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \
|
||||
src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \
|
||||
src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \
|
||||
src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \
|
||||
src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \
|
||||
src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \
|
||||
src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \
|
||||
src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \
|
||||
src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \
|
||||
src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \
|
||||
src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \
|
||||
src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \
|
||||
src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o src/modes/lrw/lrw_encrypt.o \
|
||||
src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o src/modes/lrw/lrw_setiv.o \
|
||||
src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \
|
||||
src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \
|
||||
src/modes/ofb/ofb_start.o src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o \
|
||||
src/modes/xts/xts_encrypt.o src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o \
|
||||
src/modes/xts/xts_test.o src/pk/asn1/der/bit/der_decode_bit_string.o \
|
||||
src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \
|
||||
src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \
|
||||
src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \
|
||||
src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \
|
||||
src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \
|
||||
src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \
|
||||
src/pk/asn1/der/generalizedtime/der_length_generalizedtime.o \
|
||||
src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \
|
||||
src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \
|
||||
src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \
|
||||
src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \
|
||||
src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \
|
||||
src/pk/asn1/der/object_identifier/der_length_object_identifier.o \
|
||||
src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \
|
||||
src/pk/asn1/der/octet/der_length_octet_string.o \
|
||||
src/pk/asn1/der/printable_string/der_decode_printable_string.o \
|
||||
src/pk/asn1/der/printable_string/der_encode_printable_string.o \
|
||||
src/pk/asn1/der/printable_string/der_length_printable_string.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_ex.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_multi.o \
|
||||
src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_ex.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_multi.o \
|
||||
src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \
|
||||
src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \
|
||||
src/pk/asn1/der/sequence/der_sequence_shrink.o src/pk/asn1/der/set/der_encode_set.o \
|
||||
src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \
|
||||
src/pk/asn1/der/short_integer/der_encode_short_integer.o \
|
||||
src/pk/asn1/der/short_integer/der_length_short_integer.o \
|
||||
src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \
|
||||
src/pk/asn1/der/teletex_string/der_length_teletex_string.o \
|
||||
src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \
|
||||
src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \
|
||||
src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \
|
||||
src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_key.o \
|
||||
src/pk/dh/dh_free.o src/pk/dh/dh_generate_key.o src/pk/dh/dh_import.o src/pk/dh/dh_set.o \
|
||||
src/pk/dh/dh_set_pg_dhparam.o src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o \
|
||||
src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o \
|
||||
src/pk/dsa/dsa_generate_key.o src/pk/dsa/dsa_generate_pqg.o src/pk/dsa/dsa_import.o \
|
||||
src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_set.o src/pk/dsa/dsa_set_pqg_dsaparam.o \
|
||||
src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o \
|
||||
src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o src/pk/ecc/ecc_ansi_x963_export.o \
|
||||
src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o \
|
||||
src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o \
|
||||
src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o \
|
||||
src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \
|
||||
src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \
|
||||
src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \
|
||||
src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \
|
||||
src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \
|
||||
src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \
|
||||
src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \
|
||||
src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \
|
||||
src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \
|
||||
src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \
|
||||
src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \
|
||||
src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_pkcs8.o src/pk/rsa/rsa_import_x509.o \
|
||||
src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_set.o src/pk/rsa/rsa_sign_hash.o \
|
||||
src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o \
|
||||
src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \
|
||||
src/prngs/sprng.o src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \
|
||||
src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \
|
||||
src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \
|
||||
src/stream/rc4/rc4_stream.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128_stream.o \
|
||||
src/stream/sober128/sober128_test.o
|
||||
|
||||
#List of test objects to compile
|
||||
TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_test.o tests/dh_test.o \
|
||||
tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \
|
||||
tests/modes_test.o tests/mpi_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o \
|
||||
tests/pkcs_1_emsa_test.o tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o \
|
||||
tests/prng_test.o tests/rotate_test.o tests/rsa_test.o tests/store_test.o tests/test.o
|
||||
|
||||
#The following headers will be installed by "make install"
|
||||
HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \
|
||||
src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \
|
||||
src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \
|
||||
src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \
|
||||
src/headers/tomcrypt_prng.h
|
||||
|
||||
#The default rule for make builds the libtomcrypt.a library (static)
|
||||
default: $(LIBMAIN_S)
|
||||
|
||||
#SPECIAL: AES comes in two flavours - enc+dec and enc-only
|
||||
src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
$(CC) $(LTC_CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o
|
||||
|
||||
#SPECIAL: these are the rules to make certain object files
|
||||
src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c
|
||||
src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c
|
||||
src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c
|
||||
src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c
|
||||
src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c
|
||||
src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
|
||||
|
||||
#Dependencies on *.h
|
||||
$(OBJECTS): $(HEADERS)
|
||||
$(TOBJECTS): $(HEADERS) tests/tomcrypt_test.h
|
||||
|
||||
.c.o:
|
||||
$(CC) $(LTC_CFLAGS) -c $< -o $@
|
||||
|
||||
#Create libtomcrypt.a
|
||||
$(LIBMAIN_S): $(OBJECTS)
|
||||
$(AR) $(ARFLAGS) $@ $(OBJECTS)
|
||||
$(RANLIB) $@
|
||||
|
||||
#Create DLL + import library libtomcrypt.dll.a
|
||||
$(LIBMAIN_D) $(LIBMAIN_I): $(OBJECTS)
|
||||
$(CC) -s -shared -o $(LIBMAIN_D) $^ -Wl,--enable-auto-import,--export-all -Wl,--out-implib=$(LIBMAIN_I) $(LTC_LDFLAGS)
|
||||
$(STRIP) -S $(LIBMAIN_D)
|
||||
|
||||
#Demo tools/utilities
|
||||
hashsum.exe: demos/hashsum.o $(LIBMAIN_S)
|
||||
$(CC) demos/hashsum.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
ltcrypt.exe: demos/ltcrypt.o $(LIBMAIN_S)
|
||||
$(CC) demos/ltcrypt.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
small.exe: demos/small.o $(LIBMAIN_S)
|
||||
$(CC) demos/small.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
tv_gen.exe: demos/tv_gen.o $(LIBMAIN_S)
|
||||
$(CC) demos/tv_gen.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
sizes.exe: demos/sizes.o $(LIBMAIN_S)
|
||||
$(CC) demos/sizes.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
constants.exe: demos/constants.o $(LIBMAIN_S)
|
||||
$(CC) demos/constants.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
timing.exe: demos/timing.o $(LIBMAIN_S)
|
||||
$(CC) demos/timing.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
|
||||
#Tests
|
||||
test.exe: $(TOBJECTS) $(LIBMAIN_S)
|
||||
$(CC) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
@echo NOTICE: start the tests by launching test.exe
|
||||
|
||||
all: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) hashsum.exe ltcrypt.exe small.exe tv_gen.exe sizes.exe constants.exe timing.exe test.exe
|
||||
|
||||
test: test.exe
|
||||
|
||||
clean:
|
||||
@-cmd /c del /Q *_tv.txt 2>nul
|
||||
@-cmd /c del /Q /S *.o *.a *.exe *.dll 2>nul
|
||||
|
||||
#Install the library + headers
|
||||
install: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D)
|
||||
cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin"
|
||||
cmd /c if not exist "$(PREFIX)\lib" mkdir "$(PREFIX)\lib"
|
||||
cmd /c if not exist "$(PREFIX)\include" mkdir "$(PREFIX)\include"
|
||||
copy /Y $(LIBMAIN_S) "$(PREFIX)\lib"
|
||||
copy /Y $(LIBMAIN_I) "$(PREFIX)\lib"
|
||||
copy /Y $(LIBMAIN_D) "$(PREFIX)\bin"
|
||||
copy /Y src\headers\tomcrypt*.h "$(PREFIX)\include"
|
||||
|
||||
#Install useful tools
|
||||
install_bins: hashsum
|
||||
cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin"
|
||||
copy /Y hashsum.exe "$(PREFIX)\bin"
|
||||
|
||||
#Install documentation
|
||||
install_docs: doc/crypt.pdf
|
||||
cmd /c if not exist "$(PREFIX)\doc" mkdir "$(PREFIX)\doc"
|
||||
copy /Y doc\crypt.pdf "$(PREFIX)\doc"
|
||||
@@ -1,79 +1,132 @@
|
||||
#MSVC Makefile [tested with MSVC 6.00 with SP5]
|
||||
# MAKEFILE for MS Windows (nmake + Windows SDK)
|
||||
#
|
||||
#Tom St Denis
|
||||
CFLAGS = /Isrc/headers/ /Itestprof/ /Ox /DWIN32 /DLTC_SOURCE /W3 /Fo$@ $(CF)
|
||||
# BEWARE: variables OBJECTS, TOBJECTS, HEADERS, VERSION are updated via ./updatemakes.sh
|
||||
|
||||
#START_INS
|
||||
OBJECTS=src/ciphers/aes/aes_enc.obj src/ciphers/aes/aes.obj src/ciphers/anubis.obj src/ciphers/blowfish.obj \
|
||||
src/ciphers/cast5.obj src/ciphers/des.obj src/ciphers/kasumi.obj src/ciphers/khazad.obj src/ciphers/kseed.obj \
|
||||
src/ciphers/multi2.obj src/ciphers/noekeon.obj src/ciphers/rc2.obj src/ciphers/rc5.obj src/ciphers/rc6.obj \
|
||||
src/ciphers/safer/safer.obj src/ciphers/safer/saferp.obj src/ciphers/safer/safer_tab.obj \
|
||||
src/ciphers/skipjack.obj src/ciphers/twofish/twofish.obj src/ciphers/xtea.obj src/encauth/ccm/ccm_memory.obj \
|
||||
src/encauth/ccm/ccm_test.obj src/encauth/eax/eax_addheader.obj src/encauth/eax/eax_decrypt.obj \
|
||||
src/encauth/eax/eax_decrypt_verify_memory.obj src/encauth/eax/eax_done.obj \
|
||||
src/encauth/eax/eax_encrypt_authenticate_memory.obj src/encauth/eax/eax_encrypt.obj \
|
||||
### USAGE:
|
||||
# Open a command prompt with WinSDK variables set and start:
|
||||
#
|
||||
# nmake -f makefile.msvc all
|
||||
# test.exe
|
||||
# nmake -f makefile.msvc PREFIX=c:\devel\libtom install
|
||||
#
|
||||
#Or:
|
||||
#
|
||||
# nmake -f makefile.msvc CFLAGS="/DUSE_LTM /DLTM_DESC /Ic:\path\to\libtommath" EXTRALIBS=c:\path\to\libtommath\tommath.lib all
|
||||
#
|
||||
|
||||
#The following can be overridden from command line e.g. make -f makefile.msvc CC=gcc ARFLAGS=rcs
|
||||
PREFIX = c:\devel
|
||||
CFLAGS = /Ox /DUSE_LTM /DLTM_DESC /I../libtommath
|
||||
EXTRALIBS = ../libtommath/tommath.lib
|
||||
|
||||
#Compilation flags
|
||||
LTC_CFLAGS = /nologo /Isrc/headers/ /Itests/ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DLTC_SOURCE /W3 $(CFLAGS)
|
||||
LTC_LDFLAGS = advapi32.lib $(EXTRALIBS)
|
||||
VERSION=1.18.1
|
||||
|
||||
#Libraries to be created (this makefile builds only static libraries)
|
||||
LIBMAIN_S =tomcrypt.lib
|
||||
|
||||
#List of objects to compile (all goes to tomcrypt.lib)
|
||||
OBJECTS=src/ciphers/aes/aes.obj src/ciphers/aes/aes_enc.obj src/ciphers/anubis.obj src/ciphers/blowfish.obj \
|
||||
src/ciphers/camellia.obj src/ciphers/cast5.obj src/ciphers/des.obj src/ciphers/kasumi.obj src/ciphers/khazad.obj \
|
||||
src/ciphers/kseed.obj src/ciphers/multi2.obj src/ciphers/noekeon.obj src/ciphers/rc2.obj src/ciphers/rc5.obj \
|
||||
src/ciphers/rc6.obj src/ciphers/safer/safer.obj src/ciphers/safer/saferp.obj src/ciphers/skipjack.obj \
|
||||
src/ciphers/twofish/twofish.obj src/ciphers/xtea.obj src/encauth/ccm/ccm_add_aad.obj \
|
||||
src/encauth/ccm/ccm_add_nonce.obj src/encauth/ccm/ccm_done.obj src/encauth/ccm/ccm_init.obj \
|
||||
src/encauth/ccm/ccm_memory.obj src/encauth/ccm/ccm_process.obj src/encauth/ccm/ccm_reset.obj \
|
||||
src/encauth/ccm/ccm_test.obj src/encauth/chachapoly/chacha20poly1305_add_aad.obj \
|
||||
src/encauth/chachapoly/chacha20poly1305_decrypt.obj src/encauth/chachapoly/chacha20poly1305_done.obj \
|
||||
src/encauth/chachapoly/chacha20poly1305_encrypt.obj src/encauth/chachapoly/chacha20poly1305_init.obj \
|
||||
src/encauth/chachapoly/chacha20poly1305_memory.obj src/encauth/chachapoly/chacha20poly1305_setiv.obj \
|
||||
src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.obj \
|
||||
src/encauth/chachapoly/chacha20poly1305_test.obj src/encauth/eax/eax_addheader.obj \
|
||||
src/encauth/eax/eax_decrypt.obj src/encauth/eax/eax_decrypt_verify_memory.obj src/encauth/eax/eax_done.obj \
|
||||
src/encauth/eax/eax_encrypt.obj src/encauth/eax/eax_encrypt_authenticate_memory.obj \
|
||||
src/encauth/eax/eax_init.obj src/encauth/eax/eax_test.obj src/encauth/gcm/gcm_add_aad.obj \
|
||||
src/encauth/gcm/gcm_add_iv.obj src/encauth/gcm/gcm_done.obj src/encauth/gcm/gcm_gf_mult.obj \
|
||||
src/encauth/gcm/gcm_init.obj src/encauth/gcm/gcm_memory.obj src/encauth/gcm/gcm_mult_h.obj \
|
||||
src/encauth/gcm/gcm_process.obj src/encauth/gcm/gcm_reset.obj src/encauth/gcm/gcm_test.obj \
|
||||
src/encauth/ocb/ocb_decrypt.obj src/encauth/ocb/ocb_decrypt_verify_memory.obj \
|
||||
src/encauth/ocb/ocb_done_decrypt.obj src/encauth/ocb/ocb_done_encrypt.obj \
|
||||
src/encauth/ocb/ocb_encrypt_authenticate_memory.obj src/encauth/ocb/ocb_encrypt.obj \
|
||||
src/encauth/ocb/ocb_init.obj src/encauth/ocb/ocb_ntz.obj src/encauth/ocb/ocb_shift_xor.obj \
|
||||
src/encauth/ocb/ocb_test.obj src/encauth/ocb/s_ocb_done.obj src/hashes/chc/chc.obj \
|
||||
src/hashes/helper/hash_file.obj src/hashes/helper/hash_filehandle.obj src/hashes/helper/hash_memory.obj \
|
||||
src/encauth/ocb/ocb_done_decrypt.obj src/encauth/ocb/ocb_done_encrypt.obj src/encauth/ocb/ocb_encrypt.obj \
|
||||
src/encauth/ocb/ocb_encrypt_authenticate_memory.obj src/encauth/ocb/ocb_init.obj src/encauth/ocb/ocb_ntz.obj \
|
||||
src/encauth/ocb/ocb_shift_xor.obj src/encauth/ocb/ocb_test.obj src/encauth/ocb/s_ocb_done.obj \
|
||||
src/encauth/ocb3/ocb3_add_aad.obj src/encauth/ocb3/ocb3_decrypt.obj src/encauth/ocb3/ocb3_decrypt_last.obj \
|
||||
src/encauth/ocb3/ocb3_decrypt_verify_memory.obj src/encauth/ocb3/ocb3_done.obj \
|
||||
src/encauth/ocb3/ocb3_encrypt.obj src/encauth/ocb3/ocb3_encrypt_authenticate_memory.obj \
|
||||
src/encauth/ocb3/ocb3_encrypt_last.obj src/encauth/ocb3/ocb3_init.obj src/encauth/ocb3/ocb3_int_ntz.obj \
|
||||
src/encauth/ocb3/ocb3_int_xor_blocks.obj src/encauth/ocb3/ocb3_test.obj src/hashes/blake2b.obj \
|
||||
src/hashes/blake2s.obj src/hashes/chc/chc.obj src/hashes/helper/hash_file.obj \
|
||||
src/hashes/helper/hash_filehandle.obj src/hashes/helper/hash_memory.obj \
|
||||
src/hashes/helper/hash_memory_multi.obj src/hashes/md2.obj src/hashes/md4.obj src/hashes/md5.obj \
|
||||
src/hashes/rmd128.obj src/hashes/rmd160.obj src/hashes/rmd256.obj src/hashes/rmd320.obj src/hashes/sha1.obj \
|
||||
src/hashes/sha2/sha256.obj src/hashes/sha2/sha512.obj src/hashes/tiger.obj src/hashes/whirl/whirl.obj \
|
||||
src/mac/f9/f9_done.obj src/mac/f9/f9_file.obj src/mac/f9/f9_init.obj src/mac/f9/f9_memory.obj \
|
||||
src/mac/f9/f9_memory_multi.obj src/mac/f9/f9_process.obj src/mac/f9/f9_test.obj src/mac/hmac/hmac_done.obj \
|
||||
src/mac/hmac/hmac_file.obj src/mac/hmac/hmac_init.obj src/mac/hmac/hmac_memory.obj \
|
||||
src/mac/hmac/hmac_memory_multi.obj src/mac/hmac/hmac_process.obj src/mac/hmac/hmac_test.obj \
|
||||
src/mac/omac/omac_done.obj src/mac/omac/omac_file.obj src/mac/omac/omac_init.obj src/mac/omac/omac_memory.obj \
|
||||
src/mac/omac/omac_memory_multi.obj src/mac/omac/omac_process.obj src/mac/omac/omac_test.obj \
|
||||
src/mac/pelican/pelican.obj src/mac/pelican/pelican_memory.obj src/mac/pelican/pelican_test.obj \
|
||||
src/mac/pmac/pmac_done.obj src/mac/pmac/pmac_file.obj src/mac/pmac/pmac_init.obj src/mac/pmac/pmac_memory.obj \
|
||||
src/hashes/sha2/sha224.obj src/hashes/sha2/sha256.obj src/hashes/sha2/sha384.obj src/hashes/sha2/sha512.obj \
|
||||
src/hashes/sha2/sha512_224.obj src/hashes/sha2/sha512_256.obj src/hashes/sha3.obj src/hashes/sha3_test.obj \
|
||||
src/hashes/tiger.obj src/hashes/whirl/whirl.obj src/mac/blake2/blake2bmac.obj \
|
||||
src/mac/blake2/blake2bmac_file.obj src/mac/blake2/blake2bmac_memory.obj \
|
||||
src/mac/blake2/blake2bmac_memory_multi.obj src/mac/blake2/blake2bmac_test.obj src/mac/blake2/blake2smac.obj \
|
||||
src/mac/blake2/blake2smac_file.obj src/mac/blake2/blake2smac_memory.obj \
|
||||
src/mac/blake2/blake2smac_memory_multi.obj src/mac/blake2/blake2smac_test.obj src/mac/f9/f9_done.obj \
|
||||
src/mac/f9/f9_file.obj src/mac/f9/f9_init.obj src/mac/f9/f9_memory.obj src/mac/f9/f9_memory_multi.obj \
|
||||
src/mac/f9/f9_process.obj src/mac/f9/f9_test.obj src/mac/hmac/hmac_done.obj src/mac/hmac/hmac_file.obj \
|
||||
src/mac/hmac/hmac_init.obj src/mac/hmac/hmac_memory.obj src/mac/hmac/hmac_memory_multi.obj \
|
||||
src/mac/hmac/hmac_process.obj src/mac/hmac/hmac_test.obj src/mac/omac/omac_done.obj src/mac/omac/omac_file.obj \
|
||||
src/mac/omac/omac_init.obj src/mac/omac/omac_memory.obj src/mac/omac/omac_memory_multi.obj \
|
||||
src/mac/omac/omac_process.obj src/mac/omac/omac_test.obj src/mac/pelican/pelican.obj \
|
||||
src/mac/pelican/pelican_memory.obj src/mac/pelican/pelican_test.obj src/mac/pmac/pmac_done.obj \
|
||||
src/mac/pmac/pmac_file.obj src/mac/pmac/pmac_init.obj src/mac/pmac/pmac_memory.obj \
|
||||
src/mac/pmac/pmac_memory_multi.obj src/mac/pmac/pmac_ntz.obj src/mac/pmac/pmac_process.obj \
|
||||
src/mac/pmac/pmac_shift_xor.obj src/mac/pmac/pmac_test.obj src/mac/xcbc/xcbc_done.obj \
|
||||
src/mac/pmac/pmac_shift_xor.obj src/mac/pmac/pmac_test.obj src/mac/poly1305/poly1305.obj \
|
||||
src/mac/poly1305/poly1305_file.obj src/mac/poly1305/poly1305_memory.obj \
|
||||
src/mac/poly1305/poly1305_memory_multi.obj src/mac/poly1305/poly1305_test.obj src/mac/xcbc/xcbc_done.obj \
|
||||
src/mac/xcbc/xcbc_file.obj src/mac/xcbc/xcbc_init.obj src/mac/xcbc/xcbc_memory.obj \
|
||||
src/mac/xcbc/xcbc_memory_multi.obj src/mac/xcbc/xcbc_process.obj src/mac/xcbc/xcbc_test.obj \
|
||||
src/math/fp/ltc_ecc_fp_mulmod.obj src/math/gmp_desc.obj src/math/ltm_desc.obj src/math/multi.obj \
|
||||
src/math/rand_prime.obj src/math/tfm_desc.obj src/misc/base64/base64_decode.obj \
|
||||
src/misc/base64/base64_encode.obj src/misc/burn_stack.obj src/misc/crypt/crypt_argchk.obj \
|
||||
src/misc/crypt/crypt.obj src/misc/crypt/crypt_cipher_descriptor.obj src/misc/crypt/crypt_cipher_is_valid.obj \
|
||||
src/misc/crypt/crypt_find_cipher_any.obj src/misc/crypt/crypt_find_cipher.obj \
|
||||
src/misc/crypt/crypt_find_cipher_id.obj src/misc/crypt/crypt_find_hash_any.obj \
|
||||
src/misc/crypt/crypt_find_hash.obj src/misc/crypt/crypt_find_hash_id.obj \
|
||||
src/misc/crypt/crypt_find_hash_oid.obj src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj \
|
||||
src/misc/crypt/crypt_hash_descriptor.obj src/misc/crypt/crypt_hash_is_valid.obj \
|
||||
src/math/radix_to_bin.obj src/math/rand_bn.obj src/math/rand_prime.obj src/math/tfm_desc.obj src/misc/adler32.obj \
|
||||
src/misc/base64/base64_decode.obj src/misc/base64/base64_encode.obj src/misc/burn_stack.obj \
|
||||
src/misc/compare_testvector.obj src/misc/crc32.obj src/misc/crypt/crypt.obj src/misc/crypt/crypt_argchk.obj \
|
||||
src/misc/crypt/crypt_cipher_descriptor.obj src/misc/crypt/crypt_cipher_is_valid.obj \
|
||||
src/misc/crypt/crypt_constants.obj src/misc/crypt/crypt_find_cipher.obj \
|
||||
src/misc/crypt/crypt_find_cipher_any.obj src/misc/crypt/crypt_find_cipher_id.obj \
|
||||
src/misc/crypt/crypt_find_hash.obj src/misc/crypt/crypt_find_hash_any.obj \
|
||||
src/misc/crypt/crypt_find_hash_id.obj src/misc/crypt/crypt_find_hash_oid.obj \
|
||||
src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj src/misc/crypt/crypt_hash_descriptor.obj \
|
||||
src/misc/crypt/crypt_hash_is_valid.obj src/misc/crypt/crypt_inits.obj \
|
||||
src/misc/crypt/crypt_ltc_mp_descriptor.obj src/misc/crypt/crypt_prng_descriptor.obj \
|
||||
src/misc/crypt/crypt_prng_is_valid.obj src/misc/crypt/crypt_register_cipher.obj \
|
||||
src/misc/crypt/crypt_register_hash.obj src/misc/crypt/crypt_register_prng.obj \
|
||||
src/misc/crypt/crypt_prng_is_valid.obj src/misc/crypt/crypt_prng_rng_descriptor.obj \
|
||||
src/misc/crypt/crypt_register_all_ciphers.obj src/misc/crypt/crypt_register_all_hashes.obj \
|
||||
src/misc/crypt/crypt_register_all_prngs.obj src/misc/crypt/crypt_register_cipher.obj \
|
||||
src/misc/crypt/crypt_register_hash.obj src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \
|
||||
src/misc/crypt/crypt_unregister_cipher.obj src/misc/crypt/crypt_unregister_hash.obj \
|
||||
src/misc/crypt/crypt_unregister_prng.obj src/misc/error_to_string.obj src/misc/pkcs5/pkcs_5_1.obj \
|
||||
src/misc/pkcs5/pkcs_5_2.obj src/misc/zeromem.obj src/modes/cbc/cbc_decrypt.obj src/modes/cbc/cbc_done.obj \
|
||||
src/modes/cbc/cbc_encrypt.obj src/modes/cbc/cbc_getiv.obj src/modes/cbc/cbc_setiv.obj \
|
||||
src/modes/cbc/cbc_start.obj src/modes/cfb/cfb_decrypt.obj src/modes/cfb/cfb_done.obj \
|
||||
src/modes/cfb/cfb_encrypt.obj src/modes/cfb/cfb_getiv.obj src/modes/cfb/cfb_setiv.obj \
|
||||
src/modes/cfb/cfb_start.obj src/modes/ctr/ctr_decrypt.obj src/modes/ctr/ctr_done.obj \
|
||||
src/modes/ctr/ctr_encrypt.obj src/modes/ctr/ctr_getiv.obj src/modes/ctr/ctr_setiv.obj \
|
||||
src/modes/ctr/ctr_start.obj src/modes/ctr/ctr_test.obj src/modes/ecb/ecb_decrypt.obj src/modes/ecb/ecb_done.obj \
|
||||
src/modes/ecb/ecb_encrypt.obj src/modes/ecb/ecb_start.obj src/modes/f8/f8_decrypt.obj src/modes/f8/f8_done.obj \
|
||||
src/modes/f8/f8_encrypt.obj src/modes/f8/f8_getiv.obj src/modes/f8/f8_setiv.obj src/modes/f8/f8_start.obj \
|
||||
src/modes/f8/f8_test_mode.obj src/modes/lrw/lrw_decrypt.obj src/modes/lrw/lrw_done.obj \
|
||||
src/modes/lrw/lrw_encrypt.obj src/modes/lrw/lrw_getiv.obj src/modes/lrw/lrw_process.obj \
|
||||
src/modes/lrw/lrw_setiv.obj src/modes/lrw/lrw_start.obj src/modes/lrw/lrw_test.obj \
|
||||
src/modes/ofb/ofb_decrypt.obj src/modes/ofb/ofb_done.obj src/modes/ofb/ofb_encrypt.obj \
|
||||
src/modes/ofb/ofb_getiv.obj src/modes/ofb/ofb_setiv.obj src/modes/ofb/ofb_start.obj \
|
||||
src/modes/xts/xts_decrypt.obj src/modes/xts/xts_done.obj src/modes/xts/xts_encrypt.obj \
|
||||
src/modes/xts/xts_init.obj src/modes/xts/xts_mult_x.obj src/modes/xts/xts_test.obj \
|
||||
src/pk/asn1/der/bit/der_decode_bit_string.obj src/pk/asn1/der/bit/der_encode_bit_string.obj \
|
||||
src/pk/asn1/der/bit/der_length_bit_string.obj src/pk/asn1/der/boolean/der_decode_boolean.obj \
|
||||
src/pk/asn1/der/boolean/der_encode_boolean.obj src/pk/asn1/der/boolean/der_length_boolean.obj \
|
||||
src/pk/asn1/der/choice/der_decode_choice.obj src/pk/asn1/der/ia5/der_decode_ia5_string.obj \
|
||||
src/pk/asn1/der/ia5/der_encode_ia5_string.obj src/pk/asn1/der/ia5/der_length_ia5_string.obj \
|
||||
src/pk/asn1/der/integer/der_decode_integer.obj src/pk/asn1/der/integer/der_encode_integer.obj \
|
||||
src/pk/asn1/der/integer/der_length_integer.obj \
|
||||
src/misc/crypt/crypt_unregister_prng.obj src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj \
|
||||
src/misc/hkdf/hkdf_test.obj src/misc/mem_neq.obj src/misc/pk_get_oid.obj src/misc/pkcs5/pkcs_5_1.obj \
|
||||
src/misc/pkcs5/pkcs_5_2.obj src/misc/pkcs5/pkcs_5_test.obj src/misc/zeromem.obj src/modes/cbc/cbc_decrypt.obj \
|
||||
src/modes/cbc/cbc_done.obj src/modes/cbc/cbc_encrypt.obj src/modes/cbc/cbc_getiv.obj \
|
||||
src/modes/cbc/cbc_setiv.obj src/modes/cbc/cbc_start.obj src/modes/cfb/cfb_decrypt.obj \
|
||||
src/modes/cfb/cfb_done.obj src/modes/cfb/cfb_encrypt.obj src/modes/cfb/cfb_getiv.obj \
|
||||
src/modes/cfb/cfb_setiv.obj src/modes/cfb/cfb_start.obj src/modes/ctr/ctr_decrypt.obj \
|
||||
src/modes/ctr/ctr_done.obj src/modes/ctr/ctr_encrypt.obj src/modes/ctr/ctr_getiv.obj \
|
||||
src/modes/ctr/ctr_setiv.obj src/modes/ctr/ctr_start.obj src/modes/ctr/ctr_test.obj \
|
||||
src/modes/ecb/ecb_decrypt.obj src/modes/ecb/ecb_done.obj src/modes/ecb/ecb_encrypt.obj \
|
||||
src/modes/ecb/ecb_start.obj src/modes/f8/f8_decrypt.obj src/modes/f8/f8_done.obj src/modes/f8/f8_encrypt.obj \
|
||||
src/modes/f8/f8_getiv.obj src/modes/f8/f8_setiv.obj src/modes/f8/f8_start.obj src/modes/f8/f8_test_mode.obj \
|
||||
src/modes/lrw/lrw_decrypt.obj src/modes/lrw/lrw_done.obj src/modes/lrw/lrw_encrypt.obj \
|
||||
src/modes/lrw/lrw_getiv.obj src/modes/lrw/lrw_process.obj src/modes/lrw/lrw_setiv.obj \
|
||||
src/modes/lrw/lrw_start.obj src/modes/lrw/lrw_test.obj src/modes/ofb/ofb_decrypt.obj src/modes/ofb/ofb_done.obj \
|
||||
src/modes/ofb/ofb_encrypt.obj src/modes/ofb/ofb_getiv.obj src/modes/ofb/ofb_setiv.obj \
|
||||
src/modes/ofb/ofb_start.obj src/modes/xts/xts_decrypt.obj src/modes/xts/xts_done.obj \
|
||||
src/modes/xts/xts_encrypt.obj src/modes/xts/xts_init.obj src/modes/xts/xts_mult_x.obj \
|
||||
src/modes/xts/xts_test.obj src/pk/asn1/der/bit/der_decode_bit_string.obj \
|
||||
src/pk/asn1/der/bit/der_decode_raw_bit_string.obj src/pk/asn1/der/bit/der_encode_bit_string.obj \
|
||||
src/pk/asn1/der/bit/der_encode_raw_bit_string.obj src/pk/asn1/der/bit/der_length_bit_string.obj \
|
||||
src/pk/asn1/der/boolean/der_decode_boolean.obj src/pk/asn1/der/boolean/der_encode_boolean.obj \
|
||||
src/pk/asn1/der/boolean/der_length_boolean.obj src/pk/asn1/der/choice/der_decode_choice.obj \
|
||||
src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.obj \
|
||||
src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.obj \
|
||||
src/pk/asn1/der/generalizedtime/der_length_generalizedtime.obj \
|
||||
src/pk/asn1/der/ia5/der_decode_ia5_string.obj src/pk/asn1/der/ia5/der_encode_ia5_string.obj \
|
||||
src/pk/asn1/der/ia5/der_length_ia5_string.obj src/pk/asn1/der/integer/der_decode_integer.obj \
|
||||
src/pk/asn1/der/integer/der_encode_integer.obj src/pk/asn1/der/integer/der_length_integer.obj \
|
||||
src/pk/asn1/der/object_identifier/der_decode_object_identifier.obj \
|
||||
src/pk/asn1/der/object_identifier/der_encode_object_identifier.obj \
|
||||
src/pk/asn1/der/object_identifier/der_length_object_identifier.obj \
|
||||
@@ -85,22 +138,32 @@ src/pk/asn1/der/printable_string/der_length_printable_string.obj \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_ex.obj \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_flexi.obj \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_multi.obj \
|
||||
src/pk/asn1/der/sequence/der_decode_subject_public_key_info.obj \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_ex.obj \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_multi.obj src/pk/asn1/der/sequence/der_length_sequence.obj \
|
||||
src/pk/asn1/der/sequence/der_sequence_free.obj src/pk/asn1/der/set/der_encode_set.obj \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_multi.obj \
|
||||
src/pk/asn1/der/sequence/der_encode_subject_public_key_info.obj \
|
||||
src/pk/asn1/der/sequence/der_length_sequence.obj src/pk/asn1/der/sequence/der_sequence_free.obj \
|
||||
src/pk/asn1/der/sequence/der_sequence_shrink.obj src/pk/asn1/der/set/der_encode_set.obj \
|
||||
src/pk/asn1/der/set/der_encode_setof.obj src/pk/asn1/der/short_integer/der_decode_short_integer.obj \
|
||||
src/pk/asn1/der/short_integer/der_encode_short_integer.obj \
|
||||
src/pk/asn1/der/short_integer/der_length_short_integer.obj src/pk/asn1/der/utctime/der_decode_utctime.obj \
|
||||
src/pk/asn1/der/utctime/der_encode_utctime.obj src/pk/asn1/der/utctime/der_length_utctime.obj \
|
||||
src/pk/asn1/der/utf8/der_decode_utf8_string.obj src/pk/asn1/der/utf8/der_encode_utf8_string.obj \
|
||||
src/pk/asn1/der/utf8/der_length_utf8_string.obj src/pk/dsa/dsa_decrypt_key.obj \
|
||||
src/pk/dsa/dsa_encrypt_key.obj src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj src/pk/dsa/dsa_import.obj \
|
||||
src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_shared_secret.obj src/pk/dsa/dsa_sign_hash.obj \
|
||||
src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc_ansi_x963_export.obj \
|
||||
src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc.obj src/pk/ecc/ecc_decrypt_key.obj \
|
||||
src/pk/ecc/ecc_encrypt_key.obj src/pk/ecc/ecc_export.obj src/pk/ecc/ecc_free.obj src/pk/ecc/ecc_get_size.obj \
|
||||
src/pk/ecc/ecc_import.obj src/pk/ecc/ecc_make_key.obj src/pk/ecc/ecc_shared_secret.obj \
|
||||
src/pk/ecc/ecc_sign_hash.obj src/pk/ecc/ecc_sizes.obj src/pk/ecc/ecc_test.obj src/pk/ecc/ecc_verify_hash.obj \
|
||||
src/pk/asn1/der/short_integer/der_length_short_integer.obj \
|
||||
src/pk/asn1/der/teletex_string/der_decode_teletex_string.obj \
|
||||
src/pk/asn1/der/teletex_string/der_length_teletex_string.obj \
|
||||
src/pk/asn1/der/utctime/der_decode_utctime.obj src/pk/asn1/der/utctime/der_encode_utctime.obj \
|
||||
src/pk/asn1/der/utctime/der_length_utctime.obj src/pk/asn1/der/utf8/der_decode_utf8_string.obj \
|
||||
src/pk/asn1/der/utf8/der_encode_utf8_string.obj src/pk/asn1/der/utf8/der_length_utf8_string.obj \
|
||||
src/pk/dh/dh.obj src/pk/dh/dh_check_pubkey.obj src/pk/dh/dh_export.obj src/pk/dh/dh_export_key.obj \
|
||||
src/pk/dh/dh_free.obj src/pk/dh/dh_generate_key.obj src/pk/dh/dh_import.obj src/pk/dh/dh_set.obj \
|
||||
src/pk/dh/dh_set_pg_dhparam.obj src/pk/dh/dh_shared_secret.obj src/pk/dsa/dsa_decrypt_key.obj \
|
||||
src/pk/dsa/dsa_encrypt_key.obj src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj \
|
||||
src/pk/dsa/dsa_generate_key.obj src/pk/dsa/dsa_generate_pqg.obj src/pk/dsa/dsa_import.obj \
|
||||
src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_set.obj src/pk/dsa/dsa_set_pqg_dsaparam.obj \
|
||||
src/pk/dsa/dsa_shared_secret.obj src/pk/dsa/dsa_sign_hash.obj src/pk/dsa/dsa_verify_hash.obj \
|
||||
src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc.obj src/pk/ecc/ecc_ansi_x963_export.obj \
|
||||
src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc_decrypt_key.obj src/pk/ecc/ecc_encrypt_key.obj \
|
||||
src/pk/ecc/ecc_export.obj src/pk/ecc/ecc_free.obj src/pk/ecc/ecc_get_size.obj src/pk/ecc/ecc_import.obj \
|
||||
src/pk/ecc/ecc_make_key.obj src/pk/ecc/ecc_shared_secret.obj src/pk/ecc/ecc_sign_hash.obj \
|
||||
src/pk/ecc/ecc_sizes.obj src/pk/ecc/ecc_test.obj src/pk/ecc/ecc_verify_hash.obj \
|
||||
src/pk/ecc/ltc_ecc_is_valid_idx.obj src/pk/ecc/ltc_ecc_map.obj src/pk/ecc/ltc_ecc_mul2add.obj \
|
||||
src/pk/ecc/ltc_ecc_mulmod.obj src/pk/ecc/ltc_ecc_mulmod_timing.obj src/pk/ecc/ltc_ecc_points.obj \
|
||||
src/pk/ecc/ltc_ecc_projective_add_point.obj src/pk/ecc/ltc_ecc_projective_dbl_point.obj \
|
||||
@@ -110,43 +173,101 @@ src/pk/katja/katja_make_key.obj src/pk/pkcs1/pkcs_1_i2osp.obj src/pk/pkcs1/pkcs_
|
||||
src/pk/pkcs1/pkcs_1_oaep_decode.obj src/pk/pkcs1/pkcs_1_oaep_encode.obj src/pk/pkcs1/pkcs_1_os2ip.obj \
|
||||
src/pk/pkcs1/pkcs_1_pss_decode.obj src/pk/pkcs1/pkcs_1_pss_encode.obj src/pk/pkcs1/pkcs_1_v1_5_decode.obj \
|
||||
src/pk/pkcs1/pkcs_1_v1_5_encode.obj src/pk/rsa/rsa_decrypt_key.obj src/pk/rsa/rsa_encrypt_key.obj \
|
||||
src/pk/rsa/rsa_export.obj src/pk/rsa/rsa_exptmod.obj src/pk/rsa/rsa_free.obj src/pk/rsa/rsa_import.obj \
|
||||
src/pk/rsa/rsa_make_key.obj src/pk/rsa/rsa_sign_hash.obj src/pk/rsa/rsa_verify_hash.obj src/prngs/fortuna.obj \
|
||||
src/pk/rsa/rsa_export.obj src/pk/rsa/rsa_exptmod.obj src/pk/rsa/rsa_free.obj src/pk/rsa/rsa_get_size.obj \
|
||||
src/pk/rsa/rsa_import.obj src/pk/rsa/rsa_import_pkcs8.obj src/pk/rsa/rsa_import_x509.obj \
|
||||
src/pk/rsa/rsa_make_key.obj src/pk/rsa/rsa_set.obj src/pk/rsa/rsa_sign_hash.obj \
|
||||
src/pk/rsa/rsa_sign_saltlen_get.obj src/pk/rsa/rsa_verify_hash.obj src/prngs/chacha20.obj src/prngs/fortuna.obj \
|
||||
src/prngs/rc4.obj src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj src/prngs/sober128.obj \
|
||||
src/prngs/sprng.obj src/prngs/yarrow.obj
|
||||
src/prngs/sprng.obj src/prngs/yarrow.obj src/stream/chacha/chacha_crypt.obj src/stream/chacha/chacha_done.obj \
|
||||
src/stream/chacha/chacha_ivctr32.obj src/stream/chacha/chacha_ivctr64.obj \
|
||||
src/stream/chacha/chacha_keystream.obj src/stream/chacha/chacha_setup.obj src/stream/chacha/chacha_test.obj \
|
||||
src/stream/rc4/rc4_stream.obj src/stream/rc4/rc4_test.obj src/stream/sober128/sober128_stream.obj \
|
||||
src/stream/sober128/sober128_test.obj
|
||||
|
||||
HEADERS=src/headers/tomcrypt_cfg.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \
|
||||
src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cipher.h \
|
||||
src/headers/tomcrypt_pk.h src/headers/tomcrypt_hash.h src/headers/tomcrypt_math.h \
|
||||
src/headers/tomcrypt_misc.h src/headers/tomcrypt.h src/headers/tomcrypt_pkcs.h \
|
||||
src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h
|
||||
#List of test objects to compile
|
||||
TOBJECTS=tests/base64_test.obj tests/cipher_hash_test.obj tests/common.obj tests/der_test.obj tests/dh_test.obj \
|
||||
tests/dsa_test.obj tests/ecc_test.obj tests/file_test.obj tests/katja_test.obj tests/mac_test.obj tests/misc_test.obj \
|
||||
tests/modes_test.obj tests/mpi_test.obj tests/multi_test.obj tests/no_prng.obj tests/pkcs_1_eme_test.obj \
|
||||
tests/pkcs_1_emsa_test.obj tests/pkcs_1_oaep_test.obj tests/pkcs_1_pss_test.obj tests/pkcs_1_test.obj \
|
||||
tests/prng_test.obj tests/rotate_test.obj tests/rsa_test.obj tests/store_test.obj tests/test.obj
|
||||
|
||||
#END_INS
|
||||
#The following headers will be installed by "make install"
|
||||
HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \
|
||||
src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \
|
||||
src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \
|
||||
src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \
|
||||
src/headers/tomcrypt_prng.h
|
||||
|
||||
default: library
|
||||
#The default rule for make builds the tomcrypt.lib library (static)
|
||||
default: $(LIBMAIN_S)
|
||||
|
||||
#ciphers come in two flavours... enc+dec and enc
|
||||
#SPECIAL: AES comes in two flavours - enc+dec and enc-only
|
||||
src/ciphers/aes/aes_enc.obj: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
$(CC) $(CFLAGS) /DENCRYPT_ONLY /c src/ciphers/aes/aes.c /Fosrc/ciphers/aes/aes_enc.obj
|
||||
$(CC) $(LTC_CFLAGS) /DENCRYPT_ONLY /c src/ciphers/aes/aes.c /Fosrc/ciphers/aes/aes_enc.obj
|
||||
|
||||
library: $(OBJECTS)
|
||||
lib /out:tomcrypt.lib $(OBJECTS)
|
||||
cd testprof
|
||||
nmake -f makefile.msvc
|
||||
cd ..
|
||||
|
||||
tv_gen: demos/tv_gen.c library
|
||||
cl $(CFLAGS) demos/tv_gen.c tomcrypt.lib advapi32.lib $(EXTRALIBS)
|
||||
#SPECIAL: these are the rules to make certain object files
|
||||
src/ciphers/aes/aes.obj: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
src/ciphers/twofish/twofish.obj: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c
|
||||
src/hashes/whirl/whirl.obj: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c
|
||||
src/hashes/sha2/sha512.obj: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c
|
||||
src/hashes/sha2/sha512_224.obj: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c
|
||||
src/hashes/sha2/sha512_256.obj: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c
|
||||
src/hashes/sha2/sha256.obj: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
|
||||
|
||||
hashsum: demos/hashsum.c library
|
||||
cl $(CFLAGS) demos/hashsum.c tomcrypt.lib advapi32.lib $(EXTRALIBS)
|
||||
#Dependencies on *.h
|
||||
$(OBJECTS): $(HEADERS)
|
||||
$(TOBJECTS): $(HEADERS) tests/tomcrypt_test.h
|
||||
|
||||
test: demos/test.c library
|
||||
cl $(CFLAGS) demos/test.c testprof/tomcrypt_prof.lib tomcrypt.lib advapi32.lib $(EXTRALIBS)
|
||||
.c.obj:
|
||||
$(CC) $(LTC_CFLAGS) /c $< /Fo$@
|
||||
|
||||
timing: demos/timing.c library
|
||||
cl $(CFLAGS) demos/timing.c testprof/tomcrypt_prof.lib tomcrypt.lib advapi32.lib $(EXTRALIBS)
|
||||
#Create tomcrypt.lib
|
||||
$(LIBMAIN_S): $(OBJECTS)
|
||||
lib /out:$(LIBMAIN_S) $(OBJECTS)
|
||||
|
||||
# $Source: /cvs/libtom/libtomcrypt/makefile.msvc,v $
|
||||
# $Revision: 1.54 $
|
||||
# $Date: 2007/02/16 16:36:25 $
|
||||
#Demo tools/utilities
|
||||
hashsum.exe: demos/hashsum.c tests/common.c $(LIBMAIN_S)
|
||||
cl $(LTC_CFLAGS) demos/hashsum.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@
|
||||
ltcrypt.exe: demos/ltcrypt.c $(LIBMAIN_S)
|
||||
cl $(LTC_CFLAGS) demos/ltcrypt.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@
|
||||
small.exe: demos/small.c $(LIBMAIN_S)
|
||||
cl $(LTC_CFLAGS) demos/small.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@
|
||||
tv_gen.exe: demos/tv_gen.c $(LIBMAIN_S)
|
||||
cl $(LTC_CFLAGS) demos/tv_gen.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@
|
||||
sizes.exe: demos/sizes.c $(LIBMAIN_S)
|
||||
cl $(LTC_CFLAGS) demos/sizes.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@
|
||||
constants.exe: demos/constants.c $(LIBMAIN_S)
|
||||
cl $(LTC_CFLAGS) demos/constants.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@
|
||||
timing.exe: demos/timing.c $(LIBMAIN_S)
|
||||
cl $(LTC_CFLAGS) demos/timing.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@
|
||||
|
||||
#Tests
|
||||
test.exe: $(LIBMAIN_S) $(TOBJECTS)
|
||||
cl $(LTC_CFLAGS) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@
|
||||
@echo NOTICE: start the tests by launching test.exe
|
||||
|
||||
all: $(LIBMAIN_S) hashsum.exe ltcrypt.exe small.exe tv_gen.exe sizes.exe constants.exe timing.exe test.exe
|
||||
|
||||
test: test.exe
|
||||
|
||||
clean:
|
||||
@-cmd /c del /Q *_tv.txt 2>nul
|
||||
@-cmd /c del /Q /S *.OBJ *.LIB *.EXE *.DLL 2>nul
|
||||
|
||||
#Install the library + headers
|
||||
install: $(LIBMAIN_S)
|
||||
cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin"
|
||||
cmd /c if not exist "$(PREFIX)\lib" mkdir "$(PREFIX)\lib"
|
||||
cmd /c if not exist "$(PREFIX)\include" mkdir "$(PREFIX)\include"
|
||||
copy /Y $(LIBMAIN_S) "$(PREFIX)\lib"
|
||||
copy /Y src\headers\tomcrypt*.h "$(PREFIX)\include"
|
||||
|
||||
#Install useful tools
|
||||
install_bins: hashsum
|
||||
cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin"
|
||||
copy /Y hashsum.exe "$(PREFIX)\bin"
|
||||
|
||||
#Install documentation
|
||||
install_docs: doc/crypt.pdf
|
||||
cmd /c if not exist "$(PREFIX)\doc" mkdir "$(PREFIX)\doc"
|
||||
copy /Y doc\crypt.pdf "$(PREFIX)\doc"
|
||||
|
||||
@@ -2,281 +2,76 @@
|
||||
#
|
||||
# This makefile produces a shared object and requires libtool to be installed.
|
||||
#
|
||||
# Thanks to Zed Shaw for helping debug this on BSD/OSX.
|
||||
# Thanks to Zed Shaw for helping debug this on BSD/OSX.
|
||||
# Tom St Denis
|
||||
#
|
||||
# (GNU make only)
|
||||
|
||||
# The version
|
||||
VERSION=0:117
|
||||
### USAGE:
|
||||
#
|
||||
# CFLAGS="-DUSE_LTM -DLTM_DESC -I/path/to/libtommath" make -f makefile.shared all EXTRALIBS=/path/to/libtommath/libtommath.a
|
||||
# ./test
|
||||
# make -f makefile.shared PREFIX=/opt/libtom install
|
||||
#
|
||||
|
||||
# Compiler and Linker Names
|
||||
CC=libtool --mode=compile --tag=CC gcc
|
||||
PLATFORM := $(shell uname | sed -e 's/_.*//')
|
||||
|
||||
# ranlib tools
|
||||
ifndef RANLIB
|
||||
RANLIB=ranlib
|
||||
ifndef LT
|
||||
ifeq ($(PLATFORM), Darwin)
|
||||
LT:=glibtool
|
||||
else
|
||||
LT:=libtool
|
||||
endif
|
||||
endif
|
||||
|
||||
# Compilation flags. Note the += does not write over the user's CFLAGS!
|
||||
CFLAGS += -c -I./src/headers/ -Wall -Wsign-compare -W -Wshadow -DLTC_SOURCE
|
||||
|
||||
# additional warnings (newer GCC 3.4 and higher)
|
||||
ifdef GCC_34
|
||||
CFLAGS += -Wsystem-headers -Wdeclaration-after-statement -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wmissing-prototypes \
|
||||
-Wmissing-declarations -Wpointer-arith
|
||||
ifeq ($(PLATFORM), CYGWIN)
|
||||
NO_UNDEFINED:=-no-undefined
|
||||
endif
|
||||
|
||||
|
||||
ifndef IGNORE_SPEED
|
||||
|
||||
# optimize for SPEED
|
||||
CFLAGS += -O3 -funroll-loops
|
||||
|
||||
# add -fomit-frame-pointer. hinders debugging!
|
||||
CFLAGS += -fomit-frame-pointer
|
||||
|
||||
# optimize for SIZE
|
||||
#CFLAGS += -Os -DLTC_SMALL_CODE
|
||||
|
||||
endif
|
||||
|
||||
# compile for DEBUGING (required for ccmalloc checking!!!)
|
||||
#CFLAGS += -g3
|
||||
|
||||
# older GCCs can't handle the "rotate with immediate" ROLc/RORc/etc macros
|
||||
# define this to help
|
||||
#CFLAGS += -DLTC_NO_ROLC
|
||||
LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC)
|
||||
INSTALL_CMD = $(LT) --mode=install install
|
||||
UNINSTALL_CMD = $(LT) --mode=uninstall rm
|
||||
|
||||
#Output filenames for various targets.
|
||||
ifndef LIBTEST_S
|
||||
LIBTEST_S=libtomcrypt_prof.a
|
||||
endif
|
||||
ifndef LIBTEST
|
||||
LIBTEST=libtomcrypt_prof.la
|
||||
endif
|
||||
ifndef LIBNAME
|
||||
LIBNAME=libtomcrypt.la
|
||||
endif
|
||||
ifndef LIBNAME_S
|
||||
LIBNAME_S=libtomcrypt.a
|
||||
endif
|
||||
|
||||
HASH=hashsum
|
||||
CRYPT=encrypt
|
||||
SMALL=small
|
||||
PROF=x86_prof
|
||||
TV=tv_gen
|
||||
TEST=test
|
||||
TIMING=timing
|
||||
|
||||
#LIBPATH-The directory for libtomcrypt to be installed to.
|
||||
#INCPATH-The directory to install the header files for libtomcrypt.
|
||||
#DATAPATH-The directory to install the pdf docs.
|
||||
ifndef DESTDIR
|
||||
DESTDIR=
|
||||
endif
|
||||
ifndef LIBPATH
|
||||
LIBPATH=/usr/lib
|
||||
endif
|
||||
ifndef INCPATH
|
||||
INCPATH=/usr/include
|
||||
endif
|
||||
ifndef DATAPATH
|
||||
DATAPATH=/usr/share/doc/libtomcrypt/pdf
|
||||
endif
|
||||
include makefile_include.mk
|
||||
|
||||
#Who do we install as?
|
||||
ifdef INSTALL_USER
|
||||
USER=$(INSTALL_USER)
|
||||
else
|
||||
USER=root
|
||||
endif
|
||||
|
||||
ifdef INSTALL_GROUP
|
||||
GROUP=$(INSTALL_GROUP)
|
||||
else
|
||||
GROUP=wheel
|
||||
endif
|
||||
|
||||
#List of objects to compile.
|
||||
#START_INS
|
||||
OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \
|
||||
src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o src/ciphers/kseed.o \
|
||||
src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o src/ciphers/rc6.o \
|
||||
src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/safer/safer_tab.o \
|
||||
src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \
|
||||
src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \
|
||||
src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \
|
||||
src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \
|
||||
src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \
|
||||
src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \
|
||||
src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \
|
||||
src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \
|
||||
src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \
|
||||
src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o \
|
||||
src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_encrypt.o \
|
||||
src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o src/encauth/ocb/ocb_shift_xor.o \
|
||||
src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \
|
||||
src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \
|
||||
src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \
|
||||
src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \
|
||||
src/hashes/sha2/sha256.o src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o \
|
||||
src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o \
|
||||
src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o \
|
||||
src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \
|
||||
src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \
|
||||
src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \
|
||||
src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \
|
||||
src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \
|
||||
src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \
|
||||
src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \
|
||||
src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \
|
||||
src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \
|
||||
src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \
|
||||
src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \
|
||||
src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \
|
||||
src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \
|
||||
src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \
|
||||
src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \
|
||||
src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \
|
||||
src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \
|
||||
src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \
|
||||
src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \
|
||||
src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \
|
||||
src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \
|
||||
src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o \
|
||||
src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \
|
||||
src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/pkcs5/pkcs_5_1.o \
|
||||
src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o \
|
||||
src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o \
|
||||
src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o \
|
||||
src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o \
|
||||
src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o \
|
||||
src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o \
|
||||
src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o \
|
||||
src/modes/ecb/ecb_encrypt.o src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o \
|
||||
src/modes/f8/f8_encrypt.o src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o \
|
||||
src/modes/f8/f8_test_mode.o src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o \
|
||||
src/modes/lrw/lrw_encrypt.o src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o \
|
||||
src/modes/lrw/lrw_setiv.o src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o \
|
||||
src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o src/modes/ofb/ofb_encrypt.o \
|
||||
src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o src/modes/ofb/ofb_start.o \
|
||||
src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o src/modes/xts/xts_encrypt.o \
|
||||
src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o src/modes/xts/xts_test.o \
|
||||
src/pk/asn1/der/bit/der_decode_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \
|
||||
src/pk/asn1/der/bit/der_length_bit_string.o src/pk/asn1/der/boolean/der_decode_boolean.o \
|
||||
src/pk/asn1/der/boolean/der_encode_boolean.o src/pk/asn1/der/boolean/der_length_boolean.o \
|
||||
src/pk/asn1/der/choice/der_decode_choice.o src/pk/asn1/der/ia5/der_decode_ia5_string.o \
|
||||
src/pk/asn1/der/ia5/der_encode_ia5_string.o src/pk/asn1/der/ia5/der_length_ia5_string.o \
|
||||
src/pk/asn1/der/integer/der_decode_integer.o src/pk/asn1/der/integer/der_encode_integer.o \
|
||||
src/pk/asn1/der/integer/der_length_integer.o \
|
||||
src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \
|
||||
src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \
|
||||
src/pk/asn1/der/object_identifier/der_length_object_identifier.o \
|
||||
src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \
|
||||
src/pk/asn1/der/octet/der_length_octet_string.o \
|
||||
src/pk/asn1/der/printable_string/der_decode_printable_string.o \
|
||||
src/pk/asn1/der/printable_string/der_encode_printable_string.o \
|
||||
src/pk/asn1/der/printable_string/der_length_printable_string.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_ex.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_multi.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_ex.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_multi.o src/pk/asn1/der/sequence/der_length_sequence.o \
|
||||
src/pk/asn1/der/sequence/der_sequence_free.o src/pk/asn1/der/set/der_encode_set.o \
|
||||
src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \
|
||||
src/pk/asn1/der/short_integer/der_encode_short_integer.o \
|
||||
src/pk/asn1/der/short_integer/der_length_short_integer.o src/pk/asn1/der/utctime/der_decode_utctime.o \
|
||||
src/pk/asn1/der/utctime/der_encode_utctime.o src/pk/asn1/der/utctime/der_length_utctime.o \
|
||||
src/pk/asn1/der/utf8/der_decode_utf8_string.o src/pk/asn1/der/utf8/der_encode_utf8_string.o \
|
||||
src/pk/asn1/der/utf8/der_length_utf8_string.o src/pk/dsa/dsa_decrypt_key.o \
|
||||
src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \
|
||||
src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \
|
||||
src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc_ansi_x963_export.o \
|
||||
src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o src/pk/ecc/ecc_decrypt_key.o \
|
||||
src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \
|
||||
src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \
|
||||
src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \
|
||||
src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \
|
||||
src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \
|
||||
src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \
|
||||
src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \
|
||||
src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \
|
||||
src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \
|
||||
src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \
|
||||
src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \
|
||||
src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \
|
||||
src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_import.o \
|
||||
src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o \
|
||||
src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \
|
||||
src/prngs/sprng.o src/prngs/yarrow.o
|
||||
|
||||
HEADERS=src/headers/tomcrypt_cfg.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \
|
||||
src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cipher.h \
|
||||
src/headers/tomcrypt_pk.h src/headers/tomcrypt_hash.h src/headers/tomcrypt_math.h \
|
||||
src/headers/tomcrypt_misc.h src/headers/tomcrypt.h src/headers/tomcrypt_pkcs.h \
|
||||
src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h
|
||||
|
||||
#END_INS
|
||||
|
||||
TESTOBJECTS=demos/test.o
|
||||
HASHOBJECTS=demos/hashsum.o
|
||||
CRYPTOBJECTS=demos/encrypt.o
|
||||
SMALLOBJECTS=demos/small.o
|
||||
TVS=demos/tv_gen.o
|
||||
TESTS=demos/test.o
|
||||
TIMINGS=demos/timing.o
|
||||
|
||||
#The default rule for make builds the libtomcrypt library.
|
||||
default:library
|
||||
|
||||
#ciphers come in two flavours... enc+dec and enc
|
||||
#ciphers come in two flavours... enc+dec and enc
|
||||
src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
$(CC) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o
|
||||
$(LTCOMPILE) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o
|
||||
|
||||
#These are the rules to make certain object files.
|
||||
src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c
|
||||
src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c
|
||||
src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c
|
||||
src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
|
||||
.c.o:
|
||||
$(LTCOMPILE) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) -o $@ -c $<
|
||||
|
||||
#This rule makes the libtomcrypt library.
|
||||
library: $(LIBNAME)
|
||||
LOBJECTS = $(OBJECTS:.o=.lo)
|
||||
|
||||
testprof/$(LIBTEST):
|
||||
cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) make -f makefile.shared
|
||||
$(LIBNAME): $(OBJECTS)
|
||||
$(LT) --mode=link --tag=CC $(CC) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) $(LOBJECTS) $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) $(NO_UNDEFINED)
|
||||
|
||||
objs: $(OBJECTS)
|
||||
test: $(call print-help,test,Builds the library and the 'test' application to run all self-tests) $(LIBNAME) $(TOBJECTS)
|
||||
$(LT) --mode=link --tag=CC $(CC) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS)
|
||||
|
||||
$(LIBNAME): $(OBJECTS) testprof/$(LIBTEST)
|
||||
libtool --silent --mode=link gcc $(CFLAGS) `find . -type f | grep "[.]lo" | grep "src/" | xargs` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION)
|
||||
# build the demos from a template
|
||||
define DEMO_template
|
||||
$(1): $(call print-help,$(1),Builds the library and the '$(1)' demo) demos/$(1).o $$(LIBNAME)
|
||||
$$(LT) --mode=link --tag=CC $$(CC) $$(LTC_CFLAGS) $$(CPPFLAGS) $$(LTC_LDFLAGS) $$^ $$(EXTRALIBS) -o $(1)
|
||||
endef
|
||||
|
||||
install: $(LIBNAME)
|
||||
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
|
||||
cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) make -f makefile.shared install
|
||||
libtool --silent --mode=install install -c libtomcrypt.la $(DESTDIR)$(LIBPATH)/libtomcrypt.la
|
||||
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
|
||||
install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH)
|
||||
$(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo))))
|
||||
|
||||
#This rule makes the hash program included with libtomcrypt
|
||||
hashsum: library
|
||||
gcc $(CFLAGS) demos/hashsum.c -o hashsum.o
|
||||
gcc -o hashsum hashsum.o -ltomcrypt $(EXTRALIBS)
|
||||
install: $(call print-help,install,Installs the library + headers + pkg-config file) .common_install
|
||||
sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' libtomcrypt.pc.in > libtomcrypt.pc
|
||||
install -p -d $(DESTDIR)$(LIBPATH)/pkgconfig
|
||||
install -p -m 644 libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/
|
||||
|
||||
#makes the crypt program
|
||||
crypt: library
|
||||
gcc $(CFLAGS) demos/encrypt.c -o encrypt.o
|
||||
gcc -o crypt encrypt.o -ltomcrypt $(EXTRALIBS)
|
||||
install_bins: $(call print-help,install_bins,Installs the useful demos ($(USEFUL_DEMOS))) .common_install_bins
|
||||
|
||||
tv_gen: library $(TVS)
|
||||
gcc -o tv_gen $(TVS) -ltomcrypt $(EXTRALIBS)
|
||||
uninstall: $(call print-help,uninstall,Uninstalls the library + headers + pkg-config file) .common_uninstall
|
||||
rm $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc
|
||||
|
||||
test: library testprof/$(LIBTEST) $(TESTS)
|
||||
gcc -o $(TEST) $(TESTS) -ltomcrypt_prof -ltomcrypt $(EXTRALIBS)
|
||||
|
||||
timing: library testprof/$(LIBTEST) $(TIMINGS)
|
||||
gcc -o $(TIMING) $(TIMINGS) -ltomcrypt_prof -ltomcrypt $(EXTRALIBS)
|
||||
|
||||
# $Source: /cvs/libtom/libtomcrypt/makefile.shared,v $
|
||||
# $Revision: 1.80 $
|
||||
# $Date: 2007/02/16 16:36:25 $
|
||||
# ref: $Format:%D$
|
||||
# git commit: $Format:%H$
|
||||
# commit time: $Format:%ai$
|
||||
|
||||
@@ -1,115 +1,149 @@
|
||||
# MAKEFILE for bsd make
|
||||
# MAKEFILE that is intended to be compatible with any kind of make (GNU make, BSD make, ...)
|
||||
# works on: Linux, *BSD, Cygwin, AIX, HP-UX and hopefully other UNIX systems
|
||||
#
|
||||
# Tom St Denis
|
||||
# Please do not use here neither any special make syntax nor any unusual tools/utilities!
|
||||
#
|
||||
# BEWARE: variables OBJECTS, TOBJECTS, HEADERS, VERSION are updated via ./updatemakes.sh
|
||||
|
||||
# Compiler and Linker Names
|
||||
CC=cc
|
||||
LD=ld
|
||||
### USAGE:
|
||||
#
|
||||
# make -f makefile.unix all
|
||||
# ./test
|
||||
# make -f makefile.unix install
|
||||
#
|
||||
#Or:
|
||||
#
|
||||
# make -f makefile.unix CFLAGS="-O3 -DUSE_LTM -DLTM_DESC -I/path/to/libtommath" EXTRALIBS=/path/to/libtommath/libtommath.a all
|
||||
# ./test
|
||||
# make -f makefile.unix PREFIX=/opt/libtom install
|
||||
#
|
||||
#Or if you are using Intel C compiler you might need something like:
|
||||
#
|
||||
# make -f makefile.unix CC=icc AR=xiar CFLAGS="-fast -DUSE_LTM -DLTM_DESC -I/path/to/libtommath" EXTRALIBS=/path/to/libtommath/libtommath.a all
|
||||
#
|
||||
|
||||
# Archiver [makes .a files]
|
||||
AR=ar
|
||||
ARFLAGS=r
|
||||
#The following can be overridden from command line e.g. "make -f makefile.unix CC=gcc ARFLAGS=rcs"
|
||||
DESTDIR =
|
||||
PREFIX = /usr/local
|
||||
LIBPATH = $(PREFIX)/lib
|
||||
INCPATH = $(PREFIX)/include
|
||||
DATAPATH = $(PREFIX)/share/doc/libtomcrypt/pdf
|
||||
BINPATH = $(PREFIX)/bin
|
||||
CC = cc
|
||||
AR = ar
|
||||
ARFLAGS = r
|
||||
RANLIB = ranlib
|
||||
CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath
|
||||
EXTRALIBS = ../libtommath/libtommath.a
|
||||
|
||||
# Compilation flags. Note the += does not write over the user's CFLAGS!
|
||||
CFLAGS = -c -I./testprof/ -I./src/headers/ -DLTC_SOURCE -O2 ${CFLAGS_OPTS} -o $@
|
||||
#Compilation flags
|
||||
LTC_CFLAGS = -Isrc/headers -Itests -DLTC_SOURCE $(CFLAGS)
|
||||
LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS)
|
||||
VERSION=1.18.1
|
||||
|
||||
LIBNAME=libtomcrypt.a
|
||||
LIBTEST=libtomcrypt_prof.a
|
||||
LIBTEST_S=$(LIBTEST)
|
||||
#Libraries to be created (this makefile builds only static libraries)
|
||||
LIBMAIN_S =libtomcrypt.a
|
||||
|
||||
HASH=hashsum
|
||||
CRYPT=encrypt
|
||||
SMALL=small
|
||||
PROF=x86_prof
|
||||
TV=tv_gen
|
||||
MULTI=multi
|
||||
TIMING=timing
|
||||
TEST=test
|
||||
|
||||
#LIBPATH-The directory for libtomcrypt to be installed to.
|
||||
#INCPATH-The directory to install the header files for libtomcrypt.
|
||||
#DATAPATH-The directory to install the pdf docs.
|
||||
LIBPATH=/usr/local/lib
|
||||
INCPATH=/usr/local/include
|
||||
DATAPATH=/usr/local/share/doc/libtomcrypt/pdf
|
||||
|
||||
#Who do we install as?
|
||||
USER=root
|
||||
|
||||
GROUP=wheel
|
||||
|
||||
#List of objects to compile.
|
||||
#START_INS
|
||||
OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \
|
||||
src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o src/ciphers/kseed.o \
|
||||
src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o src/ciphers/rc6.o \
|
||||
src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/safer/safer_tab.o \
|
||||
src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \
|
||||
src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \
|
||||
src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \
|
||||
src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \
|
||||
#List of objects to compile (all goes to libtomcrypt.a)
|
||||
OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \
|
||||
src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \
|
||||
src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \
|
||||
src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \
|
||||
src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \
|
||||
src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \
|
||||
src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \
|
||||
src/encauth/ccm/ccm_test.o src/encauth/chachapoly/chacha20poly1305_add_aad.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_decrypt.o src/encauth/chachapoly/chacha20poly1305_done.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_encrypt.o src/encauth/chachapoly/chacha20poly1305_init.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_memory.o src/encauth/chachapoly/chacha20poly1305_setiv.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_test.o src/encauth/eax/eax_addheader.o \
|
||||
src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \
|
||||
src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \
|
||||
src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \
|
||||
src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \
|
||||
src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \
|
||||
src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \
|
||||
src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \
|
||||
src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o \
|
||||
src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_encrypt.o \
|
||||
src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o src/encauth/ocb/ocb_shift_xor.o \
|
||||
src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \
|
||||
src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \
|
||||
src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \
|
||||
src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \
|
||||
src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \
|
||||
src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \
|
||||
src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \
|
||||
src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \
|
||||
src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o src/encauth/ocb3/ocb3_int_ntz.o \
|
||||
src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o src/hashes/blake2b.o \
|
||||
src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \
|
||||
src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \
|
||||
src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \
|
||||
src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \
|
||||
src/hashes/sha2/sha256.o src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o \
|
||||
src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o \
|
||||
src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o \
|
||||
src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \
|
||||
src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \
|
||||
src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \
|
||||
src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \
|
||||
src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \
|
||||
src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \
|
||||
src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \
|
||||
src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \
|
||||
src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/blake2/blake2bmac.o \
|
||||
src/mac/blake2/blake2bmac_file.o src/mac/blake2/blake2bmac_memory.o \
|
||||
src/mac/blake2/blake2bmac_memory_multi.o src/mac/blake2/blake2bmac_test.o src/mac/blake2/blake2smac.o \
|
||||
src/mac/blake2/blake2smac_file.o src/mac/blake2/blake2smac_memory.o \
|
||||
src/mac/blake2/blake2smac_memory_multi.o src/mac/blake2/blake2smac_test.o src/mac/f9/f9_done.o \
|
||||
src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \
|
||||
src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \
|
||||
src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \
|
||||
src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \
|
||||
src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \
|
||||
src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \
|
||||
src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \
|
||||
src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \
|
||||
src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \
|
||||
src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \
|
||||
src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \
|
||||
src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \
|
||||
src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \
|
||||
src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \
|
||||
src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \
|
||||
src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \
|
||||
src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \
|
||||
src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \
|
||||
src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \
|
||||
src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \
|
||||
src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \
|
||||
src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \
|
||||
src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \
|
||||
src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \
|
||||
src/math/radix_to_bin.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \
|
||||
src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \
|
||||
src/misc/compare_testvector.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \
|
||||
src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \
|
||||
src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \
|
||||
src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \
|
||||
src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \
|
||||
src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \
|
||||
src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \
|
||||
src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \
|
||||
src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \
|
||||
src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \
|
||||
src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o \
|
||||
src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \
|
||||
src/misc/crypt/crypt_register_all_ciphers.o src/misc/crypt/crypt_register_all_hashes.o \
|
||||
src/misc/crypt/crypt_register_all_prngs.o src/misc/crypt/crypt_register_cipher.o \
|
||||
src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \
|
||||
src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \
|
||||
src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/pkcs5/pkcs_5_1.o \
|
||||
src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o \
|
||||
src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o \
|
||||
src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o \
|
||||
src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o \
|
||||
src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o \
|
||||
src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o \
|
||||
src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o \
|
||||
src/modes/ecb/ecb_encrypt.o src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o \
|
||||
src/modes/f8/f8_encrypt.o src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o \
|
||||
src/modes/f8/f8_test_mode.o src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o \
|
||||
src/modes/lrw/lrw_encrypt.o src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o \
|
||||
src/modes/lrw/lrw_setiv.o src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o \
|
||||
src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o src/modes/ofb/ofb_encrypt.o \
|
||||
src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o src/modes/ofb/ofb_start.o \
|
||||
src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o src/modes/xts/xts_encrypt.o \
|
||||
src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o src/modes/xts/xts_test.o \
|
||||
src/pk/asn1/der/bit/der_decode_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \
|
||||
src/pk/asn1/der/bit/der_length_bit_string.o src/pk/asn1/der/boolean/der_decode_boolean.o \
|
||||
src/pk/asn1/der/boolean/der_encode_boolean.o src/pk/asn1/der/boolean/der_length_boolean.o \
|
||||
src/pk/asn1/der/choice/der_decode_choice.o src/pk/asn1/der/ia5/der_decode_ia5_string.o \
|
||||
src/pk/asn1/der/ia5/der_encode_ia5_string.o src/pk/asn1/der/ia5/der_length_ia5_string.o \
|
||||
src/pk/asn1/der/integer/der_decode_integer.o src/pk/asn1/der/integer/der_encode_integer.o \
|
||||
src/pk/asn1/der/integer/der_length_integer.o \
|
||||
src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \
|
||||
src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \
|
||||
src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \
|
||||
src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \
|
||||
src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \
|
||||
src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \
|
||||
src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \
|
||||
src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \
|
||||
src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \
|
||||
src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \
|
||||
src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \
|
||||
src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \
|
||||
src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o src/modes/lrw/lrw_encrypt.o \
|
||||
src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o src/modes/lrw/lrw_setiv.o \
|
||||
src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \
|
||||
src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \
|
||||
src/modes/ofb/ofb_start.o src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o \
|
||||
src/modes/xts/xts_encrypt.o src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o \
|
||||
src/modes/xts/xts_test.o src/pk/asn1/der/bit/der_decode_bit_string.o \
|
||||
src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \
|
||||
src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \
|
||||
src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \
|
||||
src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \
|
||||
src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \
|
||||
src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \
|
||||
src/pk/asn1/der/generalizedtime/der_length_generalizedtime.o \
|
||||
src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \
|
||||
src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \
|
||||
src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \
|
||||
src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \
|
||||
src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \
|
||||
src/pk/asn1/der/object_identifier/der_length_object_identifier.o \
|
||||
@@ -121,22 +155,32 @@ src/pk/asn1/der/printable_string/der_length_printable_string.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_ex.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_multi.o \
|
||||
src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_ex.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_multi.o src/pk/asn1/der/sequence/der_length_sequence.o \
|
||||
src/pk/asn1/der/sequence/der_sequence_free.o src/pk/asn1/der/set/der_encode_set.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_multi.o \
|
||||
src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \
|
||||
src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \
|
||||
src/pk/asn1/der/sequence/der_sequence_shrink.o src/pk/asn1/der/set/der_encode_set.o \
|
||||
src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \
|
||||
src/pk/asn1/der/short_integer/der_encode_short_integer.o \
|
||||
src/pk/asn1/der/short_integer/der_length_short_integer.o src/pk/asn1/der/utctime/der_decode_utctime.o \
|
||||
src/pk/asn1/der/utctime/der_encode_utctime.o src/pk/asn1/der/utctime/der_length_utctime.o \
|
||||
src/pk/asn1/der/utf8/der_decode_utf8_string.o src/pk/asn1/der/utf8/der_encode_utf8_string.o \
|
||||
src/pk/asn1/der/utf8/der_length_utf8_string.o src/pk/dsa/dsa_decrypt_key.o \
|
||||
src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \
|
||||
src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \
|
||||
src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc_ansi_x963_export.o \
|
||||
src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o src/pk/ecc/ecc_decrypt_key.o \
|
||||
src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \
|
||||
src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \
|
||||
src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \
|
||||
src/pk/asn1/der/short_integer/der_length_short_integer.o \
|
||||
src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \
|
||||
src/pk/asn1/der/teletex_string/der_length_teletex_string.o \
|
||||
src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \
|
||||
src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \
|
||||
src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \
|
||||
src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_key.o \
|
||||
src/pk/dh/dh_free.o src/pk/dh/dh_generate_key.o src/pk/dh/dh_import.o src/pk/dh/dh_set.o \
|
||||
src/pk/dh/dh_set_pg_dhparam.o src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o \
|
||||
src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o \
|
||||
src/pk/dsa/dsa_generate_key.o src/pk/dsa/dsa_generate_pqg.o src/pk/dsa/dsa_import.o \
|
||||
src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_set.o src/pk/dsa/dsa_set_pqg_dsaparam.o \
|
||||
src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o \
|
||||
src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o src/pk/ecc/ecc_ansi_x963_export.o \
|
||||
src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o \
|
||||
src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o \
|
||||
src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o \
|
||||
src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \
|
||||
src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \
|
||||
src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \
|
||||
src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \
|
||||
@@ -146,97 +190,105 @@ src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mg
|
||||
src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \
|
||||
src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \
|
||||
src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \
|
||||
src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_import.o \
|
||||
src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o \
|
||||
src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \
|
||||
src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_pkcs8.o src/pk/rsa/rsa_import_x509.o \
|
||||
src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_set.o src/pk/rsa/rsa_sign_hash.o \
|
||||
src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o \
|
||||
src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \
|
||||
src/prngs/sprng.o src/prngs/yarrow.o
|
||||
src/prngs/sprng.o src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \
|
||||
src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \
|
||||
src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \
|
||||
src/stream/rc4/rc4_stream.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128_stream.o \
|
||||
src/stream/sober128/sober128_test.o
|
||||
|
||||
HEADERS=src/headers/tomcrypt_cfg.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \
|
||||
src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cipher.h \
|
||||
src/headers/tomcrypt_pk.h src/headers/tomcrypt_hash.h src/headers/tomcrypt_math.h \
|
||||
src/headers/tomcrypt_misc.h src/headers/tomcrypt.h src/headers/tomcrypt_pkcs.h \
|
||||
src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h
|
||||
#List of test objects to compile (all goes to libtomcrypt_prof.a)
|
||||
TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_test.o tests/dh_test.o \
|
||||
tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \
|
||||
tests/modes_test.o tests/mpi_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o \
|
||||
tests/pkcs_1_emsa_test.o tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o \
|
||||
tests/prng_test.o tests/rotate_test.o tests/rsa_test.o tests/store_test.o tests/test.o
|
||||
|
||||
#END_INS
|
||||
#The following headers will be installed by "make install"
|
||||
HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \
|
||||
src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \
|
||||
src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \
|
||||
src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \
|
||||
src/headers/tomcrypt_prng.h
|
||||
|
||||
TESTOBJECTS=demos/test.o
|
||||
HASHOBJECTS=demos/hashsum.o
|
||||
CRYPTOBJECTS=demos/encrypt.o
|
||||
SMALLOBJECTS=demos/small.o
|
||||
TVS=demos/tv_gen.o
|
||||
MULTIS=demos/multi.o
|
||||
TIMINGS=demos/timing.o
|
||||
TESTS=demos/test.o
|
||||
#The default rule for make builds the libtomcrypt.a library (static)
|
||||
default: $(LIBMAIN_S)
|
||||
|
||||
#Files left over from making the crypt.pdf.
|
||||
LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out
|
||||
|
||||
#Compressed filenames
|
||||
COMPRESSED=crypt-$(VERSION).tar.bz2 crypt-$(VERSION).zip
|
||||
|
||||
#The default rule for make builds the libtomcrypt library.
|
||||
default:library
|
||||
|
||||
#ciphers come in two flavours... enc+dec and enc
|
||||
#SPECIAL: AES comes in two flavours - enc+dec and enc-only
|
||||
src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
$(CC) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o
|
||||
$(CC) $(LTC_CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o
|
||||
|
||||
#These are the rules to make certain object files.
|
||||
#SPECIAL: these are the rules to make certain object files
|
||||
src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c
|
||||
src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c
|
||||
src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c
|
||||
src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c
|
||||
src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c
|
||||
src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
|
||||
|
||||
#This rule makes the libtomcrypt library.
|
||||
library: $(LIBNAME)
|
||||
#Dependencies on *.h
|
||||
$(OBJECTS): $(HEADERS)
|
||||
$(TOBJECTS): $(HEADERS) tests/tomcrypt_test.h
|
||||
|
||||
testprof/$(LIBTEST):
|
||||
cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) $(MAKE)
|
||||
#This is necessary for compatibility with BSD make (namely on OpenBSD)
|
||||
.SUFFIXES: .o .c
|
||||
.c.o:
|
||||
$(CC) $(LTC_CFLAGS) -c $< -o $@
|
||||
|
||||
$(LIBNAME): $(OBJECTS)
|
||||
#Create libtomcrypt.a
|
||||
$(LIBMAIN_S): $(OBJECTS)
|
||||
$(AR) $(ARFLAGS) $@ $(OBJECTS)
|
||||
$(RANLIB) $@
|
||||
|
||||
#This rule makes the hash program included with libtomcrypt
|
||||
hashsum: library $(HASHOBJECTS)
|
||||
$(CC) $(HASHOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(HASH) $(WARN)
|
||||
#Demo tools/utilities
|
||||
hashsum: demos/hashsum.o $(LIBMAIN_S)
|
||||
$(CC) demos/hashsum.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
ltcrypt: demos/ltcrypt.o $(LIBMAIN_S)
|
||||
$(CC) demos/ltcrypt.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
small: demos/small.o $(LIBMAIN_S)
|
||||
$(CC) demos/small.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
tv_gen: demos/tv_gen.o $(LIBMAIN_S)
|
||||
$(CC) demos/tv_gen.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
sizes: demos/sizes.o $(LIBMAIN_S)
|
||||
$(CC) demos/sizes.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
constants: demos/constants.o $(LIBMAIN_S)
|
||||
$(CC) demos/constants.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
timing: demos/timing.o $(LIBMAIN_S)
|
||||
$(CC) demos/timing.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
|
||||
#makes the crypt program
|
||||
crypt: library $(CRYPTOBJECTS)
|
||||
$(CC) $(CRYPTOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(CRYPT) $(WARN)
|
||||
#Tests
|
||||
test: $(TOBJECTS) $(LIBMAIN_S)
|
||||
$(CC) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
@echo "NOTICE: start the tests by: ./test"
|
||||
|
||||
#makes the small program
|
||||
small: library $(SMALLOBJECTS)
|
||||
$(CC) $(SMALLOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(SMALL) $(WARN)
|
||||
|
||||
tv_gen: library $(TVS)
|
||||
$(CC) $(LDFLAGS) $(TVS) $(LIBNAME) $(EXTRALIBS) -o $(TV)
|
||||
all: $(LIBMAIN_S) hashsum ltcrypt small tv_gen sizes constants timing test
|
||||
|
||||
multi: library $(MULTIS)
|
||||
$(CC) $(MULTIS) $(LIBNAME) $(EXTRALIBS) -o $(MULTI)
|
||||
#NOTE: this makefile works also on cygwin, thus we need to delete *.exe
|
||||
clean:
|
||||
-@rm -f $(OBJECTS) $(TOBJECTS)
|
||||
-@rm -f $(LIBMAIN_S)
|
||||
-@rm -f demos/*.o *_tv.txt
|
||||
-@rm -f test constants sizes tv_gen hashsum ltcrypt small timing
|
||||
-@rm -f test.exe constants.exe sizes.exe tv_gen.exe hashsum.exe ltcrypt.exe small.exe timing.exe
|
||||
|
||||
timing: library testprof/$(LIBTEST) $(TIMINGS)
|
||||
$(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING)
|
||||
#Install the library + headers
|
||||
install: $(LIBMAIN_S) $(HEADERS)
|
||||
@mkdir -p $(DESTDIR)$(INCPATH) $(DESTDIR)$(LIBPATH)/pkgconfig
|
||||
@cp $(LIBMAIN_S) $(DESTDIR)$(LIBPATH)/
|
||||
@cp $(HEADERS) $(DESTDIR)$(INCPATH)/
|
||||
@sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc
|
||||
|
||||
test: library testprof/$(LIBTEST) $(TESTS)
|
||||
$(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST)
|
||||
#Install useful tools
|
||||
install_bins: hashsum
|
||||
@mkdir -p $(DESTDIR)$(BINPATH)
|
||||
@cp hashsum $(DESTDIR)$(BINPATH)/
|
||||
|
||||
#This rule installs the library and the header files. This must be run
|
||||
#as root in order to have a high enough permission to write to the correct
|
||||
#directories and to set the owner and group to root.
|
||||
install: library
|
||||
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
|
||||
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
|
||||
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(DATAPATH)
|
||||
install -g $(GROUP) -o $(USER) $(LIBNAME) $(DESTDIR)$(LIBPATH)
|
||||
install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH)
|
||||
|
||||
install_test: testprof/$(LIBTEST)
|
||||
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
|
||||
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
|
||||
install -g $(GROUP) -o $(USER) testprof/$(LIBTEST) $(DESTDIR)$(LIBPATH)
|
||||
|
||||
# $Source: /cvs/libtom/libtomcrypt/makefile.unix,v $
|
||||
# $Revision: 1.7 $
|
||||
# $Date: 2007/02/16 16:36:25 $
|
||||
#Install documentation
|
||||
install_docs: doc/crypt.pdf
|
||||
@mkdir -p $(DESTDIR)$(DATAPATH)
|
||||
@cp doc/crypt.pdf $(DESTDIR)$(DATAPATH)/
|
||||
|
||||
471
libtomcrypt/makefile_include.mk
Normal file
471
libtomcrypt/makefile_include.mk
Normal file
@@ -0,0 +1,471 @@
|
||||
#
|
||||
# Include makefile used by makefile + makefile.shared
|
||||
# (GNU make only)
|
||||
|
||||
# The version - BEWARE: VERSION, VERSION_PC and VERSION_LT are updated via ./updatemakes.sh
|
||||
VERSION=1.18.1
|
||||
VERSION_PC=1.18.1
|
||||
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
||||
VERSION_LT=1:1
|
||||
|
||||
# Compiler and Linker Names
|
||||
ifndef CROSS_COMPILE
|
||||
CROSS_COMPILE:=
|
||||
endif
|
||||
|
||||
ifeq ($(CC),cc)
|
||||
CC := $(CROSS_COMPILE)gcc
|
||||
endif
|
||||
LD:=$(CROSS_COMPILE)ld
|
||||
AR:=$(CROSS_COMPILE)ar
|
||||
|
||||
# Archiver [makes .a files]
|
||||
#AR=ar
|
||||
ARFLAGS:=r
|
||||
|
||||
ifndef MAKE
|
||||
MAKE:=make
|
||||
endif
|
||||
|
||||
ifndef INSTALL_CMD
|
||||
$(error your makefile must define INSTALL_CMD)
|
||||
endif
|
||||
ifndef UNINSTALL_CMD
|
||||
$(error your makefile must define UNINSTALL_CMD)
|
||||
endif
|
||||
|
||||
ifndef EXTRALIBS
|
||||
ifneq ($(shell echo $(CFLAGS) | grep USE_LTM),)
|
||||
EXTRALIBS=$(shell PKG_CONFIG_PATH=$(LIBPATH)/pkgconfig pkg-config libtommath --libs)
|
||||
else
|
||||
ifneq ($(shell echo $(CFLAGS) | grep USE_TFM),)
|
||||
EXTRALIBS=$(shell PKG_CONFIG_PATH=$(LIBPATH)/pkgconfig pkg-config tomsfastmath --libs)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
need-help := $(filter help,$(MAKECMDGOALS))
|
||||
define print-help
|
||||
$(if $(need-help),$(info $1 -- $2))
|
||||
endef
|
||||
|
||||
#
|
||||
# Compilation flags. Note the += does not write over the user's CFLAGS!
|
||||
#
|
||||
# Also note that we're extending the environments' CFLAGS.
|
||||
# If you think that our CFLAGS are not nice you can easily override them
|
||||
# by giving them as a parameter to make:
|
||||
# make CFLAGS="-I./src/headers/ -DLTC_SOURCE ..." ...
|
||||
#
|
||||
LTC_CFLAGS += -I./src/headers/ -Wall -Wsign-compare -Wshadow -DLTC_SOURCE
|
||||
|
||||
ifdef OLD_GCC
|
||||
LTC_CFLAGS += -W
|
||||
# older GCCs can't handle the "rotate with immediate" ROLc/RORc/etc macros
|
||||
# define this to help
|
||||
LTC_CFLAGS += -DLTC_NO_ROLC
|
||||
else
|
||||
LTC_CFLAGS += -Wextra
|
||||
# additional warnings
|
||||
LTC_CFLAGS += -Wsystem-headers -Wbad-function-cast -Wcast-align
|
||||
LTC_CFLAGS += -Wstrict-prototypes -Wpointer-arith
|
||||
LTC_CFLAGS += -Wdeclaration-after-statement
|
||||
LTC_CFLAGS += -Wwrite-strings
|
||||
endif
|
||||
|
||||
LTC_CFLAGS += -Wno-type-limits
|
||||
|
||||
ifdef LTC_DEBUG
|
||||
$(info Debug build)
|
||||
# compile for DEBUGGING (required for ccmalloc checking!!!)
|
||||
LTC_CFLAGS += -g3 -DLTC_NO_ASM
|
||||
ifneq (,$(strip $(LTC_DEBUG)))
|
||||
LTC_CFLAGS += -DLTC_TEST_DBG=$(LTC_DEBUG)
|
||||
else
|
||||
LTC_CFLAGS += -DLTC_TEST_DBG
|
||||
endif
|
||||
else
|
||||
|
||||
ifdef LTC_SMALL
|
||||
# optimize for SIZE
|
||||
LTC_CFLAGS += -Os -DLTC_SMALL_CODE
|
||||
else
|
||||
|
||||
ifndef IGNORE_SPEED
|
||||
# optimize for SPEED
|
||||
LTC_CFLAGS += -O3 -funroll-loops
|
||||
|
||||
# add -fomit-frame-pointer. hinders debugging!
|
||||
LTC_CFLAGS += -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
endif # COMPILE_SMALL
|
||||
endif # COMPILE_DEBUG
|
||||
|
||||
|
||||
ifneq ($(findstring clang,$(CC)),)
|
||||
LTC_CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare -Wno-builtin-requires-header -Wno-missing-field-initializers
|
||||
endif
|
||||
ifneq ($(findstring mingw,$(CC)),)
|
||||
LTC_CFLAGS += -Wno-shadow -Wno-attributes
|
||||
endif
|
||||
ifeq ($(PLATFORM), Darwin)
|
||||
LTC_CFLAGS += -Wno-nullability-completeness
|
||||
endif
|
||||
|
||||
|
||||
GIT_VERSION := $(shell { [ -e .git ] && which git 2>/dev/null 1>&2 ; } && { printf git- ; git describe --tags --always --dirty ; } || echo $(VERSION))
|
||||
ifneq ($(GIT_VERSION),)
|
||||
LTC_CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
|
||||
endif
|
||||
|
||||
LTC_CFLAGS := $(LTC_CFLAGS) $(CFLAGS)
|
||||
|
||||
ifneq ($(findstring -DLTC_PTHREAD,$(LTC_CFLAGS)),)
|
||||
LTC_LDFLAGS += -pthread
|
||||
endif
|
||||
|
||||
LTC_LDFLAGS := $(LTC_LDFLAGS) $(LDFLAGS)
|
||||
|
||||
#List of demo objects
|
||||
DSOURCES = $(wildcard demos/*.c)
|
||||
DOBJECTS = $(DSOURCES:.c=.o)
|
||||
|
||||
#List of tests headers
|
||||
THEADERS = $(wildcard tests/*.h)
|
||||
|
||||
TEST=test
|
||||
|
||||
# Demos that are even somehow useful and could be installed as a system-tool
|
||||
USEFUL_DEMOS = hashsum
|
||||
|
||||
# Demos that are usable but only rarely make sense to be installed
|
||||
USEABLE_DEMOS = ltcrypt sizes constants
|
||||
|
||||
# Demos that are used for testing or measuring
|
||||
TEST_DEMOS = small tv_gen
|
||||
|
||||
# Demos that are in one config broken
|
||||
# openssl-enc - can't be build with LTC_EASY
|
||||
# timing - not really broken, but older gcc builds spit warnings
|
||||
BROKEN_DEMOS = openssl-enc timing
|
||||
|
||||
# Combine demos in groups
|
||||
UNBROKEN_DEMOS = $(TEST_DEMOS) $(USEABLE_DEMOS) $(USEFUL_DEMOS)
|
||||
DEMOS = $(UNBROKEN_DEMOS) $(BROKEN_DEMOS)
|
||||
|
||||
#LIBPATH The directory for libtomcrypt to be installed to.
|
||||
#INCPATH The directory to install the header files for libtomcrypt.
|
||||
#DATAPATH The directory to install the pdf docs.
|
||||
#BINPATH The directory to install the binaries provided.
|
||||
DESTDIR ?=
|
||||
PREFIX ?= /usr/local
|
||||
LIBPATH ?= $(PREFIX)/lib
|
||||
INCPATH ?= $(PREFIX)/include
|
||||
DATAPATH ?= $(PREFIX)/share/doc/libtomcrypt/pdf
|
||||
BINPATH ?= $(PREFIX)/bin
|
||||
|
||||
#Who do we install as?
|
||||
ifdef INSTALL_USER
|
||||
USER=$(INSTALL_USER)
|
||||
else
|
||||
USER=root
|
||||
endif
|
||||
|
||||
ifdef INSTALL_GROUP
|
||||
GROUP=$(INSTALL_GROUP)
|
||||
else
|
||||
GROUP=wheel
|
||||
endif
|
||||
|
||||
|
||||
#The first rule is also the default rule and builds the libtomcrypt library.
|
||||
library: $(call print-help,library,Builds the library) $(LIBNAME)
|
||||
|
||||
|
||||
# List of objects to compile (all goes to libtomcrypt.a)
|
||||
OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \
|
||||
src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \
|
||||
src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \
|
||||
src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \
|
||||
src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \
|
||||
src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \
|
||||
src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \
|
||||
src/encauth/ccm/ccm_test.o src/encauth/chachapoly/chacha20poly1305_add_aad.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_decrypt.o src/encauth/chachapoly/chacha20poly1305_done.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_encrypt.o src/encauth/chachapoly/chacha20poly1305_init.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_memory.o src/encauth/chachapoly/chacha20poly1305_setiv.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_test.o src/encauth/eax/eax_addheader.o \
|
||||
src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \
|
||||
src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \
|
||||
src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \
|
||||
src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \
|
||||
src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \
|
||||
src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \
|
||||
src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \
|
||||
src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \
|
||||
src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \
|
||||
src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \
|
||||
src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \
|
||||
src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \
|
||||
src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \
|
||||
src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o src/encauth/ocb3/ocb3_int_ntz.o \
|
||||
src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o src/hashes/blake2b.o \
|
||||
src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \
|
||||
src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \
|
||||
src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \
|
||||
src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \
|
||||
src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \
|
||||
src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \
|
||||
src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/blake2/blake2bmac.o \
|
||||
src/mac/blake2/blake2bmac_file.o src/mac/blake2/blake2bmac_memory.o \
|
||||
src/mac/blake2/blake2bmac_memory_multi.o src/mac/blake2/blake2bmac_test.o src/mac/blake2/blake2smac.o \
|
||||
src/mac/blake2/blake2smac_file.o src/mac/blake2/blake2smac_memory.o \
|
||||
src/mac/blake2/blake2smac_memory_multi.o src/mac/blake2/blake2smac_test.o src/mac/f9/f9_done.o \
|
||||
src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \
|
||||
src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \
|
||||
src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \
|
||||
src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \
|
||||
src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \
|
||||
src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \
|
||||
src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \
|
||||
src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \
|
||||
src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \
|
||||
src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \
|
||||
src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \
|
||||
src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \
|
||||
src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \
|
||||
src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \
|
||||
src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \
|
||||
src/math/radix_to_bin.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \
|
||||
src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \
|
||||
src/misc/compare_testvector.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \
|
||||
src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \
|
||||
src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \
|
||||
src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \
|
||||
src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \
|
||||
src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \
|
||||
src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \
|
||||
src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \
|
||||
src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \
|
||||
src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \
|
||||
src/misc/crypt/crypt_register_all_ciphers.o src/misc/crypt/crypt_register_all_hashes.o \
|
||||
src/misc/crypt/crypt_register_all_prngs.o src/misc/crypt/crypt_register_cipher.o \
|
||||
src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \
|
||||
src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \
|
||||
src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \
|
||||
src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \
|
||||
src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \
|
||||
src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \
|
||||
src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \
|
||||
src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \
|
||||
src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \
|
||||
src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \
|
||||
src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \
|
||||
src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \
|
||||
src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \
|
||||
src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \
|
||||
src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o src/modes/lrw/lrw_encrypt.o \
|
||||
src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o src/modes/lrw/lrw_setiv.o \
|
||||
src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \
|
||||
src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \
|
||||
src/modes/ofb/ofb_start.o src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o \
|
||||
src/modes/xts/xts_encrypt.o src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o \
|
||||
src/modes/xts/xts_test.o src/pk/asn1/der/bit/der_decode_bit_string.o \
|
||||
src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \
|
||||
src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \
|
||||
src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \
|
||||
src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \
|
||||
src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \
|
||||
src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \
|
||||
src/pk/asn1/der/generalizedtime/der_length_generalizedtime.o \
|
||||
src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \
|
||||
src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \
|
||||
src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \
|
||||
src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \
|
||||
src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \
|
||||
src/pk/asn1/der/object_identifier/der_length_object_identifier.o \
|
||||
src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \
|
||||
src/pk/asn1/der/octet/der_length_octet_string.o \
|
||||
src/pk/asn1/der/printable_string/der_decode_printable_string.o \
|
||||
src/pk/asn1/der/printable_string/der_encode_printable_string.o \
|
||||
src/pk/asn1/der/printable_string/der_length_printable_string.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_ex.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_multi.o \
|
||||
src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_ex.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_multi.o \
|
||||
src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \
|
||||
src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \
|
||||
src/pk/asn1/der/sequence/der_sequence_shrink.o src/pk/asn1/der/set/der_encode_set.o \
|
||||
src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \
|
||||
src/pk/asn1/der/short_integer/der_encode_short_integer.o \
|
||||
src/pk/asn1/der/short_integer/der_length_short_integer.o \
|
||||
src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \
|
||||
src/pk/asn1/der/teletex_string/der_length_teletex_string.o \
|
||||
src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \
|
||||
src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \
|
||||
src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \
|
||||
src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_key.o \
|
||||
src/pk/dh/dh_free.o src/pk/dh/dh_generate_key.o src/pk/dh/dh_import.o src/pk/dh/dh_set.o \
|
||||
src/pk/dh/dh_set_pg_dhparam.o src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o \
|
||||
src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o \
|
||||
src/pk/dsa/dsa_generate_key.o src/pk/dsa/dsa_generate_pqg.o src/pk/dsa/dsa_import.o \
|
||||
src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_set.o src/pk/dsa/dsa_set_pqg_dsaparam.o \
|
||||
src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o \
|
||||
src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o src/pk/ecc/ecc_ansi_x963_export.o \
|
||||
src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o \
|
||||
src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o \
|
||||
src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o \
|
||||
src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \
|
||||
src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \
|
||||
src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \
|
||||
src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \
|
||||
src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \
|
||||
src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \
|
||||
src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \
|
||||
src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \
|
||||
src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \
|
||||
src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \
|
||||
src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \
|
||||
src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_pkcs8.o src/pk/rsa/rsa_import_x509.o \
|
||||
src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_set.o src/pk/rsa/rsa_sign_hash.o \
|
||||
src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o \
|
||||
src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \
|
||||
src/prngs/sprng.o src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \
|
||||
src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \
|
||||
src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \
|
||||
src/stream/rc4/rc4_stream.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128_stream.o \
|
||||
src/stream/sober128/sober128_test.o
|
||||
|
||||
# List of test objects to compile (all goes to libtomcrypt_prof.a)
|
||||
TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_test.o tests/dh_test.o \
|
||||
tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \
|
||||
tests/modes_test.o tests/mpi_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o \
|
||||
tests/pkcs_1_emsa_test.o tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o \
|
||||
tests/prng_test.o tests/rotate_test.o tests/rsa_test.o tests/store_test.o tests/test.o
|
||||
|
||||
# The following headers will be installed by "make install"
|
||||
HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \
|
||||
src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \
|
||||
src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \
|
||||
src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \
|
||||
src/headers/tomcrypt_prng.h
|
||||
|
||||
#These are the rules to make certain object files.
|
||||
src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c
|
||||
src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c
|
||||
src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c
|
||||
src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c
|
||||
src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c
|
||||
src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
|
||||
|
||||
$(DOBJECTS): LTC_CFLAGS := -Itests $(LTC_CFLAGS)
|
||||
$(TOBJECTS): LTC_CFLAGS := -Itests $(LTC_CFLAGS)
|
||||
|
||||
#Dependencies on *.h
|
||||
$(OBJECTS): $(HEADERS)
|
||||
$(DOBJECTS): $(HEADERS) $(THEADERS)
|
||||
$(TOBJECTS): $(HEADERS) $(THEADERS)
|
||||
|
||||
all: $(call print-help,all,Builds the library and all demos and test utils (test $(UNBROKEN_DEMOS) $(BROKEN_DEMOS))) all_test $(BROKEN_DEMOS)
|
||||
|
||||
all_test: $(call print-help,all_test,Builds the library and all unbroken demos and test utils (test $(UNBROKEN_DEMOS))) test $(UNBROKEN_DEMOS)
|
||||
|
||||
bins: $(call print-help,bins,Builds the library and all useful demos) $(USEFUL_DEMOS)
|
||||
|
||||
#build the doxy files (requires Doxygen, tetex and patience)
|
||||
doxygen: $(call print-help,doxygen,Builds the doxygen html documentation)
|
||||
$(MAKE) -C doc/ $@ V=$(V)
|
||||
doxy: $(call print-help,doxy,Builds the complete doxygen documentation including refman.pdf (takes long to generate))
|
||||
$(MAKE) -C doc/ $@ V=$(V)
|
||||
docs: $(call print-help,docs,Builds the Developer Manual)
|
||||
$(MAKE) -C doc/ $@ V=$(V)
|
||||
|
||||
doc/crypt.pdf: $(call print-help,doc/crypt.pdf,Builds the Developer Manual)
|
||||
$(MAKE) -C doc/ crypt.pdf V=$(V)
|
||||
|
||||
|
||||
install_all: $(call print-help,install_all,Install everything - library bins docs tests) install install_bins install_docs install_test
|
||||
|
||||
INSTALL_OPTS ?= -m 644
|
||||
|
||||
.common_install: $(LIBNAME)
|
||||
install -p -d $(DESTDIR)$(INCPATH)
|
||||
install -p -d $(DESTDIR)$(LIBPATH)
|
||||
$(INSTALL_CMD) -p $(INSTALL_OPTS) $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
|
||||
install -p -m 644 $(HEADERS) $(DESTDIR)$(INCPATH)
|
||||
|
||||
$(DESTDIR)$(BINPATH):
|
||||
install -p -d $(DESTDIR)$(BINPATH)
|
||||
|
||||
.common_install_bins: $(USEFUL_DEMOS) $(DESTDIR)$(BINPATH)
|
||||
$(INSTALL_CMD) -p -m 775 $(USEFUL_DEMOS) $(DESTDIR)$(BINPATH)
|
||||
|
||||
install_docs: $(call print-help,install_docs,Installs the Developer Manual) doc/crypt.pdf
|
||||
install -p -d $(DESTDIR)$(DATAPATH)
|
||||
install -p -m 644 doc/crypt.pdf $(DESTDIR)$(DATAPATH)
|
||||
|
||||
install_test: $(call print-help,install_test,Installs the self-test binary) test $(DESTDIR)$(BINPATH)
|
||||
$(INSTALL_CMD) -p -m 775 $< $(DESTDIR)$(BINPATH)
|
||||
|
||||
install_hooks: $(call print-help,install_hooks,Installs the git hooks)
|
||||
for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done
|
||||
|
||||
HEADER_FILES=$(notdir $(HEADERS))
|
||||
.common_uninstall:
|
||||
$(UNINSTALL_CMD) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
|
||||
rm $(HEADER_FILES:%=$(DESTDIR)$(INCPATH)/%)
|
||||
|
||||
#This rule cleans the source tree of all compiled code, not including the pdf
|
||||
#documentation.
|
||||
clean: $(call print-help,clean,Clean everything besides the pdf documentation)
|
||||
find . -type f -name "*.o" \
|
||||
-o -name "*.lo" \
|
||||
-o -name "*.a" \
|
||||
-o -name "*.la" \
|
||||
-o -name "*.obj" \
|
||||
-o -name "*.lib" \
|
||||
-o -name "*.exe" \
|
||||
-o -name "*.dll" \
|
||||
-o -name "*.so" \
|
||||
-o -name "*.gcov"\
|
||||
-o -name "*.gcda"\
|
||||
-o -name "*.gcno"\
|
||||
-o -name "*.il" \
|
||||
-o -name "*.dyn" \
|
||||
-o -name "*.dpi" | xargs rm -f
|
||||
rm -f $(TIMING) $(TEST) $(DEMOS)
|
||||
rm -f *_tv.txt
|
||||
rm -f *.pc
|
||||
rm -rf `find . -type d -name "*.libs" | xargs`
|
||||
$(MAKE) -C doc/ clean
|
||||
|
||||
zipup: $(call print-help,zipup,Prepare the archives for a release) doc/crypt.pdf
|
||||
@# Update the index, so diff-index won't fail in case the pdf has been created.
|
||||
@# As the pdf creation modifies crypt.tex, git sometimes detects the
|
||||
@# modified file, but misses that it's put back to its original version.
|
||||
@git update-index --refresh
|
||||
@git diff-index --quiet HEAD -- || ( echo "FAILURE: uncommited changes or not a git" && exit 1 )
|
||||
@perl helper.pl --check-all || ( echo "FAILURE: helper.pl --check-all errors" && exit 1 )
|
||||
rm -rf libtomcrypt-$(VERSION) crypt-$(VERSION).*
|
||||
@# files/dirs excluded from "git archive" are defined in .gitattributes
|
||||
git archive --format=tar --prefix=libtomcrypt-$(VERSION)/ HEAD | tar x
|
||||
@echo 'fixme check'
|
||||
-@(find libtomcrypt-$(VERSION)/ -type f | xargs grep 'FIXM[E]') && echo '############## BEWARE: the "fixme" marker was found !!! ##############' || true
|
||||
mkdir -p libtomcrypt-$(VERSION)/doc
|
||||
cp doc/crypt.pdf libtomcrypt-$(VERSION)/doc/crypt.pdf
|
||||
tar -c libtomcrypt-$(VERSION)/ | xz -6e -c - > crypt-$(VERSION).tar.xz
|
||||
zip -9rq crypt-$(VERSION).zip libtomcrypt-$(VERSION)
|
||||
rm -rf libtomcrypt-$(VERSION)
|
||||
gpg -b -a crypt-$(VERSION).tar.xz
|
||||
gpg -b -a crypt-$(VERSION).zip
|
||||
|
||||
codecheck: $(call print-help,codecheck,Check the code of the library)
|
||||
perl helper.pl -a
|
||||
perlcritic *.pl
|
||||
|
||||
help: $(call print-help,help,That's what you're currently looking at)
|
||||
@@ -143,39 +143,39 @@ CCM-twofish (16 byte key)
|
||||
32: 839A9BFA1D3CA37924BC6648DED2291FC61736A3638906D9C5DA28A66AA684AC, CD07B83C8E0C3E6FB4115A149BDF6FDA
|
||||
|
||||
CCM-noekeon (16 byte key)
|
||||
0: , FF73C6775C61DB36D9B5EEC812091FF7
|
||||
1: 5F, 7D2AEA62A5202E3C4FBE05F33EBE4CC5
|
||||
2: 0EA5, 312ED15FDDAB6EEEAC6AF9BE9CE698FA
|
||||
3: 968F95, FA1AD58B85B93B5A4B5096C881F773C3
|
||||
4: 9A8F4069, 8911063ADDF79E27D9DCEFF3F440E6D7
|
||||
5: A5C0376E27, 9553F44B0BA8039527F8E05CD70AD8B0
|
||||
6: 5B097736F3DA, 405B7EC685FC94903B36AC8E700558B8
|
||||
7: 616810AE303B2C, 64C95A2DF5263F7BE6D1F9F3CF88EADE
|
||||
8: C8D69A2E1170532C, 073A7E426266237FD73D8109F55AE5D3
|
||||
9: 3E42CDB7DA4A72F2E0, 48675EA4302CA6BFE5992DE96CE43BB3
|
||||
10: 88532CC1F3E321F66D64, 528B3516C6D9A4B5390DD32C2A2E6C19
|
||||
11: 9216A8FC9A961E7F602F7D, B03047186B783844F5B6757057576B38
|
||||
12: 89B0858D4FDE6795EDE19CCC, F4530A2DCA823307AEDE5AF34E5C4191
|
||||
13: A676E20BB0A5E84FD0B9149BF7, 11B823B315DA93B0E15780851526D4BD
|
||||
14: 903AD5C108C43A80436FE2117EF0, EB1C79C7DF20CE2967A99783EA8D6EF8
|
||||
15: 81774C36F46F67159B7FFC24C080D7, 2E9E4812D9A92977EC34922782B6420D
|
||||
16: 63FD1C3F692D64B2DA3982FCD474A5D4, 04171AE84857713A9BABBD4564875D33
|
||||
17: B1BF6AD99F83C9173C6C021ACA74C5431C, 38D17D4F6AA3C24B8F3B465EAACE0A1E
|
||||
18: 0948D1ED59F07DE44A96A76E05B0B6F7C309, 1848D886FCFF35E85B0DC3CBE5BEE7FA
|
||||
19: 3458E5911222F9C555A1054C7D9748876DA39A, 584AFAE72FB6065A74BE016CF39D2E86
|
||||
20: 641F3867185D0605E9D666AB605187E75A1299EF, 6F9332E6FB5EA0CE811E3345593CD163
|
||||
21: 0676622D07733EF31A765AAB1E713FCE329277FB16, 88547474050FFC986930CC04BA8A03F0
|
||||
22: 79861EC2FD2BCC5C12B69F30A1575FC66AC1405281BB, FC68EEAC8F39ED69D312AEABF8000084
|
||||
23: CB2731835A576F7F8F2C2786D786FB6186E2F85D89DA3B, 3ED9E95BC51CF6368E6EF63667B35BD8
|
||||
24: 3CB1C02FADB6DD5483BC5D3C03D944102CFCEDF82B913402, 1C3F60C989A6FBF41A7AF4F29115C334
|
||||
25: E69FAEA5E3D0B76EF9E70F99C5918D934D0E9836F248DB9EEE, 7F1916B2CF7C9A5E3F5581D365ADBD31
|
||||
26: 36779AD755A9DF2DC3C5824DC2F7DD4FFE038628A4E1A1C33AE7, 2BDED3703468D267F8AB7EC0AF8F1E65
|
||||
27: E9D325646A41EE5AA7DABCDE98DE83440A7DC02714BA0AEE017E22, 972F4D7832F3371C60DCD04A6DEDEA15
|
||||
28: 0FAAE3F6028A28A80BBFE71FA7AA9042E538B41A0D514D6EB4EE6029, F7B3925495E260249ACC6E1CBE956BC5
|
||||
29: A9CC39EFFEE354C0E0579256AA85CBAA7B10E670DD3828A7A05DA0F49D, 28D9D20187AFE70AD9DD16759F0EFEB5
|
||||
30: 032F4BBB4EBF2E65758C541FDAFF2107DDBED399739849F8EBB41AF9711F, A3436981ED637CE5EEE01B380C46ACAD
|
||||
31: 7B321ED831CE96A603668E3E74BBC7453749A03D04A1B38E95966E6CC488F0, 88D1DADF2C1EE0BA579D0A8A90C1E62A
|
||||
32: D862B0BD0E2178AE05AEFB14F34C791547C5956F1F3B5BD525926578DE383A94, BF32CFE059F27222DC55D3E7CE7C5F10
|
||||
0: , AB924F56DFA05F4E8628C14111272E5C
|
||||
1: 08, 8A76DCADA7CE53A0F4577E67B0B958D7
|
||||
2: B602, E0BEAC0B1E95C4570A823295E7517C25
|
||||
3: 50E4B1, F874F8B5F2806F64AE0AED151821C638
|
||||
4: 990F28F6, 9AE2D6D5576D1C4722E2E3C11F5D98FF
|
||||
5: 297104DD8D, 7A245E5F5E0F4C3466E16D5EF2B96D80
|
||||
6: 7B6E9776EF05, 6B540166DE5E154D7A3A34EEA3FAD5F3
|
||||
7: 67EB1922FAB0E1, 549F39F7C3CB17F0EA6EA9C75899BD55
|
||||
8: 343E752F0F956C7F, 19CBB59CC4117DE6EB9924AB0CE2C9B9
|
||||
9: 98A25FBBD87D8C1829, 6E3D4F0ED0C5B9161EB11AE9600003F6
|
||||
10: AAA54C273F69638CFB54, 1192FCD1F9F543889F3607CD6B623AA6
|
||||
11: 51B3F33EF8B1F38438618B, 8A704F5B003A21E4033ABFCC6C53577A
|
||||
12: C7E5167D81B23F47AE90DFC8, E218F7DD222CE31642CB06C329911CD9
|
||||
13: B065DFE10B9C32F1B028AACE4F, 5EC4DE45C29C78D1CDDF2A6AC05BD53F
|
||||
14: B5AAF0ADCA03812F251C8A2BE745, AA353E20F65237279643D4CCC06150A8
|
||||
15: 88AF734661B83CBA42FF983C260B63, 8F20A5190A218B8D392ABA1295CBF905
|
||||
16: 6663AE30F79A110747D6678784330BF6, 142196DDD26668E08D196BCE0989AE01
|
||||
17: 8153816C6E9C449B0439AD7892DF8C0492, 58B376CF240C37A08337C7794736838D
|
||||
18: 1611C22134C06CF8F43625017CCC65B6E305, C0443028C8DC5FB78F9350C4A8D1D32D
|
||||
19: FD2EEDDF2B20F7623D854FF4E987DB4196AB2E, 8B2CD7C72438F3EB071A33A7C65610B3
|
||||
20: 641256A9C543D0860E609F1AABC36EAB515E29C1, 0E1A0FE82BB18BFBB3D13BEB84BA185D
|
||||
21: 437719619E96C3AD2080470809F7CDDEC3011EB6E9, E31934C5F0C2E4A04A4ED533A98C795C
|
||||
22: CF2B11E8660CC6E650EDDB2146B11F864E01B4C99DDD, 8647759347E7A4FD2CE8AC17AF4186C9
|
||||
23: F339314695B539B715A7E5FB4799029CC133CEE26A2E86, 136274C51D9797986E92F9E540A80EB1
|
||||
24: 38F843B9DA155D57166D310D85406E72FB382604C2EA4CE3, D1D7C6397599ACC2EB5CF1E06975B423
|
||||
25: 29E497528D72C2BEBB12663F71B3981705BEF60A5451FAE4F4, 50F6C796CC00FE590E5E975206045702
|
||||
26: F16F583E1FEBC78F5AB0FA61B5BC389D3C16B62ECA7C6A86BC98, B3643EA448ECA0511312895B63193516
|
||||
27: 80347C7148FE1A5B078A27B3821DDFD93341F0351F4323EFEA6632, 8AF133E83EB316E615F1BC9DF241E23F
|
||||
28: 96939F79855C211B23E45771DDA2C3AB81C2672F94B87A7FFE46FC84, 4E7DEF91D1A102667BF55922B2531E6A
|
||||
29: 4789028961FDB78E8821A1FD9AF93BDB3CAC5C75566613E148B4439E90, 470DC4389C466AE79051A62F8122A1BD
|
||||
30: 7D2030ACE87827B785D3EFA3AE5CCB3DBF3A06DE4BED2D4FAB31DBE90F58, 55437514620E6B499C4FC01445FD2828
|
||||
31: 276940205F5B869E40BBB064BB0DEF9D86D520DFCFE531A77A55AA78DE8709, F291F6A4D7EFF52E5EE47CC3ED7902B3
|
||||
32: A75FCDC9F4E38C02E70D885353F5E3E7E13A14237D75EFA0D53B0C808EAF10AE, CABDB90052202C4EC777936B6097320F
|
||||
|
||||
CCM-anubis (16 byte key)
|
||||
0: , C85F41475E06F25682F855C3D45A6523
|
||||
@@ -212,3 +212,73 @@ CCM-anubis (16 byte key)
|
||||
31: B8176469E6A0D5797ED6421A871FEECDE48ACF011E394981C43AC917E8FFD5, E9B01383DB1A32E6126BD802A6C6F47E
|
||||
32: AB6A0AA29B687D05735167D78DB697BA2478BD14ECD059AE9D1239E7F2AB48FD, A560A30FD87CF28BA66F5B2638567E4B
|
||||
|
||||
CCM-seed (16 byte key)
|
||||
0: , 960414F81DF9F363AE6234067B946EA6
|
||||
1: 15, 17746EC09B06AF1DE24710D2506629CD
|
||||
2: 892C, 828705A8CF1E51688EC4F1FFAC4C151A
|
||||
3: E411A7, 1AF2DD611D05DAF48118D1E7D810C173
|
||||
4: B9DC8276, 4D335DF8B860AF121904310F5C004212
|
||||
5: 8182C84A25, B713177663D498218908178B3EA3C65E
|
||||
6: 5933E7872324, 52413BB22BABEC9E43F1A98B78B4496E
|
||||
7: A243E381075DEA, 8FF3D2D465748AAF2373D1D8F8EDCFC3
|
||||
8: 57A4E46B9B5C1795, B26653992639D54D5CEBAC7473CD3285
|
||||
9: 4D05D6669D9A0C3079, 6B26FA6D5271D74D444985466D2CF0AA
|
||||
10: 1D35BB653A9F48C3314B, 494E108B0780280DF7CB4BE24CACB5CB
|
||||
11: 9A227951B4565021D29DD4, 3E21A07540744E26424996B0670CB07A
|
||||
12: 3E893574DD3D82CCD83E87E0, 017D51F744FE95E375D0456FA8BB0EC9
|
||||
13: 5DF04297D842B3CEFCF93F5B95, 49CCE7A12C85648BD2A07944623C81AC
|
||||
14: 27F7D25EDE3471AAE1B91BBAEAD0, A6F1DD19DF08160D982184A414247B8B
|
||||
15: 6F8583E5B88B15F89070FB7A49383F, 4C98CC3884A2BD20AC6FA5184FB72670
|
||||
16: 5D8D511AE705860B1A55E2FDAE9581D9, 96EF02C285AFD27D2B26BCAC02EC56A0
|
||||
17: C4508E9E03DFE7C3B89192589CFD171A16, A2A4DC81E900BC5C404389BBD0B4710D
|
||||
18: 3163AE0E74B3DE3779745A82B783D882F092, A89574F7D1C2B90241A702A2C6A2AD86
|
||||
19: 2D9C64EF9D8C2E195AF05BAE747A7BF8EC6C30, 07EEB7667A539164862E472366FFAD68
|
||||
20: 03D145C9133E9108BB7A61D17880B155A56A58E6, 4F8EBC9A3F3C74EEA02099BB5AE6D456
|
||||
21: 41C20EF2D199B6C0FAD9DA02DA0296D37B23059C3A, 062AE92091F7A8CF74A8E9DAFC58BEDE
|
||||
22: 402912121F84EDB82F101195A68EF214F0A8F4DA6DC0, B35C944A4E5BA8AB60A4415B5BDF6E30
|
||||
23: 4D3F14438904F8F4F911CE729B26415F4EF819F80D2254, 2304E0373E136010B9BC6E061660D881
|
||||
24: A855C170C1E2D326D74996939C48A85EDEED2E06F97BE61A, E66F188735CDBD27F6354C260A4796BA
|
||||
25: F882B023A3B25B878073DF739A234256E4174238A30A5B5062, 3C8BEBFA98ABF880891AF2539D3A0FCF
|
||||
26: C66F850279CD23D5243CF15E6084A17C124DDDE840DFD9532954, 003202A7E393626BFF93D48207E7DE39
|
||||
27: BAC89C099A8AF633EFAFA496198DC9398DB3AAB47A8D24E2FE7D62, 32583F94ADE55278F2533ABE934CD535
|
||||
28: B9EB02F63EFB72455CFFA2799A5BFA9E0BFDE240379AA98B4D0532C8, 5D01FD2F100C003EA284A2AF55EE5934
|
||||
29: BAD5BB6B8DF316401B12B2BF36329F1D977E1FD943F594A6F4ED696194, 3D91CE3618998F3E060038D4DCAAD084
|
||||
30: 8964B7FAC865310E56DB3238E03803F3B79D095523D278D609AD34BA8B67, C57D3AA1FF71636CC7497DF3CB4F7B71
|
||||
31: F83C35D61E5C48CC7C402C9C78758D0DC696D2708FBC5294879DBF700BAF75, C69997844AB43312C90E995AD8C91E58
|
||||
32: 03CA8E42B89C0AEEF0B7A364E94E326C537AFC4392AED3E6DA71EE65032A5CDB, E8DCD9120DE61900A194E8B94AEF6B2B
|
||||
|
||||
CCM-camellia (16 byte key)
|
||||
0: , 3B53D5CC8B26A5FFC78D2E974E45A661
|
||||
1: 5B, ED7741D8C258D56A29392A7A65CF147D
|
||||
2: 9396, AEC9E6690624A94E9ED39A0507C32277
|
||||
3: 7D7DDB, E7D4B50F856F78EAFCCD6B91CA985AFE
|
||||
4: 1DE036A3, 4F519237C8534508140174DD3F5D5E10
|
||||
5: 9BD3C8B888, 760CADF4D2722C52BE28D89F9F1BEAAC
|
||||
6: CA4252105A3D, 675B4D6953136E0691C3FE174381C231
|
||||
7: EFF8ABC8F5CFA0, DDECDDF8FAE2BCAE971003D05A86024C
|
||||
8: D155E0590C4DC889, 08EFED0B6FA5C0EB64B7900229EA41DC
|
||||
9: 50AC40B4A083BEBF21, 14DABECF5CDBBB8F0AF3E7DDC034DAC6
|
||||
10: 1C5442AF9F2D491BE911, FD19818919D55FD80BCC9EBA0A108920
|
||||
11: 85A748561995A968CC9124, 69F769B8EA2BE927DADD209300752181
|
||||
12: 2F0838A1C593A629C1AE9032, 4C8AB614BCF4F7988EB4B93E1DC48EE2
|
||||
13: F19EE633F8B5E323904469D5C3, F82B28464B4BF73C39B332814E1672EF
|
||||
14: D6DBE7D82D4C99830FA1A6245125, 94D9EDF12A4A4EE357B647184EACC01B
|
||||
15: E8D02CBECEAD690DDFC1E48EE16B1F, 2D1355394CD62544D8840302715862D8
|
||||
16: 74C395F0C833ECB858F6D09C097192C4, 9079E949C4081B348259080AA0AAD85B
|
||||
17: ECB27927C303ABE439BCD9F9D4E87D5674, 726E8E755398A30E930F2159B510DD8B
|
||||
18: 86593B1148EF7D5B446AA3AD22001CB66CB5, 63B0D269B586B9C887584498FF61D8BA
|
||||
19: 0373123872929AAF354B085FCEAB74DD2D28E4, 5FE2491F2603E474D15500DB2E32481D
|
||||
20: 3EA3D8DC013F2A6E42BFCCEE51BBFCEDD194BA40, 5667BD5212E31F02C8D8B94FAB5A9DEF
|
||||
21: 5ACC89A28DB162595FD55D63ED2C5B48976E0BA0E9, A52EDC5A3AB7B070B755DBB008D99787
|
||||
22: 381266462C783DF3B5F3F3570611D6E0A61ABDFF7BA5, C79D371D81511D85D7B54B686AADFAFD
|
||||
23: 8819DDC964172B3BE049CCBABCF5AA7EDB50BD90E871F4, 45561AD598EB2DB8F7825878786B2CED
|
||||
24: F514E9F64E90197728E2D061443ED006F2CF2236EC2E65CF, 0C47214A73F6CEAEC1C96FE859C519E1
|
||||
25: 3B965F16101777CF84C85AD864701BCDD617681B92944386AD, ECBE6B6BA145D10FE0D5042A5F04BB68
|
||||
26: B573EB75A48CB8F56163A55DFB870017E06940D799ECCECE7C2C, 63A7C16D33F6ECA72B2B33C6FFF4F13D
|
||||
27: 47A3A96928BC9B28E22C3AF1999A30E271806BD3E6C8FAA4D82D62, 25E319011BA2F72BF7447C8EB36BBD01
|
||||
28: 0E873D38B34A0857FB82BF278AE07AEF9A4B378A8300CDD96C5BDE34, 6045114D75AE7681C91E5BC508E2398B
|
||||
29: FF33B9683538014DCF4F7D78CF7126FB43448BF9883D69B824019B05FB, 28AD47D363A7F9A4653C6685F90C2971
|
||||
30: 58005BF96E194411DF808DB3A6D405CA241986486160313AD092026A0A54, 7D8A8C8E8AB6ACE7312D82146219F37B
|
||||
31: 20C3DFE512F4EC1F17973BBB164E9F1B77CC3EB37B486119614764F4C7D0E2, 57CEB0625D34AD40935B03C54A1B8779
|
||||
32: 913F8D366D4C2AC10ACB3196CCBDB5F436CFA92377045EB3A1C066F6ED7DE0E9, F48C8BB647E719049DB38C39EF779CE2
|
||||
|
||||
|
||||
@@ -321,56 +321,56 @@ Key Size: 56 bytes
|
||||
|
||||
Cipher: xtea
|
||||
Key Size: 16 bytes
|
||||
0: 256004E1F55BC0C7
|
||||
1: 2D385C151A691C42
|
||||
2: F93BFEA758A7DDB4
|
||||
3: 2A905D97C0CA3E48
|
||||
4: 12C7C2787B913AE6
|
||||
5: FB24B1F32549EF59
|
||||
6: 2A8BFF867FB4FF73
|
||||
7: 5692243526C6BA77
|
||||
8: 4CD423ADFCDD1B6C
|
||||
9: 9B99AFC35EB2FED0
|
||||
10: 416B4AA4E07DA7F4
|
||||
11: 4DBC9052ABFF9510
|
||||
12: 8AF9457F8E599216
|
||||
13: BC3CA2B1C7267395
|
||||
14: E4BE31DF42282F7A
|
||||
15: B344CA8AA57E9E40
|
||||
16: 57A1F94CD2F4576D
|
||||
17: 96177FCD28BFF1BB
|
||||
18: 78A1F63A0EBAAC33
|
||||
19: 5F3FCBCD7442B617
|
||||
20: D6F7CD5ECA688967
|
||||
21: D92EDF70CBDE703F
|
||||
22: E2E2C2EE5D18E58E
|
||||
23: 4BF00478CB7833C3
|
||||
24: F9936D550815FE8F
|
||||
25: 19A3B07B3E47D7D8
|
||||
26: ACA441F099A7E30C
|
||||
27: F70183F199988E3F
|
||||
28: 0A41FC22F369310A
|
||||
29: ABFAF40853A4A38C
|
||||
30: 6B5D29DB1155D96B
|
||||
31: 0DD0C08A27561D66
|
||||
32: 4C56E22292F17AA3
|
||||
33: 3F925ED65613DF4A
|
||||
34: 521B4C97081DC901
|
||||
35: 2B1EC3E1C8CF84EC
|
||||
36: 2A412556F42A48F6
|
||||
37: 0A57B8A527DFE507
|
||||
38: EB55C9C157E3C922
|
||||
39: 6E6D6E9AB925ED92
|
||||
40: A4C5C90A0D4A8F16
|
||||
41: 7F9F9F658C427D55
|
||||
42: 9A5139994FF04C3F
|
||||
43: 9054771F027E29BC
|
||||
44: 90543E7BAED313BD
|
||||
45: 5DEC1EBE6A617D36
|
||||
46: 19AB6A708CDB9B2D
|
||||
47: BABB97BB5CF9D4E4
|
||||
48: 2C2ADC05AF255861
|
||||
49: 52266710153E3F7E
|
||||
0: FFC52D10A010010B
|
||||
1: 9CFB2B659387BC37
|
||||
2: 7067D153B259E0D6
|
||||
3: 0A1769C085DD67A9
|
||||
4: A9D781A1A7B4B292
|
||||
5: 6FEF8300DF395062
|
||||
6: A67B66CA99B9121C
|
||||
7: 006E657E1DAD46D3
|
||||
8: 2D63322467438A5B
|
||||
9: 4F67A826126BE01D
|
||||
10: 852C6FD597EBAB00
|
||||
11: F8DD14F59FF44A20
|
||||
12: CD4DC4E92B5CD40B
|
||||
13: 802B89A3EFB75810
|
||||
14: CCA7D920F69A5491
|
||||
15: 0DFF98CA4F71CA0E
|
||||
16: 80118F2AE4E83DE8
|
||||
17: CD6935285D45D83C
|
||||
18: 47B4613483889187
|
||||
19: 87F3F1975B8618E3
|
||||
20: 49BF15EF40C72DBA
|
||||
21: F850822AD58AD1CC
|
||||
22: 9701AD2EF51FD705
|
||||
23: 705AE7F6FD60420B
|
||||
24: E885CC84A9866B28
|
||||
25: 93E0D712D27E4E22
|
||||
26: 8C9CE43E517D3324
|
||||
27: 31004841AF51FB0E
|
||||
28: B250BEBF0E58457C
|
||||
29: 78290B6D83D442E9
|
||||
30: 3EC72388709CC6E2
|
||||
31: 099FB875AB5CA6EA
|
||||
32: B15E20B58F5E8DD0
|
||||
33: A41511E198E0B1E7
|
||||
34: B8B5CDD9607B6B40
|
||||
35: BEF9624E922DB8AC
|
||||
36: AF198FCD314D8DD4
|
||||
37: 1A37E433C261EF9D
|
||||
38: AB7895A2E9D41EE4
|
||||
39: 4C95BE8D34A7D75B
|
||||
40: 0D90A8EB03F2852E
|
||||
41: 9AAD1D630D835C67
|
||||
42: 6AD88003661B2C5E
|
||||
43: 4FA7E2CC53EBA728
|
||||
44: 862245D794441522
|
||||
45: FAB262C13D245B3E
|
||||
46: C0A29AA315A5721E
|
||||
47: F98617BBEFA6AD6A
|
||||
48: 6F84EAB462F10F36
|
||||
49: 30850051303CDB96
|
||||
|
||||
|
||||
Cipher: rc5
|
||||
@@ -1647,56 +1647,56 @@ Key Size: 16 bytes
|
||||
|
||||
Cipher: noekeon
|
||||
Key Size: 16 bytes
|
||||
0: 18A6ECE528AA797328B2C091A02F54C5
|
||||
1: 2A570E89CD8B7EEEE2C0249C8B68682E
|
||||
2: 828F4F6E3F3CB82EEEF26F37B26AEA78
|
||||
3: A3CA71833499F244BF26F487620266A4
|
||||
4: 333ACCE84B0A9DE91A22D1407F9DA83C
|
||||
5: 224285F3DB3D0D184D53F8FFDC8008D0
|
||||
6: DE39E2973025FE9EC1ACDE8F06985F91
|
||||
7: 2F00F45A01B1B0AA979E164DC5CCFE10
|
||||
8: 43775F3CBEE629EF6A9BA77CA36171D9
|
||||
9: 1E6A67ABF1B6ACF59FB484866AC15A86
|
||||
10: 70490989E2CD2145730921CCC37F0A17
|
||||
11: 67B0DD0EA903486B1CB56591FCF42678
|
||||
12: 774AAB71FF28E49A30E1E718D98114E8
|
||||
13: DF4797990E1C65C9F6735BD967164D45
|
||||
14: DE2779DF26FC1B99F576ED4CFBAE76CB
|
||||
15: A13AD17440641B3460A01175E3274AB9
|
||||
16: 1166499165F2A1196CA2DB831F264E77
|
||||
17: 35D24A385416CF2A44AB97A4AEC45E14
|
||||
18: D3D0E0DC962B1AD1AED92F57129088B2
|
||||
19: 00EF3E246B32634ABAF8BEE31D5C592A
|
||||
20: 79BBF3F807675B9F264BABC67DF4C2AB
|
||||
21: F391F2D58F0998F24BC9E5FA75DB9E99
|
||||
22: 066EF13C2617E97E6015B86BA1E059B2
|
||||
23: 5B0E2D7AE1E2734B9D5734C87F7BE272
|
||||
24: CDF7020212B7CF21F4817829386A6F8E
|
||||
25: 24873E1A0EF4908DF85114ED9BDB0168
|
||||
26: 99904360C843472F71AB86B26DC78A00
|
||||
27: BEE70B3735A67268578FF107C328940B
|
||||
28: 97DBB283536BC8AE8DBF56F3474C7740
|
||||
29: 2F4C903975EF709E004D24DC132A8A51
|
||||
30: 3EF0859A281782F905198C607FBE5C43
|
||||
31: 2D9CD48BC6A99E86468CBDD2A55C7D5F
|
||||
32: 5518D3ED18D5E5A62752CDF0846D0C77
|
||||
33: F751E9CAF107BAD8A1F1F9C374277A6A
|
||||
34: C5BA4DE907C41221FBABC5EC43710D0C
|
||||
35: 5CA48836330870365A10E7B676695C9D
|
||||
36: 937A964E0EA4D246E97293375B167EFD
|
||||
37: C0A876CB6957717541A90CCCB034BFB8
|
||||
38: A57C93A09F9160A28D3D4DEDC987746C
|
||||
39: 1FFA1E0B5EE0F0A18425F62717254419
|
||||
40: 8411C87262AE482CFC43C3092BEAFD90
|
||||
41: 0B9BB379FB3587A9ACEEED4771D8DC20
|
||||
42: 3B32EDBF9557E1DFBCEEC269B51FA494
|
||||
43: D1104E2888679A9EF6A13AE00ED7E1FB
|
||||
44: 0EC9849BAD58A279B42B5BA629B0045B
|
||||
45: CF206E8D3399918E75DE4765DD743060
|
||||
46: 55CCEB28E27D4DC7CE2546454FFD2C33
|
||||
47: 6E2339281583420B76E1750D35296C12
|
||||
48: 7800EC3D8C344BE7F2D2812F5AFF3DA4
|
||||
49: B80F4B0BDAA54A04D5A26BCA185F4EA2
|
||||
0: 22C082F55D7F6D861B11C36911BE694F
|
||||
1: 0485388F24B147918116347E942BCF4A
|
||||
2: 47388A4B060617B21134D3B4EB1CABCA
|
||||
3: AA8866CFB9D7507CC67A7F271AEF11E0
|
||||
4: F6A078AEF1BDF8B621A76CB732804FF3
|
||||
5: 8301F76E39A4E8C8AC38A7751B26DD31
|
||||
6: 5BE06821E7B23277B808143F36BABDE0
|
||||
7: E326A3A32F4F0D8A4FA94877997DA11B
|
||||
8: 2BA7773B55F90B5399C11EA80D6CADEF
|
||||
9: E64776D92B81770E51E4E2F44688A59D
|
||||
10: E987ED52D4C33B2668BB9DCF0889D5AB
|
||||
11: 351F5BC075D06BC6977D31A442CCC2B6
|
||||
12: 645468E2497FA5EB913C04032457C1DF
|
||||
13: 10CFDBEC689B01FB969AA2C760F76CCB
|
||||
14: 0BC5B171A3B727B9594238EC522F72F0
|
||||
15: 887D105D54D8EAABABC892F04F3455C0
|
||||
16: 53CC30B5F16713AC77205B0F194FED59
|
||||
17: CD63AD99CC0D5F34D67C363F99F7CF1E
|
||||
18: 59BE7B22114383FE8491304FB291D2BC
|
||||
19: 4B107C8D37CD46EF1DB68ECF4588FEF3
|
||||
20: 46034C755D278E368305D1133BA6B4FA
|
||||
21: E2472AC6D4048AB59E126930F6476D06
|
||||
22: 821014CDA5084A85058F1D556854D33D
|
||||
23: F67C3FB5CB1271B454810FEE632F7EE8
|
||||
24: 57705CB352AF1A8B342E1E555C9DAEAA
|
||||
25: 72AB36C1A8D3C2111330D0EF78726227
|
||||
26: 1931783D7E3DD6A33962BAD6962D8A33
|
||||
27: 06029A07CA801027D97BFAFF4719FB89
|
||||
28: D78B7E4E3083A60610C42BFC03810590
|
||||
29: 3CA3B14C5741A43F1FF5AF2179684DBA
|
||||
30: D1BCC52AE476999E25391E7FFDC59C81
|
||||
31: 1E102DBAA4224ED5E32515A59A07EDAA
|
||||
32: 81BE227D2663DBB733F9CB5018AED67C
|
||||
33: 92C5A77D5D62A16C031DA0BD968FBAC0
|
||||
34: 9EC8E61B543BE73AAD711A9F58C86790
|
||||
35: B6A1FD059A7D8D73C143C17D97E4C177
|
||||
36: 0316ED78EA520EE98BB568413A390E44
|
||||
37: BEFEE68550E2FAFC4AECBE309031BEFD
|
||||
38: D394CBCC38A47482B2B6900BD68D6540
|
||||
39: C58F2EE6C493BD1EB41DEB88A169D240
|
||||
40: 0A45FFA6D6E888B1F6E95E388818C6AE
|
||||
41: 8A9CAD2C511F284CE1D77167E5D23456
|
||||
42: 577CB9155A69CA34213FFD15E03D54F4
|
||||
43: 2AB7DD760EB7DDDD3883A6966B9D44D2
|
||||
44: 4564DC5318B0A940CBBC3C1607804B70
|
||||
45: 0E9F42D9C2AC03694CC2E82BA3C4BBBF
|
||||
46: A49089D9FD9E13DF35B0490E59A9B7C9
|
||||
47: D58B3008003D6C8D556D7D76180691FF
|
||||
48: 1FBC6D5F3F1B0E599DED48FF7A63CB76
|
||||
49: 077533478FABE8AD5DC2B9E96E7CC6CB
|
||||
|
||||
|
||||
Cipher: skipjack
|
||||
@@ -1965,3 +1965,323 @@ Key Size: 16 bytes
|
||||
49: 0133E1745856C44C
|
||||
|
||||
|
||||
Cipher: seed
|
||||
Key Size: 16 bytes
|
||||
0: A6E8D7325BBE0998CF235C1B57E64360
|
||||
1: 83A2EB0094D1CF95E683DE8BA93DE478
|
||||
2: 3DF178E121DA1CDB77ACFB37F9499A3B
|
||||
3: 785A1D88210885D6D2D84C2CB4461D57
|
||||
4: 4F177E4C76F6CA9C989E724A0EC275F4
|
||||
5: 3AC502689139EC1AFA7EDCDB622A6061
|
||||
6: E1B9675AEFFE45A249644E7E0863110D
|
||||
7: C8A4294FF821E88EC5D181E54BBD3919
|
||||
8: 7598C35780522C63B531758F53B7CCCE
|
||||
9: 3E59799FC5A5F99100A3791F6AA284EA
|
||||
10: A8572971F5FC281E7617BCB8D616FAD3
|
||||
11: 3C5DCA82BA53DAC088D34E6C4D069E22
|
||||
12: 0886C2F45E358409230F6FA0F4ADB7BF
|
||||
13: F4BF0388027AFBADEB6AD1AD0AC9339E
|
||||
14: 587F60852DA55F76C486D9A6BA884F8A
|
||||
15: A6F2518AD3B9A68C3FB8847E28B15212
|
||||
16: 6B6DB6C7085FEF6FD2BF32CAA2FEC2E2
|
||||
17: 40FF5FC134BC3911614A4E021254EFDF
|
||||
18: 9B1016CD948F70B8A04D2604D4FF08AD
|
||||
19: FBB86D1B49204838C7D544C8BAAE61F9
|
||||
20: 02EDFBE9A9A4CA2206CF9047FF146949
|
||||
21: 6B9FF89C1E607E494204B28D4391ED35
|
||||
22: BB85B8BAA9A4B74ED66C7485415834A0
|
||||
23: A6F72520E6F0248D88AFDBDA7CBDD6FE
|
||||
24: 4BC1D4E990FC80E9ABF9E0FBC745E2D4
|
||||
25: 0358D44D7A59743AAF6D25CA179FB6FE
|
||||
26: 320924C80B53E406DE45D31AB0E265F3
|
||||
27: B727A4AB9E8455EF11B18F300E22ADED
|
||||
28: DCB6BEF8F35FFA2F2CDADAE161E56D48
|
||||
29: 847A39F0670E930BF7899656908C2B92
|
||||
30: B5223282B9328ACC4C6BF06F15C920EB
|
||||
31: C265081FC225CA4ED28FABBF0BBB0298
|
||||
32: 35F6113CEA7C15DB21223D5AB0E9E558
|
||||
33: 3437EECD2984AADC9F07286CC23FB940
|
||||
34: D0C878AC8C01BB9868B499691373988A
|
||||
35: 684381B5D98E9D1290AF5D633A903F68
|
||||
36: 69652249BD52F49ED11219881059ED38
|
||||
37: 08DD215881D98B1D8234FA1806E634FF
|
||||
38: BFA836EB71C35B3E3CC9BFE9168D1B5F
|
||||
39: 238BDB3340961C47A13F011AAB45FC5A
|
||||
40: F55C630CE6008E7F15EA1686D887DEA4
|
||||
41: B78DED6C49E3167CD7ACF2CCB4E365DC
|
||||
42: 79990527F22373B043039F18E343A8B7
|
||||
43: ACD08505E2759003C016F6E820DDC562
|
||||
44: 8DB7189177EF39A7A969F28B882CFF05
|
||||
45: EC0BEA22AE28469B91AAD4654858367E
|
||||
46: 19A7F32CBCB4CE89163EC6F98FACFF36
|
||||
47: 3747F9C67FA044D52C3893D170DEC4A9
|
||||
48: DE799E6986BB77CA5C24F9A956BC28E4
|
||||
49: AD4CEBB75177F1CBD6FCEBF8457F85D2
|
||||
|
||||
|
||||
Cipher: kasumi
|
||||
Key Size: 16 bytes
|
||||
0: BB6B2E0C88AD7C37
|
||||
1: 5AFA50CBEF3FD5A4
|
||||
2: 1914DFD8DD86C361
|
||||
3: 0976E7F6AEBFFEDF
|
||||
4: DE0EF590AEC61F17
|
||||
5: 089FA192859E6124
|
||||
6: 72E283C82D366B51
|
||||
7: 61DA033662AF0B74
|
||||
8: C4CFA2C3ECA84CEA
|
||||
9: 15757205BAAC8639
|
||||
10: 4349914688A6A850
|
||||
11: 4B1F5E0D5B7ABBDF
|
||||
12: 5482444DC8815041
|
||||
13: A8C198FB1D865A93
|
||||
14: C2641B2501AB6525
|
||||
15: FE492BE02E717496
|
||||
16: 03B3034E3A26006D
|
||||
17: 0CB4B7FBA4582D1B
|
||||
18: A61C750E5DFF1791
|
||||
19: AD5374F2B0860365
|
||||
20: CBC588879F98A820
|
||||
21: 04CA5EABB466C1C1
|
||||
22: F4DF5CEDAE6C0E17
|
||||
23: 6133AAD21D875DBB
|
||||
24: D386BCFA19FAA860
|
||||
25: 68C9ED9206F07F47
|
||||
26: 00A49444A0C176CC
|
||||
27: 4BEA00D55452196A
|
||||
28: A9A3FAC7A2D553A3
|
||||
29: BE61DDF4CFA8EC8E
|
||||
30: B1547D01A23C2632
|
||||
31: 400604E71F3F85AC
|
||||
32: 8F431BCB447A132D
|
||||
33: 0ED503EBD61D4286
|
||||
34: DF7B087B7D315E2C
|
||||
35: 247A7872587F0507
|
||||
36: 7814D6B13A08CA60
|
||||
37: ADE44D69362B8199
|
||||
38: 49FF8C275D50A175
|
||||
39: 5DAC0F53391421C5
|
||||
40: B1C316E682E4F314
|
||||
41: 72FFFEA2DFD85E08
|
||||
42: 0418F02B7A89FC43
|
||||
43: 12826A96C5633C97
|
||||
44: A4726DA149DBFED1
|
||||
45: 5B276374E1EFC6CF
|
||||
46: A91C4E4804D9A103
|
||||
47: 7A2894030C9FE01E
|
||||
48: 0C59C6FA87DF2DCD
|
||||
49: A86C6D3C7EAE644D
|
||||
|
||||
|
||||
Cipher: multi2
|
||||
Key Size: 40 bytes
|
||||
0: A69A64BE9EAF56FC
|
||||
1: A8AB26A19D7804C6
|
||||
2: D5468EF0C9CDF530
|
||||
3: 2D08D23459949175
|
||||
4: EE66EB212BEC593C
|
||||
5: A2D088F95C855F60
|
||||
6: C206004787FEECEE
|
||||
7: E4875B7BE2C819B2
|
||||
8: FBC692536393F8C5
|
||||
9: 886DB391EE3BA443
|
||||
10: F45359B08EFC56FF
|
||||
11: 1113E4F4A177E1DC
|
||||
12: 8A02560CAD0CCF87
|
||||
13: CF57FF05E6BB7A67
|
||||
14: 21F4EDCF8E8A3D9D
|
||||
15: 26A26EEFDF51B7F6
|
||||
16: E9AF9D2EF2A9EE4A
|
||||
17: 6866182BC49D09D7
|
||||
18: 657E0D732BD7B5CF
|
||||
19: EFCC33778BC265AE
|
||||
20: 3556CD607D59C32B
|
||||
21: A7477466892D114F
|
||||
22: E210A7B32E9A2E08
|
||||
23: 9EBC0B60EB1FEA70
|
||||
24: C1E8C3A38E0063B9
|
||||
25: 3C9FC4089F87B0D6
|
||||
26: 100EA58D00F38495
|
||||
27: 3BB3D47D52A81774
|
||||
28: F1FA3DE89274A681
|
||||
29: 18DF1E38CC0C5230
|
||||
30: C3FDCDD9159B0258
|
||||
31: EA6ADFAF7D8D3C87
|
||||
32: FC4C369E7835461A
|
||||
33: 791D1D34EBEF801B
|
||||
34: 3B5A5B64C72B2F77
|
||||
35: 55ECED8C5D0F69FC
|
||||
36: A6DE960F4B81C114
|
||||
37: 3C4EDB0671BFFC57
|
||||
38: C493186F4BF52F5D
|
||||
39: 01B2C607B2329E87
|
||||
40: 109035510A1AEB20
|
||||
41: 0EA4699CA4A161FC
|
||||
42: 182665FBB15EBD34
|
||||
43: 04458216DCB8F55F
|
||||
44: 850BD374C892FC07
|
||||
45: 4C428488381D6FD0
|
||||
46: 56FF4CE0AA4132D9
|
||||
47: 9F95F0A47D70A317
|
||||
48: E12CC913356EFF86
|
||||
49: 7E614927A295C45B
|
||||
|
||||
|
||||
Cipher: camellia
|
||||
Key Size: 16 bytes
|
||||
0: ED18D83F3153160C5A6D01AC3717515C
|
||||
1: 1012886CCDF3FFD25E588BA10D6CE363
|
||||
2: D25562F6943EBE3A7E0EF28D33CF091E
|
||||
3: C26FDC4539DD1E6D0330B5836AB24420
|
||||
4: E14A50CE727B74B8CEBEB284FEF3C810
|
||||
5: AABFD72D334F594344C617EF8E8F5741
|
||||
6: E8D941419ABE88060835E9BD375455BB
|
||||
7: ED863784E1590139A2CA50D77450300A
|
||||
8: 545FCF42030BD764724C3EF5C139B038
|
||||
9: 08C194E007FAA99997D855A759D10743
|
||||
10: 3899D3731500C79D2945AFC2980B4C17
|
||||
11: 2720FA4B402AB7F1B019AF6248702369
|
||||
12: 3FF6C3C90AB4141DEE5FF30EA2047F73
|
||||
13: BB5BAF7545AA774C7AA5A58568F96832
|
||||
14: 66349C52709EDE0EE34AB6501B420C7C
|
||||
15: E1E93D923504A5421BAEA5F1D61D4C9A
|
||||
16: 3C07DFD64B2407BB7575A905F3F31E83
|
||||
17: 0FC569AC89ED790F69BBD1E998700C97
|
||||
18: 6B6F390AFA1052BD2E8DB0DC261E4D26
|
||||
19: CBEA83ED55DA9DED95B87F2BBBEAC37D
|
||||
20: CE005DECECB98F5937D5ED26FD83154E
|
||||
21: 738301D76316EC4173F124A9C9D6577A
|
||||
22: D00A1E40CFB5F2B8FD2C0714580FAD50
|
||||
23: 7EBF497C78B72E646EB72A326F1D5C4B
|
||||
24: 7E0023900F6000D00737242DA8F2E1B1
|
||||
25: 0F7737E715BEF0DEA503E355394540A9
|
||||
26: 15452DD70DEBF45BEF39782CDB8BB086
|
||||
27: E7464917B3AF060BC763D8959DDF90C1
|
||||
28: CBE4B90FF8C66672122D53585198773B
|
||||
29: B7262E6CAA2C14B18EE374DF922CDB98
|
||||
30: 01E695E3CD87A2FD4B9C49D08D032DAD
|
||||
31: AA1686BA0B5C5688D0F370C6E2BFA43C
|
||||
32: 9448BA348E8E904992C3F4233C226B22
|
||||
33: A1DCD1CB810DFB46BDCE6FBE3A192560
|
||||
34: 4345D200A309FA8C5A0CE9EC60EE506C
|
||||
35: 54C7F64D9B411BF90B283ED62686D28F
|
||||
36: E347E882EC2635081547612B1D9589D1
|
||||
37: 36D44CC101B37BB6F6AF68C3FEA3A7B7
|
||||
38: F38C2D5B921965D2AFFDBF4EC5BCEC19
|
||||
39: F7ED6BF85782F0526301BD1CD1624E67
|
||||
40: 7959C134BFC85CA176550EA689F81054
|
||||
41: A8FC96504C437F0EFD0BDF6CCEF516D2
|
||||
42: 6B88D1A06D7C8C74379FEFE2D6A7C895
|
||||
43: 39C21AA165F4A71A161971D89CA5DC32
|
||||
44: CC123C40071BF02D282DC83D2AC18226
|
||||
45: 0780A63741AE47CD03FA99A74C320E33
|
||||
46: DFB0831BA27AA0750701439603B8A805
|
||||
47: 0C783CBA4ECD9EEE1F91838259831187
|
||||
48: 1456624438B22555B08D59CA50D6E95D
|
||||
49: D5F463D983A9A6FE9A0B47C245596D40
|
||||
|
||||
Key Size: 24 bytes
|
||||
0: 1D1DAF85EA5CAE19F5F5EA1DC61E5B83
|
||||
1: DDAC7FCF2C2F275C7041E7821AAC84A3
|
||||
2: 591091C3755816AAEB9170D5DF77A0B3
|
||||
3: C4BC965CDC20E6FC039F07DA2CD10BE3
|
||||
4: CD8DA54FC48524EDCFEF985C0C39C961
|
||||
5: 14FA12F39AC3D701A958765B4499FFAC
|
||||
6: 2BBEA5F3AA140CFFED9F1EB2BC969D56
|
||||
7: 5F73CA8BF641770D6833A43947D9A5C3
|
||||
8: 3E872D303B882284AB02393D43137450
|
||||
9: 01EF55D4CE182FA03216A83A5128F761
|
||||
10: 915C2F5793692A6D118D865783317C58
|
||||
11: 4368A442B61D6F12D5447F1CB8854714
|
||||
12: 3477ECB27ECFF2D7108ED1297DE80F86
|
||||
13: 89C875CB55C1CE80FF2D430921FADB05
|
||||
14: C5AAFE7A4588D4D9039E4552B3FC9B02
|
||||
15: BF1E7509405AB219B540BDD0D3DE7528
|
||||
16: 7E5CC85B6563099B902638B7E0D09728
|
||||
17: FF04D2350647F117F81DA037A9E11946
|
||||
18: EA294A53395A20B391B11AB9F97262F3
|
||||
19: 448C801307E9405F740623BA55A45639
|
||||
20: 62032AE6EB01322233FB321B2D6A8C38
|
||||
21: 79A54FFB9CA25AE315BA0E7B6E59EA99
|
||||
22: EDE7E634C396926876A49DB3C0E261E1
|
||||
23: E9DA5106B8BD33391C28407E9B3758BD
|
||||
24: D8EAF9F744E060695AD1F55F85AF3D76
|
||||
25: F1E61F0F467C0785B6053332129114EA
|
||||
26: 3119CACB24B012F3B96EFAD3FB856AFB
|
||||
27: 97753ACDAFD6224E5D289BF76673A73A
|
||||
28: 8D5912FFFD628736C64B3DE01DF1E674
|
||||
29: 8951CEDB758DF5EA5D2A78B2A08480EE
|
||||
30: 3C0FC9DFD8CF79A5F9F75CC43B1A9247
|
||||
31: 4C7047481FE0849EA0416BDC00A52321
|
||||
32: 97034388AE8553570366EDFB9F6D618F
|
||||
33: F16BCC0FB2B77CCBDC5EF7AB2233599D
|
||||
34: 6D94D041196F43F0224B1DAC84165E7C
|
||||
35: 313C6BA0AD767259860DCF8003F2F5A2
|
||||
36: C5F835DCF63D1C40E56DBAC7ADCE7F3C
|
||||
37: DAFAFF6BB46EA9280562E5DDFA793BA8
|
||||
38: 5C8C0570B06C595E296DD4A9FB864FCE
|
||||
39: 72B433F78D7CA638C2ADA09D99CFB769
|
||||
40: B6D7A6C47339743E9739D35D0F08A25D
|
||||
41: 6CFD73F9E9781FFCE53C69AD2EF11E03
|
||||
42: B7F0BA994EF90642B80FDD798666D752
|
||||
43: DD49766125316ED4F546B246A2CFA23A
|
||||
44: 8ED53D6CEF3CFB9DB0147F02656EDA35
|
||||
45: 95690401D61C84A013EC6D25CCAC5CD1
|
||||
46: 7693648B4A6CA804B6F01AE67816746C
|
||||
47: F08C5898CE7970C41A5F8C05882CAB8B
|
||||
48: 91EC0EC1CF839B58009E6CAAB3FD67A0
|
||||
49: 853DFA14A029EB8FB8D693B0A65306A1
|
||||
|
||||
Key Size: 32 bytes
|
||||
0: 5F77DC44E5E6701E8755C1FA176E2434
|
||||
1: 5C1F70FC144C66D82D8F21DD2A0BA54E
|
||||
2: A98317BC656475F83E83062A69A17EF6
|
||||
3: D5B8C0DB1095E65D49CEC82D78FD4C7E
|
||||
4: 37A537292409ABE5B922DD97EC0F6CA4
|
||||
5: C7FD40883DE6BBC6059327DA586AD96E
|
||||
6: F4D19C443A2195B66085DACA7EFFDADF
|
||||
7: 6F12FD74B4D25C9F2856CAA1BA32461E
|
||||
8: DFC00046F41BC27684321B980BF68F6E
|
||||
9: 4A8BECB6A8D57002FCC6FE08B6D31118
|
||||
10: 859562FB3727E535BD4A914907822545
|
||||
11: EBA65EA3BD622DC044CA5384E568C65F
|
||||
12: 79C16A751FBE22340F30462600724324
|
||||
13: 8F4FB71B5B3E0C1DB870B4BC81E995D0
|
||||
14: 4B82E7E8D64D8EF9D78DA944B292CED9
|
||||
15: D873F8D7125A63EBB04473F7331B1975
|
||||
16: 2FA25AF9E8D5A4DC82CAD98505E5DA60
|
||||
17: C80C24625096E6E9852A6F9EE12735BB
|
||||
18: 10D4434CB795DC06E926CFA3B43D2368
|
||||
19: 070795AEA2765A443213F9CA909DF6C4
|
||||
20: 7184D2F5644306FB6DD55F1C90C111CA
|
||||
21: F4FAEDF12FB40DE7CE7B08121A340557
|
||||
22: 86CE014AA863FD3030A26E6F8C178673
|
||||
23: 5A46BF2B3F14D5FEA884C3361EA87ED3
|
||||
24: 456584515D983D17ED4F3AE944BFB2C4
|
||||
25: E1E8F394691C2A9123023A8EE3FCBBEF
|
||||
26: AC73E8BD1758850DEDAA3817B01E6353
|
||||
27: 15AE5395CBC3371F81A6F5B05C52671F
|
||||
28: F15AA72D34C4E0EEF8DDDDA90D9A9539
|
||||
29: 3325E709043735898EA242E94D169112
|
||||
30: 044AB447754DADD4E2709FEE08D5CEA2
|
||||
31: E02DD5E86D32B3A6CC7F0016375AEC5F
|
||||
32: 790278BD19E2860618E24DC69993F92B
|
||||
33: F776D24FD90A43A78D000CFC1189E56A
|
||||
34: A3EE4A3D121280750F7C70E55DD40FF4
|
||||
35: 32928BBBF98DF4B9E107599DFB30364F
|
||||
36: B3E9296B529118B656D27AFF0F4D1A55
|
||||
37: 4668FD77100255C3406281EC813719AE
|
||||
38: 16F9FF27B26F13300DB8DEE2EDD023AA
|
||||
39: 9295F8435D688D12BE631A31B2531482
|
||||
40: D86917DF41ED4342C0ABF10628DBD1B4
|
||||
41: 1F5215B987C3F079769292E65D04B823
|
||||
42: F68B98BD2F12AACEBE78666AA83CA7D0
|
||||
43: 09BB635B67279F5A6B1D5C5D880A1357
|
||||
44: AE4ABBCC1D35CD8C4C254111D5F27158
|
||||
45: 5552B3E39DE67F759799A686222EE4EC
|
||||
46: 1CA439434B9FD2F24561A32A0A2A79C5
|
||||
47: 0E33BE7CE3B9A5CFF00A73BD27DFE9EF
|
||||
48: 6B7056FDC97983173D6B3D5BFC9B09B8
|
||||
49: DA293A4CB96FE3608CFFD89B927C9ED6
|
||||
|
||||
|
||||
|
||||
@@ -57,23 +57,23 @@ EAX-blowfish (8 byte key)
|
||||
16: 60A315193F58144F5701D547C79FEEED, 912FDBDB05467DF5
|
||||
|
||||
EAX-xtea (16 byte key)
|
||||
0: , 86881D824E3BC561
|
||||
1: EE, 4C3505F04611D9C2
|
||||
2: 80C8, 6A3428BEEAD60738
|
||||
3: BF88E7, 04F1E99E9F5906C2
|
||||
4: E06574B7, 33B0153AAEF9776F
|
||||
5: 42D950AF63, 4A0F415640322FDF
|
||||
6: C30F6AD46EC9, 9646FE909D2B95CB
|
||||
7: A0049FCA856A14, A0257289C6BBF278
|
||||
8: 2814B0C1358440E0, C4B0A2354925E887
|
||||
9: BF4F062B52C1E489CF, B56442A3CA57A041
|
||||
10: 63DF433956831B8780FC, ADF9ED0B46DCA19E
|
||||
11: C317FD079817F50E0E8A16, 2EA0EC993FC603AE
|
||||
12: 2BD12FDDD81EB11660346D2A, FBC6F69125BBA88D
|
||||
13: 85D356536FE2843C6BBE60EDBC, BB2FEFD04F230E79
|
||||
14: 22493009DB01B4746F4927A8C4FB, 64CC08471D93C9AC
|
||||
15: C0F3C0DB08DC93FBA725D1E02DE084, 77B762213DDCCFFE
|
||||
16: 568B66D3112556BD98FF9339E9C002E5, C8355F508219FE0C
|
||||
0: , A04FAC8D0416F081
|
||||
1: 5E, F95DAA99F8FE28E9
|
||||
2: B6A7, E2A05E1F1E6D17B5
|
||||
3: 27D698, CCC0CC54F40DA243
|
||||
4: C2E81CCC, 283AB8F109D287ED
|
||||
5: 51B99DF694, A9637DB356B4BC0C
|
||||
6: C2ED3E79A4F2, 413D3A65FFE803BA
|
||||
7: 40E35BE6CA019C, 1B68833B90E4E026
|
||||
8: C246C2B5ACEBEB08, 50CFEB01DEC3BB1F
|
||||
9: 35E2F7AAB57842D50F, 617804483BFFCA9D
|
||||
10: 2F855AB7A4664958300D, 6F054767FE484664
|
||||
11: 2824A5486D1B621D0F992A, 238566B9F56ECAB1
|
||||
12: BF5C121A6144AA0CC05A380E, 63F4DA4B898FB2A8
|
||||
13: 2EB53E8A4698EDEBB990FC65E6, 7DFFE0E43187D10C
|
||||
14: 85F77FD150C6649F5826AD45D50D, AA660F37975768FC
|
||||
15: 8B4EB3750814EE7E8FC6B97B3ED1ED, F79545FB1F1C389B
|
||||
16: 980EB7FCEEE37558BEDA0E938325F608, 2FAA9235BFA3EA30
|
||||
|
||||
EAX-rc5 (8 byte key)
|
||||
0: , 169C7954341EF44D
|
||||
@@ -352,39 +352,39 @@ EAX-cast5 (8 byte key)
|
||||
16: 70CABBA983179106AE7FCD5F1F31D5C3, BF7F9168F4F82F56
|
||||
|
||||
EAX-noekeon (16 byte key)
|
||||
0: , 556805EEA595CFB9A30FAD196103D7FD
|
||||
1: F5, 0A7DAEDFB656526CEF4DDBA8087A227A
|
||||
2: 7B8C, 249895D79962D5B4D18FE07366281B72
|
||||
3: ACFF15, DCC489D24832EB106F576AE6B6EB957A
|
||||
4: 08ADE7DB, 0D3215999E9960EDAB29B78744C7F139
|
||||
5: 66139213F6, 505E1E7141D043E903C26EE0959EEECD
|
||||
6: 078B79F880A8, 35B7EB326A55E50332866EEDB682EC20
|
||||
7: 2809E34D9667D4, FFDEC555F68524A09A6ABACA372077D9
|
||||
8: 93D267DE1EC635D3, 4FF3561990A56E4B374618722EF850FF
|
||||
9: F377A4D93FF32F4A51, 91D4070423A90FC54D305169C03F49ED
|
||||
10: 6244B717E082993EB7A1, 2E3A8A354AFA9473667ED7FDD46BE9FC
|
||||
11: E917559625D25E6E5F2EDA, 19295C37A70314CC9A1D11FDE8D23C92
|
||||
12: 1E6DF2EE112A893AB14DFA92, 12C4A89D4CD65F8116A03A135AFD3701
|
||||
13: 47B18CD762E011770E203CF605, 434909A97E118B20D3AEDC79AFE33A9E
|
||||
14: 72D9A1A7DA6F33D5E0B927F9F32C, 779C23714FCAA2B2321EC7FB5B03E222
|
||||
15: DA8B830FFCB3DB274807F780D33240, EDC2F1C8A401F328A53392597730B007
|
||||
16: B53DD2BB840AD933D36A7B5FFDCCFBBB, 4EC0E6D1F916BF633869239B672B37A1
|
||||
17: 42936BB9A936C30408660855F4F47F3314, F0DAA6DDA15585E1697ABBB4790B15B5
|
||||
18: 00372E47F5BA016F1B2A1E680B76AB02052A, CDBF3D241BF7FF96D3DFBEDDB872E901
|
||||
19: 8AA236B0C8BEF6F67A97C2DF90628F6E5838FF, 731DCD61F7F26004C03519F9500EA824
|
||||
20: 55338647812FC9D86CBDDCED7120268A4D43F8BA, 0E61B3C835CAD95FD49FEF002C014E72
|
||||
21: 435820B28E52154B47A04D5E635D8FE37FA47FC985, F6A96DCE4917E8D7C610923627E80970
|
||||
22: 0D30C15B6FEB4A48B14DD15D41A4B25D442AA677B25C, 28E15CCB74AE992C68BDDC8D87802050
|
||||
23: D9D701F9AD6B0E13D2CDDA15A5194E7CE8BD2C02137391, 2DB9A15884E9C996C3D6B5BDA44B9598
|
||||
24: E2390AC5CE10CCFBC72106A52C7F180CB477E3C193CBACA8, 22D3F7DCD6947EA4E78DF57A8E1A9A59
|
||||
25: ADEFB7D9500658D34996AF6BE6336CD78891064EA1DB8E9785, F239D67D039A15C620A7CD4BE4796B3F
|
||||
26: 89964C90ABF54A6DF9F13C3681E70C702D80A17BE79F8160F30E, 6336F729ECE1ED7368669D75B7E2DCBA
|
||||
27: 576B2813CECDA4F905BD5D58349EF070FF41B7EB6BB2B01B061B0B, 125324CBF2ACF1011A44A99A11EC8AFC
|
||||
28: 430B957481748519A60494F0B5F698F34B1A8235B00AC0D1F0A4442E, 1E80A7FCEBBB8E1E12D6831906154485
|
||||
29: E781BFE5FCDE0BFC056CC86C4A0B9DD3B815BE8CA678204CF47289B5B5, 190D5AAA9EC1CB4CC86FACE53BF1201B
|
||||
30: 78BFAC07A9B7B2AE9329BF9F9BF18A1A49DD9587001EFCA00E9AD9752764, 4FB5ECBEEB0995C150EBC66508FA19C1
|
||||
31: 7D6C20694109DE21F7955855A8FF832347518DD496C2A114DF142C68ACDEAA, B25D4BB34056DC091A7A3950D46C32EC
|
||||
32: 3E1E4395DEC1AFEA9212B95F37E679B6E2D14DF23C5DE49018C2C8038CC4AD45, 9A6DE7BD41A21918AD504490EF4E581D
|
||||
0: , 5CB584CC68025F830B42371B9CCE99EB
|
||||
1: 65, 69D866C00E11E4311ADCD50AE2F91D03
|
||||
2: 80D2, DA0499598F478A7FF53324908EB4DC74
|
||||
3: 86EFB4, 7DC1556C65F9E7CF2E3A357B38E326D1
|
||||
4: 87387A77, 7B58F421766918A179A999520A6E3781
|
||||
5: D18B9788C6, 924A2FF178FD06BF292A605FCB27BDD9
|
||||
6: 0075EC03ECD1, 78F553564A25A574E6A4857778A2DB43
|
||||
7: 5BF96EC79C2E88, C49CBD1C4F631B35D5A3B764251870D2
|
||||
8: 70DF3B35F6D9B822, 42351BF5C947AF7A0E1F852199B5840C
|
||||
9: 2E53748525AF367861, 4986BC390AA0DA1E4E78CB2148A2C513
|
||||
10: 05DE8BAD8C975ACECF87, 1C0F1C18FB8682D76AF9E48D3547D88E
|
||||
11: 8B2B1D70F6A74059503F42, 839EE120ADC8BF08CD9A7DF6393D1E51
|
||||
12: 9D7F92F08953B5B300A7410E, 603A43432DAB26882797BB5AA7A75D28
|
||||
13: 4CA551DDB4BBCFA45BF71C49DA, D2743508826E3E39151F21C0AD81C8DC
|
||||
14: BAE72091E78013369AF5D0294AC6, 3F0D391BF01C3BA116A9CAF50DC28307
|
||||
15: B037AFB65588B95BC86E1430E0746A, 2399A4C31F55310AE2C4A2FE3379C74F
|
||||
16: 842F0B29888C43999545D29CFEFA58DD, 9B6E4FED2A6BE59DC2DFAB407D2FD124
|
||||
17: 86F7DA57E5C9DE9C88EFC1ED0CA61F76A4, E7278F365289FD0C484A166FA9EDB801
|
||||
18: CB94AD60C1FBDC9868DDE0D4674251A644B5, D857CE47FB963DFBE7983D183695803B
|
||||
19: 5A0B24FF167EB133808A3FBF89D9895F30BE1C, 488362E61725BE723CE892F550AF028A
|
||||
20: 60D43A8C29F1714588672847FA00DE771F2C3D36, 25D7CEF55A2A33953D9B7739F9C98C12
|
||||
21: CC47C891FAB841800F0AC0F746A257062BE9AF49F3, 220A3EE618FB735B9E801F9B3708D4FE
|
||||
22: C8E0F9AF7A7C62B6C297B16025DA55BAF5BA13F6ABA7, FA16192047892BC2472AF1DBD95E0D6F
|
||||
23: 731BDA5BEFCBA427E715839C21E4A176D0E28F042C3089, 4CBE4BB916EEE773B9299FE2FF0BBD81
|
||||
24: 62C5CD4F7EF81EA4E58847F3F715FA9E9EFB32059D70BA88, 090E92CEED8FB5D472CCDA11363FC904
|
||||
25: F7FD159377B130633F93B4D18BE68B0872905BDB205025E4FB, 6F335AB81AC8507D5F4018F86FB0230E
|
||||
26: DC374E5B40E8F4614C2BE685539C97825C7A972CA2BEFF338208, 719F6C042DB09A08C36D92810FCC29FD
|
||||
27: 1050C71D491237EF77F4F043D7EDCBD41DA0BC155F1CB65EAA1D5E, 44E7CD8CEB27584340270F3CADE1A083
|
||||
28: 8AE94A4FF500DC889436866D90B8E150B63EDE74074912029FF9C3A0, 3C96328BE53423BEB32FFE0D05F9B71A
|
||||
29: A801D1571411396C0727B132AEFE114D7BD486DA74C549E7661F2D8B87, DD6A443497AFC9EB14FE6EE9069AD580
|
||||
30: C79DFE19B0199768EFDD29026863C644A0ADBD14A3F3866DE74EE7AA2E0C, CCB313FE30CD4F04BB3548808FEBAE6E
|
||||
31: F658ECDD95F960D7C68D03F9BBADF066F8B9CE8108867C7DEA305FF4124AF2, 8AE64618E77A2806B53E239927787ACB
|
||||
32: C92EF301771E89D5BD3B901B380EBE18BD2A193B5989092006E7AC15345AFD34, B450AC584DF13D9C8BDD32DA686A1AF9
|
||||
|
||||
EAX-skipjack (10 byte key)
|
||||
0: , 85F74B6AFFB10ACD
|
||||
@@ -459,3 +459,111 @@ EAX-khazad (16 byte key)
|
||||
15: 14DA751E5AF7E01F35B3CE74EE1ACF, 3C76AB64E1724DCE
|
||||
16: A13BBC7E408D2C550634CBC64690B8FE, 3D4BBC0C76536730
|
||||
|
||||
EAX-seed (16 byte key)
|
||||
0: , 3D0715108CEA3BE144350082B1BC4F25
|
||||
1: EF, E56898AEDB0F461980587FFBDB83EE59
|
||||
2: 9552, 9647B7FCEDBB9EF4EDEBCD98831E5BDE
|
||||
3: 25DCD8, 3647D80EF3529C72F16D223D04D7ACAA
|
||||
4: 3D169011, 7A741FA2536E5905FD4ABAB104062D3B
|
||||
5: A92411F6BC, 18A306E5DBF4DBDCE21505F16DA85482
|
||||
6: 9D4661D2859F, 7B2FC34AB3DE45DB4AE8C97BF3B32BA9
|
||||
7: 0E8C26E24B0961, DFF098B44E7D57A71F68FD0D2D2416C7
|
||||
8: 485EE54D5D2684DF, C8FCF501065D23F936A4A530BB028EA0
|
||||
9: 768888B50865A635A2, 8121463B762AC12D19EE21C58A8A1B7B
|
||||
10: 647FF44F0B350385BF27, 883241565540347D491C0E397FF5D663
|
||||
11: FD868A569E2E597EB3B5AC, 4DE96B6810A1FC5F19A085B4F4C8B687
|
||||
12: 342D72063420F3FCFC1EF71F, 88B94C3FFD74F052CC44722B87E1A45D
|
||||
13: C768F88646D47D5201FDF47A1E, A01EB1FBB3AB135F258B87C30A8E1A13
|
||||
14: 44BF87EC9A5F5E20E5D972ECAE4C, 6F1C44EDB3533EFF973B53EAAF84D601
|
||||
15: FDE60E4F25C4B9388BD3D348912B7F, 863871D706A32F92DAD13803CF2008E1
|
||||
16: 69881E58AF690C5EEBC00DABDAAFBCA9, BD3911C5E41B327A10DC7D03435FB8AC
|
||||
17: 41AC0D70E8ECB01CFFFC9352E3800F568E, CCD63A0D20D0FD385EB720B2D60D20EF
|
||||
18: 88301B40FA8B84ECEE7238F17B08EC2A2DA3, AD10D120ABCCB67FD3F12C8D8BD216F7
|
||||
19: CCD0F8187B7455274D80A2387599617582B7C5, 3DAA6952A9AA160863E4F489AF04C6A5
|
||||
20: CB955D3B6044F1712DEDC65451E46B8D9FBE5067, D46FEEFA0A0069115F262877050265E9
|
||||
21: 373B8AD20672BEADE5B742C72306455549B26DB631, 16DC5FE5C7C0D5478FF67AD00463AEF1
|
||||
22: CAB49183077EB4DF3BFBF7FE026BCA8311A6BC067EDB, 8F4497F253167AB81A70A05218734C1F
|
||||
23: C2F860DA7EC7801FE30FF8C362EFA11E9392E029E24407, 1612D514BF9F365EB0E5CA13E974670D
|
||||
24: F0084F22D7AE598FF5DFEF76CCC0728325BB5D3DF5467B2F, 1DE5CD767D2B731DE4C9B4E303A7E771
|
||||
25: F5E907AC398B2C7BE124ACCAD1FEB001BC3EC7C77C21E94110, D8C7D50EFB0CCE2926DA9E796EA46E17
|
||||
26: D65A41B86D24C573D21EE416F2F853E8FF7A0788120102E8BABB, 3EEDB65BCF0E32C24B797D972913F943
|
||||
27: 3B39B9994248DD1FB3EFD68820D19E8436F66FF0E6D82F40E50AFF, 7892720F9AA0ABC34E05FD982396C13A
|
||||
28: 9B924A2F620E5160B8F6C8DD313F39D6DC22B7E0596C8D0BFCA14907, E417D1FE5569975E8698C4D80684A613
|
||||
29: 01068AA5F6FBFFDE1A8290CB315426F8CFD2438C09FD5982BE45EB21CC, A7DB568F037E8A4DB2D73CB2DF2BABA4
|
||||
30: D39210874C4B7BEB63966BDC89AC7279B67C118618E9C44C1C563A10F74B, FB64939029B8E5DC1318EBE3FDAFC9F6
|
||||
31: 8338B7BCA36C104C4B7EEBFF582FEAF879894FD6F00434859AD94E644BEC60, 93DECCE7AD61E69A2BD6621FEE2953D9
|
||||
32: 21DC38BE252ECCA74963965660C98B5D9B5C2411945D8AAF9EF93732748A6162, 2BBE555F1D3C94BC6F1665A6DEDB536C
|
||||
|
||||
EAX-kasumi (16 byte key)
|
||||
0: , 9E0C41B26B960E81
|
||||
1: 03, 26B904336B9E0BDA
|
||||
2: 9EB8, 18E90B52DB587A8B
|
||||
3: F8E4F4, 9842D0A42ACC7717
|
||||
4: B5688382, 2134820AF25CFFF5
|
||||
5: 582E9402B2, 9C0F60D5B2D4BEA8
|
||||
6: 836A3CEA4965, 6EB7565E0FF7FFCA
|
||||
7: 00DD66F0AB54AE, 0CAFA81DFB52F835
|
||||
8: F5824156469E77DA, 44AEED7DA55C7C2F
|
||||
9: FCED54C15FAE6EB601, 95D7A3592D5F3B0E
|
||||
10: 0630750CAF71D334562C, D8F7432F9AAEC624
|
||||
11: 25E3C5FAFE86F59D30BEDE, 42E3F6C3B8F73F64
|
||||
12: B98480D54E604E4CFB988EFB, 2BCA65A62CE3E363
|
||||
13: F07F1F98A2411749EA11FD87F2, EC7C07D37B7CC07C
|
||||
14: 19A6D648AD698ADED0AF37001479, F88417372E600717
|
||||
15: 17CE88FC64ED98233BBAB20AA4DA45, 4959410987AE317B
|
||||
16: 61EE83703D8CA5D652F8E1E83C86D58F, 57EC73A828C20B68
|
||||
|
||||
EAX-multi2 (40 byte key)
|
||||
0: , E3EB492A2A560816
|
||||
1: C6, E0A176A66E269255
|
||||
2: 1D00, 472E25EF8B4ED450
|
||||
3: 1DFE5A, BEDB3404162C7122
|
||||
4: 915B77D4, BABBB74A3EE61755
|
||||
5: 3C966136E8, 603664C04EF42178
|
||||
6: E4A4925C9F75, 41B77B32F28613DB
|
||||
7: 365BC4FEF0B1B0, BB09E42F396F3832
|
||||
8: FFCE6DA57D7FE9D1, C11BA7A7B580032C
|
||||
9: 0413506EE42819574C, 9B5C6A8111BE7B29
|
||||
10: 531319C06A4B68AE226C, 77BC1DF09414D212
|
||||
11: 85C0454EB3B9CDEDD32EF9, 39576F2268A59EF6
|
||||
12: 8FB1732015FD006D2FFA8D9C, F8F51511ECA4E0A7
|
||||
13: 1654F11C940FCBA529D2384A0D, 871B4541612C7CCE
|
||||
14: F119DC9F998D92B4C45185CFA2D1, B50D3A61F3CE76B0
|
||||
15: 05B051F7DA81609FAC41BF0A19C45A, DF1265F3F69625F5
|
||||
16: A313136E4E7F1314E7ED504B48324047, A9D1C5527D6EF7D7
|
||||
|
||||
EAX-camellia (16 byte key)
|
||||
0: , 9E8CDB7237166EF9FD0605A0AD3E4070
|
||||
1: 8A, 23F462AC7E22EB9078DAC34CB1CFFB08
|
||||
2: EC9D, EBA9E2E3112C18CC2991FFF97EF77E6F
|
||||
3: D2A9CF, 913472F45F6D6B087D8AEB34B0FF9494
|
||||
4: 360A7ECC, 6382103D53AB8C9263977AFB1A96AAC4
|
||||
5: 80B52AAFE6, F855787CD6CCA56CD656A0DBC663CAD1
|
||||
6: 0915D546F5F0, EBE17981CAB5D59E6376CFE30DE66936
|
||||
7: 086B525B082B71, 182D76F2DE42F5D0AC252F25E7BC34CA
|
||||
8: 438DA1E9E78B9D2E, 36BA12456C3AC5ED3A0BDF851A651E82
|
||||
9: 0F9C9890152D6AD5EC, 06F3A96F40D794552CA799006E76AE7A
|
||||
10: 7754241DCD040CC449EB, B576881B5E542A73717A6AC24E516079
|
||||
11: BB536F70C1111BFAC4D149, DDC6043F2B5DF96418799DD13BD04726
|
||||
12: 4B530B4F67376C4B7EC1CB29, 43A36C14092F19F168ADF0FD9F557424
|
||||
13: 55D5D285DC88451148C7B2B143, 7C2CB43BD19808EB90F045E6D6EB70D0
|
||||
14: B321948117659CB06E6B364D00A7, 1B30A37234E3A13A335EFE6A07B070DC
|
||||
15: BDCCAC5E956953E6D5C43D9436D453, 98F924C659F4112B1D9DAFFF711FB2F6
|
||||
16: E0A2F28186D79A9494700E5A30351542, C604F7F47C3F18F236DDB289D287BE91
|
||||
17: 750D6EF87E1C9E1023920D3F355B2BEED8, 96FEEAC4DA36FD36129F67C3EADA75EF
|
||||
18: E7F91687119D70793B9BB0114C7B588D32F0, A75052978F26EE6FE5D802BD4C06004D
|
||||
19: 56D7420981DC556AE0137DB0F1BD1CEC0BC945, CC024D30F19EAA3CDF66E51246FC3225
|
||||
20: F2D61A0E214472663F5F41C9D66EDEEC2F7C824A, 9706F273AF680AE2537D02BE41A2C980
|
||||
21: 30F76A83CF8010DF0F49F73C06435E0C5D85EDC6E3, 1F18354A73BF506D229369836855EFD5
|
||||
22: DB9688FB58EB83AF06A579CE56FBC75D93412790924C, C9DD5350751CFF0AB1A8910AC1898E08
|
||||
23: CBD64BAB16852F40FB00D9FEEF5365C773CA14B77EF5E2, D6A02105B1BD018A5BCF47A69803248D
|
||||
24: BDCE2AA8092D4790041750DC922F2D6AA12DB3F41A547C7E, 3DF09D758306DAE21C3AAAB3FC51623E
|
||||
25: FDFF0AFA4D94CB3019AB27234259ED225B1B3B0F2BDC32CDD0, D64E69725D638D9F0F90C44C6BF51722
|
||||
26: A9D2CC4F7FB98D54A78293C64C2A41CA19CC1F7B9970F3437AE9, BDFC6B10DD012BA057CCCD40AE14569B
|
||||
27: 81FE813C4A6A47D34F146DD943092940ECEA77F85339A219B6134D, 5F44590AE8CDF89E13AE2BE4D32AB7DB
|
||||
28: F618779FC6E6F5B7EE3FB4E937097E6A122B979E3DF837F72A8FA3B9, 00F0A3B4C67F68590AAA0BEF2D399D1F
|
||||
29: 0A8AB66D218268C9181DB8C6EF542AA4B42E53E4623E3385723024CC3A, F28D7D86317D2F509561DD3392F3EF3C
|
||||
30: 9CD50C94ED5391BED5C8CE2A07F8955744B275B6C5E5B6F453A5E6185C03, 048E889FF70729C55582003ED6169E0C
|
||||
31: 1CFD6D8EF6F44265703544AFEB2BBA2A067BE8DAB412E071B66B70E357238A, 0A5BB055E00D42F4291CAB3813FC2946
|
||||
32: 8E6E6433E4FF879155E0612F17EFC00AA8D5236EFAB5D9D6A912898F3124B588, EDF81BB73FF9288F315B988413432823
|
||||
|
||||
|
||||
249
libtomcrypt/notes/etc/NoekeonVects.java
Normal file
249
libtomcrypt/notes/etc/NoekeonVects.java
Normal file
@@ -0,0 +1,249 @@
|
||||
/*
|
||||
NoekeonVects.java - Generate Noekeon test vectors using BouncyCastle.
|
||||
|
||||
Written in 2011 by Patrick Pelletier <code@funwithsoftware.org>
|
||||
|
||||
To the extent possible under law, the author(s) have dedicated all
|
||||
copyright and related and neighboring rights to this software to
|
||||
the public domain worldwide. This software is distributed without
|
||||
any warranty.
|
||||
|
||||
This file is dedicated to the public domain with the CC0 Public Domain
|
||||
Dedication: http://creativecommons.org/publicdomain/zero/1.0/legalcode.txt
|
||||
|
||||
You may also consider this file to be covered by the WTFPL, as contained
|
||||
in the LibTomCrypt LICENSE file, if that makes you happier for some reason.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
This program was inspired by the comment in Botan 1.10.1's
|
||||
doc/examples/eax_test.cpp:
|
||||
|
||||
// Noekeon: unknown cause, though LTC's lone test vector does not
|
||||
// match Botan
|
||||
|
||||
So, I investigated the discrepancy by comparing them with a third
|
||||
implementation, BouncyCastle: http://www.bouncycastle.org/java.html
|
||||
|
||||
I determined that there are two reasons why LibTomCrypt's Noekeon does
|
||||
not match Botan:
|
||||
|
||||
1) Botan uses "indirect Noekeon" (with a key schedule), while
|
||||
LibTomCrypt and BouncyCastle both use "direct Noekeon" (without
|
||||
a key schedule). See slide 14 of
|
||||
http://gro.noekeon.org/Noekeon-slides.pdf
|
||||
|
||||
2) However, LibTomCrypt's direct Noekeon still does not match
|
||||
BouncyCastle's direct Noekeon. This is because of a bug in
|
||||
LibTomCrypt's PI1 and PI2 functions:
|
||||
https://github.com/libtom/libtomcrypt/issues/5
|
||||
|
||||
This program uses BouncyCastle to produce test vectors which are
|
||||
suitable for Botan (by explicitly scheduling the key, thus
|
||||
building indirect Noekeon out of BouncyCastle's direct Noekeon),
|
||||
and also produces test vectors which would be suitable for
|
||||
LibTomCrypt (direct Noekeon) once its PI1 and PI2 functions are
|
||||
fixed to match the Noekeon specification.
|
||||
|
||||
Although this program uses a PRNG from BouncyCastle to generate
|
||||
data for the test vectors, it uses a fixed seed and thus will
|
||||
produce the same output every time it is run.
|
||||
*/
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Locale;
|
||||
import org.bouncycastle.crypto.digests.RIPEMD128Digest;
|
||||
import org.bouncycastle.crypto.engines.NoekeonEngine;
|
||||
import org.bouncycastle.crypto.modes.EAXBlockCipher;
|
||||
import org.bouncycastle.crypto.params.AEADParameters;
|
||||
import org.bouncycastle.crypto.params.KeyParameter;
|
||||
import org.bouncycastle.crypto.prng.DigestRandomGenerator;
|
||||
import org.bouncycastle.util.encoders.HexEncoder;
|
||||
|
||||
public class NoekeonVects
|
||||
{
|
||||
private final DigestRandomGenerator r =
|
||||
new DigestRandomGenerator(new RIPEMD128Digest());
|
||||
|
||||
private final HexEncoder h = new HexEncoder();
|
||||
|
||||
private final NoekeonEngine noekeon = new NoekeonEngine();
|
||||
|
||||
private final KeyParameter null_key = new KeyParameter(new byte[16]);
|
||||
|
||||
private final boolean schedule_key;
|
||||
|
||||
private final boolean botan_format;
|
||||
|
||||
private byte[] randomBytes(int n)
|
||||
{
|
||||
byte[] b = new byte[n];
|
||||
r.nextBytes(b);
|
||||
return b;
|
||||
}
|
||||
|
||||
private void hexOut(byte[] b) throws IOException
|
||||
{
|
||||
// HexEncoder uses lowercase, and Botan's test vectors must
|
||||
// be in uppercase, so...
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
h.encode(b, 0, b.length, os);
|
||||
String s = os.toString("US-ASCII");
|
||||
System.out.print(s.toUpperCase(Locale.US));
|
||||
}
|
||||
|
||||
private void printCArray(byte[] a) throws IOException
|
||||
{
|
||||
byte[] b = new byte[1];
|
||||
for (int i = 0; i < a.length; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
System.out.print(", ");
|
||||
System.out.print("0x");
|
||||
b[0] = a[i];
|
||||
hexOut(b);
|
||||
}
|
||||
}
|
||||
|
||||
private void printVector(byte[] key, byte[] plaintext, byte[] ciphertext)
|
||||
throws IOException
|
||||
{
|
||||
if (botan_format)
|
||||
{
|
||||
hexOut(plaintext);
|
||||
System.out.print(":");
|
||||
hexOut(ciphertext);
|
||||
System.out.println(":\\");
|
||||
hexOut(key);
|
||||
System.out.println();
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.println(" {");
|
||||
System.out.println(" 16,");
|
||||
System.out.print(" { ");
|
||||
printCArray (key);
|
||||
System.out.println(" },");
|
||||
System.out.print(" { ");
|
||||
printCArray (plaintext);
|
||||
System.out.println(" },");
|
||||
System.out.print(" { ");
|
||||
printCArray (ciphertext);
|
||||
System.out.println(" }");
|
||||
System.out.println(" },");
|
||||
}
|
||||
}
|
||||
|
||||
private KeyParameter maybe_schedule_key(byte[] key)
|
||||
{
|
||||
if (schedule_key)
|
||||
{
|
||||
noekeon.init(true, null_key);
|
||||
byte[] scheduled = new byte[16];
|
||||
noekeon.processBlock(key, 0, scheduled, 0);
|
||||
return new KeyParameter(scheduled);
|
||||
}
|
||||
else
|
||||
return new KeyParameter(key);
|
||||
}
|
||||
|
||||
private byte[] encrypt(byte[] plaintext, byte[] key)
|
||||
{
|
||||
KeyParameter kp = maybe_schedule_key(key);
|
||||
noekeon.init(true, kp);
|
||||
byte[] ciphertext = new byte[16];
|
||||
noekeon.processBlock(plaintext, 0, ciphertext, 0);
|
||||
return ciphertext;
|
||||
}
|
||||
|
||||
public NoekeonVects(long seed, boolean schedule_key, boolean botan_format)
|
||||
{
|
||||
this.schedule_key = schedule_key;
|
||||
this.botan_format = botan_format;
|
||||
r.addSeedMaterial(seed);
|
||||
}
|
||||
|
||||
public void ecb_vectors() throws IOException
|
||||
{
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
byte[] key = randomBytes(16);
|
||||
byte[] plaintext = randomBytes(16);
|
||||
byte[] ciphertext = encrypt(plaintext, key);
|
||||
printVector(key, plaintext, ciphertext);
|
||||
}
|
||||
}
|
||||
|
||||
public void eax_vectors() throws Exception
|
||||
{
|
||||
System.out.println("EAX-noekeon (16 byte key)");
|
||||
EAXBlockCipher eax = new EAXBlockCipher(new NoekeonEngine());
|
||||
byte[] output = new byte[48];
|
||||
byte[] tag = new byte[16];
|
||||
|
||||
for (int j = 0; j < 16; j++)
|
||||
tag[j] = (byte) j;
|
||||
|
||||
for (int i = 0; i <= 32; i++)
|
||||
{
|
||||
byte[] header_nonce_plaintext = new byte[i];
|
||||
for (int j = 0; j < i; j++)
|
||||
header_nonce_plaintext[j] = (byte) j;
|
||||
AEADParameters params =
|
||||
new AEADParameters(maybe_schedule_key(tag),
|
||||
128,
|
||||
header_nonce_plaintext,
|
||||
header_nonce_plaintext);
|
||||
eax.init(true, params);
|
||||
int off = eax.processBytes(header_nonce_plaintext, 0, i,
|
||||
output, 0);
|
||||
off += eax.doFinal(output, off);
|
||||
if (off != i + 16)
|
||||
throw new RuntimeException("didn't expect that");
|
||||
byte[] ciphertext = new byte[i];
|
||||
for (int j = 0; j < i; j++)
|
||||
ciphertext[j] = output[j];
|
||||
for (int j = 0; j < 16; j++)
|
||||
tag[j] = output[i + j];
|
||||
System.out.print(i < 10 ? " " : " ");
|
||||
System.out.print(i);
|
||||
System.out.print(": ");
|
||||
hexOut(ciphertext);
|
||||
System.out.print(", ");
|
||||
hexOut(tag);
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] argv) throws Exception
|
||||
{
|
||||
NoekeonVects bot = new NoekeonVects(0xdefacedbadfacadeL, true, true);
|
||||
NoekeonVects tom = new NoekeonVects(0xdefacedbadfacadeL, false, false);
|
||||
System.out.println("# ECB vectors for indirect Noekeon, in Botan's");
|
||||
System.out.println("# test vector format, suitable for insertion");
|
||||
System.out.println("# into Botan's file checks/validate.dat");
|
||||
System.out.println("# Block cipher format is plaintext:ciphertext:key");
|
||||
bot.ecb_vectors();
|
||||
System.out.println();
|
||||
System.out.println("/* ECB vectors for direct Noekeon, as C arrays");
|
||||
System.out.println(" * suitable for insertion into LibTomCrypt's");
|
||||
System.out.println(" * noekeon_test() in src/ciphers/noekeon.c,");
|
||||
System.out.println(" * once LTC's PI1/PI2 bug is fixed. */");
|
||||
tom.ecb_vectors();
|
||||
System.out.println();
|
||||
System.out.println("# EAX vectors for indirect Noekeon, in the format");
|
||||
System.out.println("# generated by LTC's demos/tv_gen.c and consumed");
|
||||
System.out.println("# by Botan's doc/examples/eax_test.cpp, suitable");
|
||||
System.out.println("# for insertion in Botan's doc/examples/eax.vec");
|
||||
bot.eax_vectors();
|
||||
System.out.println();
|
||||
System.out.println("# EAX vectors for direct Noekeon, in the format");
|
||||
System.out.println("# generated by LTC's demos/tv_gen.c and consumed");
|
||||
System.out.println("# by Botan's doc/examples/eax_test.cpp, which");
|
||||
System.out.println("# should match LTC's notes/eax_tv.txt, once");
|
||||
System.out.println("# LTC's PI1/PI2 bug is fixed.");
|
||||
tom.eax_vectors();
|
||||
System.out.flush();
|
||||
}
|
||||
}
|
||||
@@ -172,6 +172,6 @@ printf(" }\n}\n\n");
|
||||
}
|
||||
|
||||
|
||||
/* $Source$ */
|
||||
/* $Revision$ */
|
||||
/* $Date$ */
|
||||
/* ref: $Format:%D$ */
|
||||
/* git commit: $Format:%H$ */
|
||||
/* commit time: $Format:%ai$ */
|
||||
|
||||
@@ -90,6 +90,6 @@ int main(void)
|
||||
|
||||
|
||||
|
||||
/* $Source$ */
|
||||
/* $Revision$ */
|
||||
/* $Date$ */
|
||||
/* ref: $Format:%D$ */
|
||||
/* git commit: $Format:%H$ */
|
||||
/* commit time: $Format:%ai$ */
|
||||
|
||||
@@ -14,6 +14,6 @@ int main(void)
|
||||
}
|
||||
|
||||
|
||||
/* $Source$ */
|
||||
/* $Revision$ */
|
||||
/* $Date$ */
|
||||
/* ref: $Format:%D$ */
|
||||
/* git commit: $Format:%H$ */
|
||||
/* commit time: $Format:%ai$ */
|
||||
|
||||
@@ -3,212 +3,274 @@ are of the form ciphertext,tag for a given NN. The key for step N>1 is the tag
|
||||
step repeated sufficiently. The nonce is fixed throughout at 13 bytes 000102...
|
||||
|
||||
GCM-aes (16 byte key)
|
||||
0: , C6A13B37878F5B826F4F8162A1C8D879
|
||||
1: F1, 397F649A20F3F89A00F45BF230F26B61
|
||||
2: D6B8, 1653F67C9C716D0FC59F3B14154DECBF
|
||||
3: 673456, E82EFC79B30CA5235E2DC8BE4C14265D
|
||||
4: 26DD7C26, B8D1F4DB845F7D7079DEB8920949C14D
|
||||
5: DA62AD1487, 828A42329320764E5FB74D44A6108F4B
|
||||
6: FB79F7D51742, 865415BD049E86F3DA2E0B6E25E1A50C
|
||||
7: 9D96D1034166BF, 50669247A5B338E183DE5139831CD6A4
|
||||
8: B466050E1330B20A, CB264FA7853A1FFE86E1A07CFA7C7319
|
||||
9: CF16F0B3D9FC6183DF, 647DD6E1F40F385E1DFE6676FB036242
|
||||
10: 14D90928C7236050096F, 930CAAA5536406218885475CA823A973
|
||||
11: 4F2322D66A7079BD7DF519, 3B3931D47413042FAF1313F1041509A3
|
||||
12: F1497906F1D8F4F9E47E4BE9, 469FB0D62828427C2E9BA04041A1424F
|
||||
13: 2FAFA2A3EEA4C000702E58D1D4, C9A484FC4ED8644A06060DAE2C3D1568
|
||||
14: 5D707F8ACF319413D220AA2FC2B2, 0EE9AAF5B1CF622ECF6C4F5E5FF4656A
|
||||
15: 2C19DBF966D24B2713F82B69934060, 8676246A2F7795ABD435B3C6B4EA6E7A
|
||||
16: B3FED6C2315CE6D98729DBE69270A11E, B8AC739AD154744A33E906C34D91BD4B
|
||||
17: B2BC44CE088BC3F654B9703D9C691F17B3, BAD8314A171BC0119942136C5876AACC
|
||||
18: C6E958E3E9AC836C9626BD66478974D26B0C, 4E6D61833E9DB839117B665A96DC686C
|
||||
19: D40FADD078B474EBCE130FB44DDB4824077988, F43E3CD978A6E328AF039CC70E291E1C
|
||||
20: E177B3DF83A117E55F255A6C2CD78AFDAFDA307F, EEF1ABAAB9CBE0EE317CC79E7E5E24B8
|
||||
21: DBB4569B3E305E4525F1F7B3D2AFEF226F397E661D, 65ACFB70132EEE1D47319A550A506DB5
|
||||
22: AC2CAF77718DE59131A6B745DE9F3A9897B17580EC71, D8DB9006A9597F640F2594340D69E551
|
||||
23: 8F62022F72A0D769D2D095A55E28832950870B2B44B0BE, A7E196F869071B7BB713E8A2D15627E9
|
||||
24: 37F5640F820384B35F13F8C8C7DC31BDE1E4F29DCFBDA321, D5765C39DBCA72AC89100CCB8864E1DB
|
||||
25: 25059BFC302D0F8DD41BB22CF2391D456630C06F1DAF4DFA86, DC2FFD153C788C28D251B78AB8B7388C
|
||||
26: 151F158CC4BA9393FDB153C4C72911C120BAB519FAF64719133D, C61915006038BF15DED603832FD179DE
|
||||
27: F5DCF4231482F72D02F8B9BE0A41113D35AEA1CD85021CEC978D9C, 9CBD02C557180FBD0868C87A0BEA25AE
|
||||
28: 5D88B5554A2ED73054226473676FAA7159CE12B5357D635DDED35B5A, 5AD11CD6B14C59E64B5B26DFBD00FB5C
|
||||
29: 5696C7066EA09A30FC8BCBAD96D48A5E5FBCC8756B770F0A89B8711911, B9EA5F3BEF0599D385A9ACEBE4064498
|
||||
30: 1240FED47B305AC1883F8CF137D58E79052B4E686DCA1423A6A2BECBD5F5, 036A5EA5F4F2D0BF397E8896EB7AB03D
|
||||
31: AD9517BF392C1EB56D78EDE1C41F3C73B72304DA47F400C390C86B37A50C2A, EB3E026D518EED47F6C927525746AC54
|
||||
32: 2AE1CEED83C6490A7E5752E91532406EAC6FF4B11AA770EFFF1B255FDB77C528, 74BFBC7F120B58FA2B5E988A41EAF7AC
|
||||
1: 3A, 03C32E0E9D7E07A410B9BEE40A8F0D26
|
||||
2: 26AE, 3A635BBDC1A17CA40B58CEEA78105CDC
|
||||
3: 142FAC, 7E8922E8FA6F1E41E4339F0B52176DE4
|
||||
4: 20C1863F, A1D12620C22EA7A0AA0E74667A20B8E1
|
||||
5: B3B796AA54, 53F0F9F03791BBD76BC99D1B5639F3C0
|
||||
6: FDCFF8EA82D8, B56076B42E3EEAC73DD42FC83B9220F9
|
||||
7: 4695E719E67849, B4A1A2E29AAD713D5677CF425E65A400
|
||||
8: EE5BA3309D417697, 146EA95CED151F8C40DF98C1CC54930B
|
||||
9: 13FF05ABB084FA608F, 55550AADC3461CC190CA22F29C6246CD
|
||||
10: 008B0102208A22D3A562, 7178534BC7145754BAE525CC06E14A6B
|
||||
11: 3536DBBB07B026E78E94C8, AB27183AEA2240B0166D702EEB2A7BFA
|
||||
12: 00739D5A27AE82AC7D6A40EC, 4354578C3D241074D3C1F6496420F239
|
||||
13: DA41A5F458400C94B84026C052, DC6CB036FCAE9765A69F5B8C38B0B767
|
||||
14: 4C99797C7EDCEA9D5425565522E2, 3FFEEC557F0D5FA73472D2A3F8E71389
|
||||
15: D381E7AD2E5BE2C97FB4BD958BC2EB, 6BF713D4E7DA7C4290967A1D23F97EDD
|
||||
16: 5016C127F16A4787734AF3A3E6F6F0F7, 8CD8458531E94BC8160E2176F63F8D0B
|
||||
17: BDF3D0F24D9415AB5CF9B87BB45B4A8AE4, D81A3D56451313742ACE53D41223F6AF
|
||||
18: 68C1FCBE22FBDB296C246F2E34D871A6902E, 7AFD64D4EB0DE7E2A842B518AC6D483F
|
||||
19: 7D8D3C31E643611B0B557F29B437F635FE3FD0, 8501B61DBF4A4DD19B87E95055B95962
|
||||
20: 4185EEB0B9B480F69B3EC7A162810073A36AD95A, B9BCA6D9CA0AC2B4B35D7BFF4DB27D25
|
||||
21: F991F4A481E322FEEC6FE9302D010AC4C811B23B4A, 54FA4DDA92E57509F4D48D206A03624F
|
||||
22: B288424FF96596B2A30A1EB9480F5EADC2F6D8551B9A, 2C998C8DFDC7663C8DE677B2F1CBCB57
|
||||
23: 1066FE3DCB9F8AE0DC0693F7179F111E0A7A1FFE944FF4, 65402D1F8AFBDC819D6D1ADB5375AFD0
|
||||
24: 0A8772CCDE122EFF01D7C187C77F07BDA50997B4320CD0D8, F55823AFC3D9FE6E749E70E82C823925
|
||||
25: E6E2FBB3E2238BC8CB396F463C2F488B4B4933087728D39815, F06DA35A9AEE65F9AD0DAD5B99AB4DF6
|
||||
26: 569BD39CB1693CB89B88923ABE0D8CFA0B4F22A48A15E2EACD4A, 661AF51FF0E0E363406AB278BFC9176D
|
||||
27: 199EED81C2428170EB089060FF9676596EADD2270895A0C8650903, 90AA9C634469D45E7BDD9AB955B90130
|
||||
28: B5200497A0654009B9F5B0D45FFDCF192F3042D6B05C6D6A8191A7EA, 71F6C4982AA50705D5FFC60512FC674C
|
||||
29: E39DA262C0E851B5CB5BD55A8B19D0AC0ABDC6FF3F32DF3B1896242D9E, B58AA05F594FC9779E185353CC52B8FB
|
||||
30: AF349B91BAD4BE2F2D5E4DDE28A1AA74115A9059A5EBBF9E38F341DC368B, 966B04FE43A2A9D94004E756F7DBFEFA
|
||||
31: 8C87861DFFDE72FA64E926BF741330F64E2B30837650F309A3F979AE43BA2E, A5C825AE1B844D6A8D531077C881BD36
|
||||
32: 924E178A17FA1CA0E7486F0404123B91DBF797BB9DBDE9B1D48D5C7F53165912, 10F972B6F9E0A3C1CF9CCF56543DCA79
|
||||
|
||||
GCM-rc6 (16 byte key)
|
||||
0: , D595FEDAB06C62D8C5290E76ED84601D
|
||||
1: 4D, 47A6EDEF8286F9C144B7B51C9BCCCACF
|
||||
2: 0085, 9788DDF89843EC51120B132EB0D0F833
|
||||
3: 463701, 673CB8D248E6BECD5A6A7B0B08465EF6
|
||||
4: F5B3222C, 1C424282D7FB427E55285E20FC2ABFF9
|
||||
5: 3A4A8361B2, BD40E631B054F280C7973E5AB3F06B42
|
||||
6: A475866BF2C5, 2067F42FAAA6274270CF9E65D833FDED
|
||||
7: 689D0D407172C8, 3BCCFFC64E56D5B753352E1DDD5CCAA3
|
||||
8: D9CE4B051202A1D3, 79B0CCDA3D0B9C9BCF640BC9E6D9CE0D
|
||||
9: 0317D68BE098D276B7, AF35043DB6213DC5D4F3DFB8E29EE537
|
||||
10: 154CEF0C6F37AA0A73C4, 61E598A8C6D17B639F9E27AF55DD00F3
|
||||
11: C3DB1B2B6CCC9170B9C05F, 966871DDD6E110711FB9DD733B6B2B3A
|
||||
12: E4F22383C75BC0FB0E59C5E8, 971536AF878F4EED68F59046C928EAC8
|
||||
13: 2FBFB99AABC6209FB8664916DD, 68D0BF2144AD1ADECC4074DAE58540C2
|
||||
14: 5FEEDFD09BF89719A34CDCCD2AAA, 64DEB7D5E6891103AA54C0EB366715D0
|
||||
15: E063A076E0C770FB010D26C3AC3EB5, 0CA321B2A7448FEEF84D4E0AD5BA2DA4
|
||||
16: AFB0DB9959F0906BD346C2D81DC5412C, 425627895E2C4C9546D3227975585459
|
||||
17: 79179C0D4D6C5E0741DD4CA1E8CF28C75C, D0188A344A1CEE52272FE6368DB0FB75
|
||||
18: 8A75521139B0DE3C08C9EAEB77D8018A39FE, 47FCC200D8A384320D2F1A5E803A9991
|
||||
19: 0399381D0A975AE3980A9FB75B991C055AF367, 034915370AF94B96A8A4E50FF9B134CC
|
||||
20: 8C189094DB13FBE62EA5C4A53C29A428ED587BA2, 99C58F838423033298897841ED526347
|
||||
21: D91F5144B525AF5D47EF4D5F0AF9915447A55927F9, F6750BF7E089515D35B47BC1C65E2E3A
|
||||
22: A4E26B554AA277057A5FE3FA08A6138CEEC6D69BB1D8, 7BBEBF52D8251108C7AA1025E213EC44
|
||||
23: 5C1A8C3A46FCA90D73675706313CADFBB90A535A4B3D5A, E35244A2633478BBDAFCC81161F28B80
|
||||
24: D69F7264FC594057B89181B83582D799AE54E9EE4FE8AD48, D4B29E5C25F9477D9345526DBDE9372A
|
||||
25: AFD322D0AC4AF38D5B9CBE0DFE85618C001A7A77CD8FFFCB3E, AD06BB9C59D23D258D6A2AEDD946AA20
|
||||
26: 179CA8395CD8E75B4E5EA07D25C8036AF08B1A1C330492523D36, E3704C4341A834C087500E332B7DEAE9
|
||||
27: B9178EF7774684F43F1FCE99A4319B5A4D167B0A848551F562CD7C, 5D5082FB02B9B494D5883DF49DB3B84B
|
||||
28: 830FCD15A09EC61245D7DA258E308E76D3B542F2345DBFC11AE983A3, F50C3332F8D91911BDACCFE228565E5C
|
||||
29: 179619B8C7EE9B3121405BBED2AC102A027E6C97EAEDB5ECFEB13792EF, 859EBA3BADCE6E5AB271A261B26DE28C
|
||||
30: 14264C7E0A154119BF24B7FCF434E81440D42D54738F0BAE55836849AB85, 0B6C9B9CADB1B6EC71CEA090C8C72834
|
||||
31: 0D7A316F8B873F62CF26CFC569179AB11CBF09D3467936A85ADC265B2C9A8F, 866AE7C51EC2D9DEB32748A1C8B61143
|
||||
32: F8FD1F967CD3632805AD7FA8ECB40F530927DD5C49D31FDBAE49738E2315905D, 9CB1CB84A727C9F42555EB566E0A1DEE
|
||||
1: 16, 2CA928694EA91AF92B3ADB402FBBCDEE
|
||||
2: CD9D, 4A9940BD7148F08AE75A4F238148C174
|
||||
3: 6D1332, 5CD73043FD797D1375AA011D2E36896A
|
||||
4: ADC34199, FF5D2B40B02CB58BC63AA6D1CFBA811B
|
||||
5: 83158D52A1, CB8C45A56D7539CBACBB85DFB4C1F52E
|
||||
6: 66E32F053C17, 3EB9AC9A066DC66DB4973B5C78C6EC0B
|
||||
7: F23224FEB14897, 0ED4890D034F20A9A78ACA7492AE9341
|
||||
8: 3FF9570F77486C86, B82C19DE2C5CA6CAAC223F337173F840
|
||||
9: 44B4F4130619FD516C, 6689DC410118E0DC2D90ADCD6327049B
|
||||
10: 6E205B2537935E50A1E3, CE5739FDFC13D279075508786388C08D
|
||||
11: DB836471D91F2FFC6A199E, 1518E9A6CD2190D32A9EA1AC0849DF09
|
||||
12: B9936A58667AABD9BB9B2ADA, 388894E75CEF512CD5E3986DFB2CA589
|
||||
13: 1B5072C8FC0EA19A0486C0E04C, A804D99E2414A314440E5F4B8BDCFB45
|
||||
14: 614903F301B1E7C092E9A32C195C, B4F7406533C58AC54869F09C4B0801CE
|
||||
15: F30ADEF328878D174B1AEAF5D7137D, 7C5BB92772540C1E2209B77C78AAB092
|
||||
16: 776D20B980DDC7C48ACE4225F59E2736, 85DAEE9785EB1BA9C99FFAA5AE565159
|
||||
17: 6BBA225325564369BB5F11EF5734604938, E41E0E3C31F4B1770AB93750A386286C
|
||||
18: 6EAAF9EF0C149A13BA535A2AFC398281017D, 10CBB6A874711DE179D8A4EEDC4DE085
|
||||
19: 9D0B62274F7E5426F5AD9515DAAF4742C291D9, A35D18485F881CB0BBB00A9421C9694C
|
||||
20: E6A18F640923DBB22FCBCEB0ACD1A2BC94256212, CFCFC7E7E5C64090DF746F8C36F605D4
|
||||
21: E37EB92C38B47C6E2621C2CC64D83CCCA9104C2095, D88C0FBF2402FBA40EB525118FC2CAC8
|
||||
22: 0E690F9D73E7E689AF48FE5B99E58AC42F3702EA40FD, 33D698F9C44FEB68C1C442B30DD36B9E
|
||||
23: DA759D58629FA946FB635538C1AED318890C4D84EB6610, D7BC6A69DA658EE3DB842C01B9085A07
|
||||
24: 581F86B5A844FD709B13E09A7CF64ADEA84EFC2D7AD9300A, 0296F58775CE4D4E92C4DD0CF65CF8D7
|
||||
25: 78B346A03098BD6EBE0BF56F5C37C83B3C42288D0E031E0D4B, 2F89EDA70B8A31EE64B264C7C5165AF1
|
||||
26: ED768B0F18A13ACF40738FD61642C0CFBCF746D60887A8C5FDD9, 56EE211AB10B37D61FD80692A76615B0
|
||||
27: FCC298575C9F4E1DD2C8B0482F9FFF42EFFE565ED5FB178DC56947, 0EBA843B28F91798D79E2105995EF662
|
||||
28: 4341133DA062A885DA6D7BF4387C6F28829E65EA7DB7E50B15F2D03F, DAEFA9D1230FE3084FDB91AC7ED35503
|
||||
29: 777C13A7FC16345BF949508CBC1051540928CB5B9B36569488109FB60E, C8DEE566513233B8E74ACB1046FE87B4
|
||||
30: 6342B6FEDC0B8868AAB5E870CE1B2E420269CB11DBA74F10C5E978F2B44D, B2B001639A2A0BA045023817947573E4
|
||||
31: 99A123D836EF76A4250A960DF7DCFA231C3595EAB53024F53B961EF80901ED, 02E8820F6D31A23DC9F0DCE511A1F8FF
|
||||
32: BF57034D1EA94A6DB86642918EDBC9CC7D6C39025F9EC528EAA2A9EE7B22EAA1, 7801231ADBA83C137D760AA75FF2C9E6
|
||||
|
||||
GCM-safer+ (16 byte key)
|
||||
0: , F769B436C7FB7C0C822E24BB2B2555D3
|
||||
1: CA, B156298625F5634FA012B23044437807
|
||||
2: 4960, A64C73E890F3D77B2C3B3C76C2D913C6
|
||||
3: DBBB8D, 686651A017F89A22F9FE96533C85C52C
|
||||
4: 150AD99A, 177F7DE9E897DACCAB7EACEE3CDE7601
|
||||
5: 077055065F, 48B4309C76CAC37BDF11842311BA6CD3
|
||||
6: B2F8CE062C06, ED04DF96C06959524956E8AC5C338457
|
||||
7: DCE718211410D8, 3F8D8180BDEAC2F018EA81615177CC8F
|
||||
8: 0F71E2772402AC83, 2130481B2CA7B4B4C8F3EE73B3B3C28F
|
||||
9: B69030734E5ADF753C, 8CC4B62BFBC3EA56CCDBF0ED318C784D
|
||||
10: 6B8A91ABC1BF2F2D0176, 86EAAD80D148A48086987A40A5631DEF
|
||||
11: 44AD00799EC8E62E34D6A1, 016830D58F06F75E54531B45D9E785F9
|
||||
12: 0C4B9381D78E0F0A78B3CEAA, 4A79C58DAB131A22F172F9177DC4158B
|
||||
13: 2C56D4625876524B4D8D5F079B, 7B407F704225B25F1F136C984E564147
|
||||
14: 36424D69BACC56407D345B3D7B4D, EB126C255A2DCFD32F69DD5CB61876C7
|
||||
15: FDD3E091C0420D1A4D4A848757FCC2, D319C5C07134D67BA42A4BF312CD874D
|
||||
16: EFAF6F117EA9A4B4B83052BBF5A07DB9, BB09D473FE82257146E7ABC2EFF6F631
|
||||
17: 19B71383C414BAC3EF252FFF09F5ACD777, 526DC9AE6895ED33A34A9A4ADB07E1B6
|
||||
18: 9AB6DFDB930D26E00B3D98DD5AD014E08756, D70B95B20C106A5A03F9B803D2CAC3A0
|
||||
19: EEB3C236C3031DE4C3F94BD746677AE84B271D, 9483BBCBBFDBA1CC5F6392DABA2ACC19
|
||||
20: 3A0EBC7536F8717E8FDAFEDAC39E8F1F43C0627A, 3DA7DC2475466CEDF01EB543870A74FA
|
||||
21: 79D28D2F149E1D97E910342DF383FCEECF5AFD4C6A, 2364F33BCF6F07E381F7E26DAF802D83
|
||||
22: F1D7C319BAFB740332CA19AB0C9B71728D3AE69BFAC2, 3D4AEE9780A5C98CBC69606CDDDB31F8
|
||||
23: 1A0D80381A186673FB7B52C40AB6C46A11AB0889333C20, AF5C17E3D0D9724EDC1FC438A16B4EBB
|
||||
24: 5E503440B22DD6AE6401BA4355C8791BACC598C9E0F1412E, 156D8221BD61F5C108FC18FB2F50D159
|
||||
25: 7784EFDC6F0FC56FCADAFF17BB52DEB35B64FA19C3F391BDFD, A291E8238EF158A2379692077F70E8D0
|
||||
26: 184B6E18032D1A70CE5027912E447C357C72EEF7B20EF0FB256C, 0FA0138FB9480E0C4C237BF5D6099777
|
||||
27: 7AC8FCB64F35B71C5ED0CCD776B1FF76CE352EB57244085ED34FE8, D995B3C1350CC777878108640C1CADAE
|
||||
28: 86C7A01FB2262A8E37FF38CC99BF3EFAEB8B36166D24913BDD3B91DA, 25EC6D9F69168C5FA32C39631B606B55
|
||||
29: 91F5D3E3FE0B1976E2915B8DA3E785F4D55768FD727AEF19FA1552F506, AF902DED55E386F0FC4210C97DB9446E
|
||||
30: 7ABF5BD9CB2EFF8382C6D2B28C1B0B25540E434123AC252046BDDA74DA32, 713259EDDA9B1B63EB68E0283D0259DB
|
||||
31: 5634B23ACEF2874BE0591BE3268C4538698FF2D93D59B39BC86D0137DACBAD, C4054796AFD335B43C60E7E634122BAF
|
||||
32: F26C68C36B1E56449595EA4E162391E0C6A306592949F69797B6C2327E533ADB, 7B392AF776A94983078814B6B8428BFE
|
||||
1: 0F, 62E723CCA67DFC49C1915AD3C69FDFF7
|
||||
2: 87A7, A73B3D416AD68235C662E9684430FAA0
|
||||
3: 40FF80, 8EC11FFA3B777664FC6D2AD37AED3765
|
||||
4: ED5B1716, 1A4FD3FDC9D197866FA8AA1403E3219F
|
||||
5: 033CF349B9, CA1E6111A5BF539931490D2EFDA7575C
|
||||
6: 23E30716B131, 79FB546DE6C534A18BBA604E8E2BE8D0
|
||||
7: DE67DCF5635B0D, 463989CCB9A972468B870C403AB840D8
|
||||
8: AFB5BCFD6E36E41F, FD3A63618F1D31A8A71D94FE91F41501
|
||||
9: DBA0EB7B664D303BE5, 2860B5516CF0CE20E35BF766A4375EAF
|
||||
10: 2826E6EDCFD7E9FB938C, 685E8B032254DFF65DAC8A44C3819E08
|
||||
11: B70FC9EE54123F45A4E67D, 8661E54524A0F12612E000876E8E6F15
|
||||
12: 5FC3C79807594E403B82B9DB, 9D88DACCB8654708B241A505AB12FD47
|
||||
13: 2C7AC463E62BBC014E1A48E15C, B4FB110193F147E4A59EC38983528047
|
||||
14: 046D692C6B2827453F7BA3EFB609, C4E46E0D5F71D2D477D7CD12B7447713
|
||||
15: CD693A49640E00134FE33C9E324122, F43001B425E37C094BCCBAC49A6471C8
|
||||
16: 9FC2042EF22E0F8A767DB0C52109E4F5, F60730D914AA02A3BCED7F737640B9FC
|
||||
17: F09ECC9AA4FE3596C00D0AF4E052E60755, 199B8C9CEED9B4E70526BFE603FD5E45
|
||||
18: 0C8BD929E87A21A9F043E47CE79950EA0E75, EC9D38AB193FEC16EC470A15E27FB367
|
||||
19: F621E43B7FB21D98544817FB229C2F308361D4, B6BDD4053C4DFBD3970A5055E4A7719A
|
||||
20: 63F1D36ACEDADC63627CD438B379C48D648126A8, B1A7217302F84CF5F6A259F2881484B6
|
||||
21: 60BAE96D5E0F248A257CB3A7788D6107CFB525D20C, FE60C3B3E2029869EA063BA3B981AB96
|
||||
22: 01213496633A4525B2C7CAABDCFEB84193A8AE2D8059, 738E7956DA8464FF655CE4F5B0A005C9
|
||||
23: F6822F3C87B238F6F7E44307C416B6366C18B26B2357C1, A27A98EA0AAFD1D3010DAF4070F52E7A
|
||||
24: 32B49BE196CC3825B7B6E0DEBD90680B996C3AA161BB52ED, 8505573CC5191577BD992A004F255953
|
||||
25: 38361B85808140127A44B364046A5E1FB0B86885D5030110D3, 17DF461782D45807A7709EB2BCFAABE1
|
||||
26: DBEF6C2067BAFF378A285EBF685F559A896B76A517292B4301F0, B6061185764BA316CC0163925F27A1A7
|
||||
27: 15E2A0634520C0CF4C189436D35DE01CF5C83F0684CBC261A59AC5, DCD96E1687F24676838B60E873D47087
|
||||
28: F837ACBF63898720B0527477B59A8EA74751DABCF2CC48C768AB421E, 72DD76EADF13C65E6F322E110F9944FD
|
||||
29: FDA50738B60251E5FF1C38AF0A8E3F619D247C24A20D63B372571AD6D7, F1F1B212BD7E973BA17BDABDF27F5AC3
|
||||
30: 0CDDC7A10CA3F3616E923A751EB638CF1E67CC2D17A03538C6A2BEB8555F, 7DB533FD15E48FFB217B18E91B7B2928
|
||||
31: BE0C9A148FC3344025C8BD35AC883B584AC706F540BE1100A92DB67EF900B9, FD172B0942DDC1EA076D46BA46B9F7AC
|
||||
32: F8256E9A41BC6E09084274A91229DC877257C433E3E43F05FDDBC3584B6093D4, 5CD834DDE7406085CADD5BEE122AF052
|
||||
|
||||
GCM-twofish (16 byte key)
|
||||
0: , 6275E8CA35B36C108AD6D5F84F0CC5A3
|
||||
1: 38, A714210792F9ED12A28F25CAE3B3BC5E
|
||||
2: 8E2F, 6357C1F125723F2244DAF344CDFCD47B
|
||||
3: 900A4C, ED4E0B318346D5B9B646441E946204E9
|
||||
4: 087EAFF8, B871ED95C873F1EFA24EF8B6915F447D
|
||||
5: 63FC9EFBD4, 650D0ED98CBECA07040AB97B97129360
|
||||
6: B6081E94AA19, 6A3BDA8030C5A79B6B9087555A1DA67B
|
||||
7: E10A7B9CBB20C2, 59EB55DFD0A37C55A869834E597373AF
|
||||
8: 94E947FEE05780EE, 354918527F855264E37DB6892E868050
|
||||
9: 9A80C567AA50220862, 814EE57CC9D51D7D900AB4840C4B072F
|
||||
10: A8741BE1E42BE207C416, 2B28AFD8ABE20664D8BAD7535F82F11A
|
||||
11: 6AB7E3C68B6682023E8190, 5E48B67541FE83969952394F84D29E93
|
||||
12: 4F66FB634EB258CEE2955D84, F2632C2135B6E1144673B0EF73499818
|
||||
13: B29042F3877C2F5E694953C5F6, 03268A30499D57A06AA873EF00160C3C
|
||||
14: DCC7B5D9F58C88F54A9611389B8D, 5515426FF7CF2EEA91BE2B3752371CE0
|
||||
15: B665488BCD75FC02A0DF7994B7CF98, B721531E2A317C254FA2ED306ADCF96C
|
||||
16: 9535DC8A72645E34F948B71A5159AA9B, 5CEED93DE128044F0471C65AA8F21D29
|
||||
17: 5CBFC61A23D28562FCA929375E5B585327, 3AA842B21631968D1B58B72FEE090EE1
|
||||
18: 2AC3F780B956A933C0B8565EE527173B8CC8, 16EC4B6D8E2CF3CD0D16E7A5F401C78E
|
||||
19: 5067FD65870A4EBF6C7FA811A15270E7F8F17D, 9A7563BEDADFA6B6E48F5C13FCEAED6E
|
||||
20: E3A65A188077E5DC171CFF30BE8B27F10F015166, BD5B3D84D0C1DD51A3909F849141B57F
|
||||
21: 88D0A65C105823E68BE3987CB205AE0C1A27588FCD, B280221AD0BD83E1D6B37F331F326AB5
|
||||
22: 7C56D987FEF6807EEFAFD4C7EB9D72AA0E037979D91E, 686E1268A8DC9CD0192A383EA6C2D975
|
||||
23: B23CCD0A076CB122750B634B9E6551E0585EDEA18C3245, 6DF30A7F0728E2D549AA411AE375E569
|
||||
24: 767BC3AF206E67C9E27A4D7E814F3B3A65D27BB70BA9DD4D, AB2B16C031FB2C8E85B3B2B38A5CBA4E
|
||||
25: 9ABF34ABD43705D62F377449461C5DC239A2A86E5A98AFB159, 3DEDEDA85E6BFB53C6F18726CD561604
|
||||
26: FE756344C05CB12AA0673F1C2069A86556E583FF4B7313A0D395, 21CB0E0BABC3C7E547F5CB207295C0EE
|
||||
27: B70F16AD19A6B0AF6D8DBF4E98D7D5ADB944D91BD889D9390C3E21, 2AE67812A22C1C785D3BFC184A1C74EA
|
||||
28: A6389032AA9D08BDBAAA5E230E5130665FB4F0CB868F3F20C4C5438B, ECA054EFA3F39400A587839C4F0605C7
|
||||
29: A55A41315EAF3A67A0FD0E14C6E04D03A5E38D0F756719F4A0800B290A, 7A5277809D4B65E663603099B4DFFBD8
|
||||
30: E739633579AA6201A024B9873F28412BB08B08B8616D611BC9D07979BD3A, 390038A93AFD326C5CC1525A24CA91AD
|
||||
31: ED3266F8B0DAA7C3DB7814427E8139831CFC0EDE668F0DA83FF7090154410D, DE440EC2C6080048BFF3C5455E1BB33F
|
||||
32: 4D0F751B55DA3A2E0B28DE59E9680669FCB5984E9C0DB942DBAACDDEF0879731, 62F96CFE31D3D6AAA0B9F5130ED1B21B
|
||||
1: E9, D82A22BF49B52DECE1A3DAA163956EA1
|
||||
2: 3DE3, 837CB2018053A6FA9A51A18362C0A6E5
|
||||
3: 1123B2, 280150FC247D06FF79ABE3C6C5ACFDBF
|
||||
4: 6BE74C72, 52FA635AA14154D3FFD7A4866AC989E7
|
||||
5: 7610B2DE22, 3E77AF501CA8EF386E2843A2C9F30425
|
||||
6: 31BBF5CC9F77, DA25899A5B84C4CE3CB031D24BE39EEC
|
||||
7: 49FE2D43D16BEF, 491CAFC0F9A749AF0F87CB5276FF7BD0
|
||||
8: 28191B8F4FBE3C03, B8318CE8B7EEE3BD42A35F7EF7B4FE91
|
||||
9: F6BCC7AD009DF4B71F, 01BDA4572E1B95D0152A8675BBA9F6B4
|
||||
10: 89B6B6B611CBBD4AB667, 5AD5C05B2FFC3AF07ACA04EC488BC4BF
|
||||
11: 985A04A3BE0A43A3489870, 57AB64D52976293C09882943B8622A0C
|
||||
12: 15DDAC26F9C07856F5C11CCA, 183A4FD20C0D7AD1744B77992D4A16C1
|
||||
13: FE45E506C3C26745D6B5B53A36, 67B3768535D1A50D2756AB4ED83C73F1
|
||||
14: 8EBA337B5E13FC16BBB18B8F0B10, FA90CD334FA6565E517097C37B7281C7
|
||||
15: C9F914A669C4C58ACA86884FFF469C, 876599BB8BC1AD6E7B1DBB00ED53276E
|
||||
16: 8416EEB95A4B3DA645035CBDC76C8532, 405B3A936CE697DCBA9385CAEAFE2B55
|
||||
17: 312BBF82B6619E5F7EE56AE873CAC9C415, D5FB2028CF3F6C57295BA6F7E5F410A9
|
||||
18: 1B51044539639A7093D996E3B4174D6A253C, E934D7A7EF90586A56C6C2DB53CD6C40
|
||||
19: 178762C071950E8E0198E6573BD585EEEE4E69, DD661E463BF3BB45225F7E7A6E0DE3EA
|
||||
20: FFD6BA51FEDDB7E20593AD2BF0EEE061D3B5C014, 0DCCDAEBE6135EDF787FEEDABFF3A4F3
|
||||
21: 04BE622B5CBE1058A4C8356F65B8158295F39E1AB1, FCA9B0BCA348B319D0B19DD28EE9DE79
|
||||
22: 8B49016BFA45DCE019BA9E4606E987A159ED0DA07D2D, 6B93BD424871D5231EB359E40666CC5E
|
||||
23: FF8D016642B2C3190094423F5A61F7CBD358522A5E5799, 2088A4088AF6F786DFE08AED79A19B3B
|
||||
24: 07F446A2E3597041B9AFFEDF5DD474CA5FA5C872844A4F8C, 870223F7404BA37C8DB940623F0DDBE2
|
||||
25: 32C2EF41ED54C8B63AB8151E690C1770CED90D2827EB2C302B, 5BC4EABF30986EE33FE483B8FABCE7D3
|
||||
26: 3310D94B00007C10D4B3BC3F57DE877D0E2B822B96DA9CFEFEDD, E0E114CEC34558A180675B0438128F30
|
||||
27: A4C95A5B316AE03A569B7862290DC6340FDEA1299C5B27591333B6, 63288F9CDEB93BF029C194B2C62B4AB6
|
||||
28: CB63472F93E0325123558620DB9FBA058455D8AF1D23A94BEBB60A79, EC0968F60DCAFEB17411C4A2D7793FCD
|
||||
29: 74241261257C5610211A3B9D45D62AA0876B63EA289FE938FB03CC8D1C, 4A18EAA2039B29F0CEF7745EB8AA7DDD
|
||||
30: 6172080F96B60E3BA450BA195EB4D6732A25AF30A109031560915C4C0344, 3B690B088522D3EBD6B647070AECF97F
|
||||
31: AF52E18DE8608C39FA886377899C66AAF8612513C21C7B815E248D9F75D775, 39F0F712265F44A442A7581D8F314D1B
|
||||
32: 64F9AE4A9E6735D348343EA7ADD617F0687C2883637468BBFA3664F9194F1683, 947A02C9994DA490BFC9E036305B26EA
|
||||
|
||||
GCM-noekeon (16 byte key)
|
||||
0: , EB5A8E30D5C16311864E2D8D32859ACB
|
||||
1: 88, EAB88DE1EB7BC784A706B2D7946798D7
|
||||
2: BA1F, DC3CEC6AA324AC7D053EFF7A99AD3069
|
||||
3: 9A1457, 4AB65831DE378DFF71C20249C7BEC05E
|
||||
4: 2F9496D6, 800745CF95EAE3A698EDF9EC949D92B7
|
||||
5: 84153177A2, F6A05B654435ABDF5F696C0E0588CB5C
|
||||
6: F80B7865C766, 2334D0061FD488D15A6AC8E44EA1F4B9
|
||||
7: 872EA486B4EA9D, 3A49671DE347F675AD7904DDF4255F3D
|
||||
8: A4EE5750507FC831, 956D09F7C5FE812C6FB982E1DDBE864A
|
||||
9: B5874AC964FBFC1A97, 90FBC75F45BFF58B3A1100393955D0C2
|
||||
10: 92FF5FCF1EC675E02E71, 983C96A7BD4A0DB5D3B877911CE8A6B3
|
||||
11: F7BCA69A9C7033D84A2BA0, D4ECE5BB9FFCBB331A646D9CE8078634
|
||||
12: 5E1041B4554C8CDD14AAF16D, 1EF777F307CB96788B9120FFF8A8BC2F
|
||||
13: 7BB7289FCAD209D7992EB7AEDC, E8AEFB830DBAED2B4A790FFEF940A20B
|
||||
14: 12776A7C937A648F0A8628AD8C5C, F070283852AC030819EA67BF82C719AA
|
||||
15: 7293476D9E935EAE9DEB66F697F662, D6322603671153A1EC1453CDA5978E15
|
||||
16: DC12A86C85E7358919BABB15A3BF5FD7, BBBFA467EBA8124DFEC82DB0137D56B9
|
||||
17: 0CC1DAD00A987F9C57E3660D9417F226E5, BB8AF5A0B5BC79BD11C5D41CA80CDE2C
|
||||
18: D0049115D6EB5495FB391CDC494022AEAA48, 682FF357B2BC059765C29AE6CA668D0C
|
||||
19: 48FC54A401B4C06CE8567AD298B672191C7E84, 493A4AF4C2A8828FED8442C4EFF877F6
|
||||
20: 90779795821CB1B7DBD97028E29DC1CE7D0CFAE0, E126F485F73B6F7B3894B4CF7E1C5DDE
|
||||
21: 8CA5C246C8B7C04BD7171CAE2D1A892D66302433F8, 5D73149A3635A86B3C34DEA5B95CCBCB
|
||||
22: DF082B665F7A952B2604C04554B81393FCC7C0B816C8, D3569ED7D431176B286EF22414E4CBA8
|
||||
23: 761908530C9069E189649ED24B6A68A89B067C31E9868C, A258BCD83D3FBC7AE2AEF7516025AB36
|
||||
24: 717048F5A31F3C89D3704F90069AC5D5174118770C65BDA1, 067EBF18F7E3DF4EA13F9ABAC682C2A2
|
||||
25: 08C6FCC5D3099347C3FEBA3858A6C22C51298CB591DDB77827, B57BFBA40BE99DF5031918A1A4E2CA80
|
||||
26: 2CC53EF7EB954234E64CD4D60FB1D7157A489ABABC10900FFCDB, 236E769611D16EB7F463B7578770F886
|
||||
27: 2556B46F2E831223D632F2691329A874F517687AF81B8322AC55D7, E213A90DBC31DC261A45A9AE41CFEEC3
|
||||
28: 71241792728594D69791B80AD6DBC6417D1D14D222DF5E6F834B82C8, 601F97617708B1945BCDA8A82496EFB1
|
||||
29: 5003DC2EAAA23F9E2221CCBB9E20116692CCC99B3CFBD0DDD3A8491E7C, 3743155B792012845550205C8949B73E
|
||||
30: D0589675357E850333F854FBA160688F06D122DEC00CC2620DA0B2770765, 20E085752FC4D37791C22501ED1DB6AD
|
||||
31: 645B46D2D114EE7329F14AC1D94E6817EB385EB80C61F014F90530749079EC, 8A18DE86F9555A1070D0BFEDAC15B14F
|
||||
32: 068389206D37BF5A41C58075FC98901C3B42E6F2F13C09F4E92524021BB1C1C8, 370B86914D63CFEE8303D538A6BEA0E7
|
||||
1: 05, E18F8A201F281A4F3F4FE6F43A001107
|
||||
2: 55DF, BE4D95A0BC5966CC2E80FB544AD43B8B
|
||||
3: 0C5A1D, DDAE782864D5EAC894C863D4D2E3CA54
|
||||
4: 767CCE5C, 106D7DBE5D9D56D38E6A679528C72688
|
||||
5: 9F099BF360, D4D50BE3B13DE7B18BE415B21BD9AD4B
|
||||
6: AE4B0C056B1B, 8E0EA5A5F612835B1A498C671413CA19
|
||||
7: A8EF51FA62B5F9, 44A65E1A85C9C102467A50297F8256B0
|
||||
8: C58D955A860EE8E0, 45622020FC40884B61BE3C35B940A870
|
||||
9: FC5F5562143A7F9AA9, 7FBED30D1594D1DB57BA10EEF0C4AABA
|
||||
10: C2B2D5B922504BD29C23, F14AF5025799EAF249745F1B91AB554A
|
||||
11: 62C250C8548BAF088DD01F, 6D49DB3F4D3D8D30DB0B26DCF6CF6A80
|
||||
12: 3FD64FC5BE13ED2AA041B8C5, EDC192E68D5A7B37F395B794C3D8245F
|
||||
13: A84B4EA6C8CF088B0C6D40B5E0, 01EE07A0D3F4A1957579C1EE36C5D5A3
|
||||
14: 39A4C10E5C542FABA9C6138E02D6, 8B31EDD92A71F53ECEF716E08CD0A3C3
|
||||
15: E4DF855B9065B51C47454CBC3209A1, 4714B347E11804D0AB3241B1D72F4FCB
|
||||
16: FB6D42C9C44997D4C854BA321C8631CB, 7F0BD8708CC6358899B7C62A7ACEE739
|
||||
17: 81A2C031F0D5593DBD283A9650A4160185, 3267D10C3BE6044B0D2E0BB59A919AFC
|
||||
18: 33776FB240A45E1A84B86B49FB04A350B9F8, 3743BA55B523F4BFC25E8B2474347C70
|
||||
19: 4E19A791B6EA4B776C5449CC3AC486EE9EAAE7, 9D4FD554D57E73B6789D20E262E706FD
|
||||
20: 10B946D1B1C005516B7DE7F51CD41C8DCC581DA5, 3F41B2B8FFCFDE5298473D2E6FF76227
|
||||
21: 184C4DD415AFE6FE74B3BE662AC04E6229F517F4A2, 158749C83A13B178F0FB7C48E7A4A19E
|
||||
22: 6DBD3F3888A2028841B61167C3EDAAE71FC23774C923, E0E87641B9C55DCC041D343960C9417C
|
||||
23: 6D995776DB3B90B038A4CE44EF2D4EFEA16DFE0A5BB054, E14F63E6C6657CB904B16EC4F2B82972
|
||||
24: A955576527F9A240B13F9DA2FD67997D5E606D34548C1444, B8FD23A3EFA33E7F4367C61E071F8BEE
|
||||
25: F7D9EE67BD019E97A5EB7A33B7A307B2268ED7BECA95553D92, 6B31B756C9B3EE98613BB29B357FADAE
|
||||
26: ED68485EF62E89965CC8B085CAFE89BD9661ACF66939FB014E1F, C57A80259C493520E50902597EA3EFCA
|
||||
27: 53365AF657B186724902E8011368D6E49DDD2158F51EE0FFFA9658, 8EB890A78716344E79E4AD48C52D423D
|
||||
28: B49CCFC3FEAEF5C8DE4E41EF538A537552B4957E8965E454FFA3B5F7, 7CA3442BAF416B50431BBBE5CACD44DD
|
||||
29: F02E7CA72035455ED723EB802E66118D5FA642295416F12AB298567AF8, AB211AB9624F17975279690C6D95EB51
|
||||
30: CA4C2EC503773BBF34FA411340CBAD6A9115E81B073932444ACEC5537614, D877D5B78FFB31CC54142562BED1890F
|
||||
31: 9B9BBF2D46D301F3ECDE92A13C1EEE8F9F1533AA4AADFE2E22D36D51F5F469, F03F634BCCAC070F210142F737542491
|
||||
32: 92AD34E95350275A4CF208CC1A07776E7A6635EB8F2A7D4D9B6B6C96D6812616, 52E49767709D7CE349AAFC0C405A68ED
|
||||
|
||||
GCM-anubis (16 byte key)
|
||||
0: , A0061C2F3B2295BFA33BC74C037EA8DA
|
||||
1: ED, 9E5648DCE40DE37B56C557D26CB18D83
|
||||
2: 6719, A6605253C59A101FF85C5102CE92BE45
|
||||
3: B8873D, 13F3E3ED3646BB296EE4ED5D6379A21B
|
||||
4: 5AA6E2CB, 1812E8385D15B5BAE043E4E860BEF490
|
||||
5: 4F6F4CD8E9, 8A80BC5E08929C42A5A74C5D9ACC0C6D
|
||||
6: 2F0D8B483CE4, 316F588F78FC6A9196C97CE59B9B63B6
|
||||
7: 82D885FDE1F948, 7160BF556614511F53738A92B5277056
|
||||
8: E4931462AD41B6DC, 7CE24C4D6B499975FCB72B5E2275ED56
|
||||
9: 503AA70BE698BC5B41, 10EA0C61FDBA8FF7B4E9927BCCEFD911
|
||||
10: 6B2D213D14B5D25EBE36, DC3222AED12EE26D3D14E2E733EDB2A7
|
||||
11: 7D8B0BC1B7443E7267371E, FCACFC73E391865BE86E041F51C45E81
|
||||
12: 9EF3BF8609E133BEB10565AF, D84326D4CAC9D5B74FCFD8CBAFE79E77
|
||||
13: 59AE7B1FDE1178CEE7F63C4894, E1BCFCDCA86CAB9C684F7D21962D580D
|
||||
14: 564E7B8BAC5582A3BF1178916569, 54804D8DF4D7577EF65C15487695F840
|
||||
15: 758A6DC437C8821274B0F16F911BAA, 19DD27500915F425F34F67CC2374DC36
|
||||
16: 0468C94A88A27AEEE2B3A973065E53CC, C743996C6F49363B2F4613F24703EF7E
|
||||
17: 3B0CABA5EEE44B7BFF0D726ECED54763FF, 14D9D09815BCD91DCCE2F5AE1A9929CF
|
||||
18: 5B945D83B98C43B0248F9BC0479E332869AB, 67A275F0313D4245B1965411CFCC8F17
|
||||
19: 97332441CA96DE8553A3C6D898FC6D90C86DBF, 73150EC3D6327E3FC8015A6192652D3B
|
||||
20: B9A1778FAF9767160D0D87816ECE1B99AA727087, 0C173D3C4078392CE377313C48D2BAE8
|
||||
21: 5882B73911C7D26EFDCCA3AED2EDC8A8BFFE75B1F8, 8F8C535639A0B59537E590C7FC9D2E53
|
||||
22: 70AEBED8CCFFF6E5CF06F3E841D12387EF8D6C7B4BDE, 4B00C27FCA9BEB82331CC8EB13DCC580
|
||||
23: 345CCB52BC20DC5F1BF5EEDF5D72A6C48F402557FFD342, 1A790A39573B853DBB8E2E73B7331014
|
||||
24: 0637C78A817E91D63CE18CEAF8D65C6107283A90C5A97842, 52786CB81724E12C76A0D23D4680E36B
|
||||
25: 59526D1E86A473DFB720FF25E97D6571077845F73C5E8322F1, 369FBA7823FC83D727FFD25D10130987
|
||||
26: 2933BB4E7603C313B62332827601F8189E14C1F08EA547E15AB5, 204520E365DAFF6551B01562A4CEFDFB
|
||||
27: A4098CF2A48A1DC2BCCE65CCE8DF825AF51E7E5F94B6186FF85D77, 9833EBB9A1D5CD0356E023E2C3761C2B
|
||||
28: 26557B942FD6913D806672EB01526DBD5D6F532F78AB6759DE3415C5, EDAACDD101BC40EE6530D8B5DC031F31
|
||||
29: DB92C3D77DF0C8F4C98845AA9AD43FB800192E57A53E083862B7E3FAF0, 628DEB1E345303A40700289052080FF8
|
||||
30: FC57BFAC2C77781723C2B721886D44ED67A52D9AD827874BC4EEC0A97281, 9A222DBC47B4AB4E520D3CC5850D4DEF
|
||||
31: 72DFB9E91A78EAFE758B4542206A4A957B4523A58428398C11BCF2AEAE1938, 307D0B876130E82804C1167E03B69B2F
|
||||
32: 7275C6EBDC2680DFCB73326A987D2FBCE83E40A9AEFE6351CFDA7251A6FE10A6, 895E6EEAA9BD88594903325A063CA45F
|
||||
1: 99, DD35EDAD537F6FCA5BCDEB053BEE36B8
|
||||
2: 12A6, 24CB6ECAECF376400F7BFF52C4312D08
|
||||
3: 791DDD, 7C35A987766AC11A4625C92BA4AA419E
|
||||
4: 601FF830, 69A6E3718404D3A20019D9E7F875C2FA
|
||||
5: 45A67C8B23, 92EFC3CA67CA0934E5E22A0EBA4E5613
|
||||
6: 5F2C7A733D42, EB5BF55241D049343457F05BE8B53CB5
|
||||
7: C356F4D8AC59BB, 12598DA524E6F01EDDB512E3B988B860
|
||||
8: F24201E87407B8BC, 58FBE9D3E242E16BA16420C354BCF0D0
|
||||
9: 509A017E05D0075264, 357822F3CAF350972D86F2423FE49040
|
||||
10: 0BCBA97FD277C65D4BB2, 068F57C866AD35379F108237B39C78C0
|
||||
11: BFE30A88F0B1FE651D0EC3, EE2F073E23DACD211B1C22074CB32A70
|
||||
12: 11AA35923D9CCC49AF83DA5D, 9A7E9EED9774C06D1D127D1ADE221893
|
||||
13: E3FE3E1C2CA4E1C61D530AA46F, 0D26F48272F7DAE98C797F0AE5BD5B3E
|
||||
14: 6407C7F6DD9E188DB09F584AD32E, A673DD2BB4ACC85983DCD4B5EAC2FB68
|
||||
15: AEFBD570198C05D5B430A275AA82D5, 3A1CB79A7DDB7601C7F72A5B0DA8531D
|
||||
16: 40C1B9150E8E09C9483C1CA0CCBDF363, 241FBB631ACEDF77D51594D660BB4981
|
||||
17: AD3F3FA6D431E12D6B41476D7B5DA77C2C, 4C22BF4240AE4235FEAA2D3ED7AAB8B4
|
||||
18: 5EB8D86E7B26064D75E56C42B090A17544E0, 44EBE42984F206FA78D19DFC88AA1EAA
|
||||
19: 75D7E5AD5C2D19E21A1931F88229C1456EBFD4, 1F1CF1F832658DB0804D577BB2FCD2AB
|
||||
20: F73F1D3F38E8B99898E30FACECEFA40FA933F63B, EFF893CE73B6B30AD144735A5BC759A3
|
||||
21: 452A09F297A013652273C124085FFE03D5034EC331, 9E71970BCD0EC639049F906589B7FFD1
|
||||
22: D7BB98AD11A884CC8BF3F2F52CE9F8C17F8B188C190E, 31496C89519DE6F66113C9BEEB151275
|
||||
23: 97B8305B1D1E02D4D1D8194BC54E4AB394FA8F5C8B2526, 1A153F52C3C67E0DA81B626C159D31A9
|
||||
24: 1542789709D1FD889E7C5820F920126434D5969C4EC3F6AB, 685A03CA342688A70753953AB27CF0BE
|
||||
25: BB08A7F815AFA96B96C028EA48D79FF3BA7FFFFFA1902E7822, 98E4377462566EFEE39F65659DEB13CE
|
||||
26: DC8EC0B08BCADA829B3663980D66B80A2D51500AFD80EA0F18CC, 58D9C85F9561F59BF264393DA954399B
|
||||
27: 477A3B8344DBCC79577C15524F35B45A7FEA72B0561A0CDCB3CD66, 57343CF1432D30FAF8724C5AB3120539
|
||||
28: 3CE2DD2869EDF99ABBB3DABC981B5BF294D6AA29A785F1ED6363D6A5, A939560243DC164D46028133C12B16BD
|
||||
29: 72504872BE65F3DE8F0B63BD24AFEED17B195D270AB20ACBEA7E6B0B8A, 4D5D642AEAFE6A2CE8881577FCD7F2B7
|
||||
30: 5B71030C43F551C27183A17D08FC1B9C8AC1829D404B8DA8803FBB09343A, A602A88365B46F19DB240F2C077A0334
|
||||
31: 89C0C85BA495D5F92D91EAC281362F374A0F41C507FD20DF6E05147C8E7208, 7F8994E46CE0548DE8F290303E8F3613
|
||||
32: 5AC62A000B9A80B6B849F3A36E1B512097922F8475D3C6F237C3DAE23A6B8C6A, 346203E5D4775D002A1022D7F42504C1
|
||||
|
||||
GCM-seed (16 byte key)
|
||||
1: 26, 87B72BF4F343FA59CFA40D1091F50FD1
|
||||
2: E80F, BF6A3B3F649E3AD1D07D24326C44365A
|
||||
3: 16C93E, 740A57E99296F82515190712B4B56F00
|
||||
4: C403D1FF, B210C95ED48A15A8E78DBECA2831CBC8
|
||||
5: DAF5735AE4, D74ABA53295DAEB4A04842D0F587C0FD
|
||||
6: B80ECF00DBBA, 91DD19615D6F71F696C4AE9D388D7266
|
||||
7: 45F170B0D2ADD6, B9FC969B51976A3CE3D8CDD227722A53
|
||||
8: E3EC82041FE3EEDE, 3B82743C9A974E594D53DCF17204CE55
|
||||
9: 15B8E18A9D105E2F2A, F1452F649ADEB08006092347A722497D
|
||||
10: BE3E6D03650BC96975E1, BFA2A6EDEF412FAB922E861514475C21
|
||||
11: 0361D6CEEAFBA30C30EE5D, AC97D081314CB9CD24113CF38E9E41FB
|
||||
12: 50E4627778596D55D7A508F4, 99A3E41EC4F3B20DE8D217C06C828F23
|
||||
13: E3362B153E59770912C7B12FB2, 9A96E56341834743DDF33156AF411B5E
|
||||
14: 3408B88EEB308F20964DAA903AC7, A4D487202ED5EEC5EA4C45792982A821
|
||||
15: A6AAA4ACBFF8AE329618B023C1EB99, 5B67A194B6358D44FA5801B588289DF0
|
||||
16: 4DCF2115BE730CEFA52053E9398EDCA2, 5DE56AA2FFC6FFEAF87225316C74C87B
|
||||
17: CFFA74C036CD62DCE15843160B39FD18F2, B0CA9A45CCFDD7A61B1D06E0075610B2
|
||||
18: A68AA4DB35238DCE0D537670D76073ECE5FE, 283B33B1D7B57917B8658B3E957B52A0
|
||||
19: F99FCDF3990405A203BC6F9F7D56DB5B8A3E5C, 0887CB21263AE7178AB02E287D47E2C2
|
||||
20: 363664B0944200D152A48C8C27183D7AEE177A1A, 3043B2927916652091951B9E2104E91B
|
||||
21: C1D9BF607F76D69761A9BDBA7D13D9CE4C8E430F7B, D6E7509B620B7E83B3FF7F931020F56C
|
||||
22: BB2DC71C8FB4A7A201AF36C4A174AD542D3A34EB2BD6, 2158A10FFA890769882FBB6636F95D1A
|
||||
23: 6B478DD22EF941F726D89C1B5654260845DC9140317630, 359297946889A740671BBB0BD2857883
|
||||
24: 3211DA2201F029B1ED2E11187E62D434442D5302E78A3242, 0C1D43B63A4DD329EA11ABE5404E83F4
|
||||
25: E0398E55D8E5146A715FE9E9A74316BBBD69DE747B5F7C3C68, 74FE8E2F10A96CAB8102EE6F0847380B
|
||||
26: C404BB08D0BEE8FF032D3EFDE7A15CEE27BA29B43161F0B5E952, 0F21B0E2D83584B65BD7A2F912BF9CEB
|
||||
27: C61D97BC584FA3CB0E6CA3E966747D75BE90CE32E4E1DFA2F34CAC, 45D4D5B01D578ADE8EB7B58CDEFB7950
|
||||
28: 2EEC4B1DEF647FAB996C7A5FA5061E5B572E8B1B0BAA0C8B7D01D122, 36E014FF6D8729B2EADF2E0406840B9E
|
||||
29: 9753865FB716D470C634974C2056D637F11EB2467274D0024A72E5FDCC, 1E2DEAEBBBA78E0E6000275B7CAEC89C
|
||||
30: E9FE40F4C8F4AF2607E41C6BDCAA28EC7241FBC6C8DEF6F36961EFE9B46B, EC5EDD19299A09A39D2F9006093E4CEB
|
||||
31: 995FEA1FA6A0B0B141375B12BC9BA18E29229E3D3BA3FF2F67438268B06EAE, 0413AF0B5AAB28C4EE92495ACEAF17B1
|
||||
32: 746961D162BECF915397F718478F5C1DF7A3FB8BD2413A4BF7C0C43314F6E2B1, FED8ACB5288B6ED8E0556D169CAD99B0
|
||||
|
||||
GCM-camellia (16 byte key)
|
||||
1: 13, 0679D1B662AFDDF3ACFCE419B6DA94AC
|
||||
2: 26D6, 162A86F8E59F9E6EA5DF0748B890862A
|
||||
3: 58767A, EE0B79D3ED4B852EEFA323F8EF9839DE
|
||||
4: 0CA5F75E, A8063610439C0AD6631F6CFBE10C2AEE
|
||||
5: 5B821141C2, 0568AE410E4EF4C9FD4EC55926FB0300
|
||||
6: ADCDD0B1C7AC, 84B1E359DF762B7E51084FCE1619D632
|
||||
7: 75882A4FF78AF6, A13923C17E9006E06FC10710C3F1FAD0
|
||||
8: C4F2E79246F1CE2C, 27FE18DF274233BF632F91F5C6004C3F
|
||||
9: B5F5462F5AFD8333EF, 56EE2A3CCF86F4F5CC6FCFF2638283B7
|
||||
10: FF40C4163E604B0679D7, F813C36C222C5EC2DF7EF51DD12BDA97
|
||||
11: 93FAF62FB742529F2F1034, 2A67CA1A0CD5ECD3EC62E9A303D11B27
|
||||
12: 4C7F377995D7FA5D94E740A9, 0F8B822AA9775F742D5436029263520A
|
||||
13: 357A0DE9ED3E1070808B2AFBA4, FFB8426038E07FD7D23E92876B3CF4CA
|
||||
14: 281F9A4C95ED6C363A1F00564206, 93D5470EEA15AF8E85019C47728B217F
|
||||
15: CBBB9CCCBC78A78CF1F571BF667059, 15C7BFE9E2D25DE73BACE501D9BB5346
|
||||
16: 8A3392119B0B01A9C38C556C6F31AE45, 87886BF5B99CB77FE3B681826286E87B
|
||||
17: EC52B385BC9CE88DABC560DA23B3684378, F6B71A19E39723BD4D9DCFF7ADE97796
|
||||
18: DA81EDEBBAD7F6A49D3BC377E5F16272765A, A0D06F71CD2D9947562832E1A83E577C
|
||||
19: 2146F272EDB8F46958C01887D92BD3AC9B8A47, B5CC3F66E09AD98AB6BCEAFCDED10CB3
|
||||
20: 3E281F975765DE1DB519696DDEA6F94B462B4717, 515B758DC732EC6CAEEAA4B94C943CF0
|
||||
21: B3A735243E2D508E2EF3066705D0FA37442C8406BA, A8C1CC8EE8D5935FBEEC31B7132977FE
|
||||
22: C1272F2CFEE63BA750A7689385ABBCD4D431A99BD2E6, 46511DE41E6ABDBDA73AD854149B03F5
|
||||
23: 3C66C359BA5DC0AB52EB152DBE89AB28767B7E4A6A05E6, DE4BB656C5B0DDE993ED461A0D9C185A
|
||||
24: D0248AC2923887E76BAB9FD48D8FB73D93B23E4FA8704C10, 7C120335F1DDBB429431F15E24F64455
|
||||
25: ACFFD738047C794E9C88BB76C2BD8E300CC5F89C2E5505815F, 7D090676F5CD61FE8BB3E20BB1BC8235
|
||||
26: 8B2F83612C9B5870782FDC506FD9E7CF08024C6D126AA0E715AC, 5A72E736892087A91E77FE785200ED68
|
||||
27: DDB64F5869813B94E80975E55BB8B62A23CC8B0DD56357C51A0B2F, FE9B74933C7D6FF5272A0DD90D1F5D71
|
||||
28: 00A21C6C047DB3551368ACA67B45222386A2DD63297CABC780493A73, BEDAED8C4799594FDB40F992CC82B4A2
|
||||
29: 35FE5CD3F9ABC78C3B6E96EF11FB601741710FDA8572CF741EF9E5A522, FE34A91C83C93FE08F7D4EEA3F927415
|
||||
30: 4CEE166BB1E1325C69BFAE06C9422BA735FD5B21EE2D7581E27FC027CDB2, 31D3086C3A0639D79FE08F5DEEB3E81A
|
||||
31: 6F575BCEF0FC079F8FA300040AA50AD6CF6F4C92A27E24A210AD32FB1FB0E7, 057E5239A6277E1D96BC277D4EEF5FFA
|
||||
32: 5090FF37EF4F163F5B54AEA54DAF1CDAC1125C46A8617CE3D251576BF52143E2, 182FD3ED463E1A6A615F4E25B34CA748
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -57,23 +57,23 @@ OCB-blowfish (8 byte key)
|
||||
16: 3EDC4A0FA95BD8F944BCE4F252B6470C, 87B54BBEA86A5B5C
|
||||
|
||||
OCB-xtea (16 byte key)
|
||||
0: , 56722ECFE6ED1300
|
||||
1: CA, DF53479333DB86AA
|
||||
2: 9529, D0B5A859106FCC9B
|
||||
3: DDBAB2, 3B31FFDA57CF51C8
|
||||
4: 22EB7DD4, 2BB34D04FFF810CB
|
||||
5: 108693761A, 7AFF6F52574A019A
|
||||
6: 391FB7C61E76, 616C5E66297F2CCE
|
||||
7: 3E22E4A4A0BD13, E84C385ABE25C8D8
|
||||
8: 94FA11D5243EE34F, 8F017DE96049D0F9
|
||||
9: DADB6B5D27049240A7, CA69E14047C6BBA7
|
||||
10: F79C8EA83C69DE914DAC, 1EF042DA68106C64
|
||||
11: C5B6E04AB8B9491E6A99F8, 143515779A55C972
|
||||
12: 33F493AB7AE62DADA38C5B24, 531BF7799A778620
|
||||
13: 6DAA66BF02E66DF8C0B6C1CC24, 6CDF72786C5EC761
|
||||
14: 4940E22F083A0F3EC01B3D468928, 185EE9CD2D7521AB
|
||||
15: 5D100BF55708147A9537C7DB6E42A6, 78984C682124E904
|
||||
16: 744033532DDB372BA4AFADEA1959251E, 438EB9F6B939844C
|
||||
0: , F996E5CC593FD6E9
|
||||
1: 88, 64636E3C48940F8D
|
||||
2: 223D, 230D7718A8BCB965
|
||||
3: 32531B, 37FEA4728FAE474D
|
||||
4: BDCF3E96, A9F30B4187CD174C
|
||||
5: 7B0CCDE546, E7328648817987FE
|
||||
6: 824BD771B724, 0BDF80C14EDB758B
|
||||
7: 8F0E73B1280717, 2DEDBF2C87180CC4
|
||||
8: 6F7EFA44AF774B1F, 1A9C5509D54A7185
|
||||
9: 9749BCF684F68755AC, E46941DBE948BDD5
|
||||
10: DCD32D91FE2D5590355D, E17DFA54A5B60E07
|
||||
11: 3CBBF6464D438AB95B3ACF, C207876D030362EC
|
||||
12: 1C804A611F6CE4CFD2657366, B957F48EA00C428C
|
||||
13: 5A2F6927951D8F60C754893790, EB3A27A9E5B8928F
|
||||
14: C710D28CD02726002596D9196021, C6C9EBF090A20C07
|
||||
15: 298FFCE0CD42BC329697AEB5F53A56, BB2F0C415317928C
|
||||
16: 59F6395260ECEAB2E3511991EEEF9656, 278A218A720F8E05
|
||||
|
||||
OCB-rc5 (8 byte key)
|
||||
0: , E7462C3C0C95A73E
|
||||
@@ -352,39 +352,39 @@ OCB-cast5 (8 byte key)
|
||||
16: 6A9424B6A873BB7155C01DC87E23EC52, 82C5047655952B01
|
||||
|
||||
OCB-noekeon (16 byte key)
|
||||
0: , 72751E743D0B7A07EFB23444F1492DDC
|
||||
1: 61, 41BDE9478A47B2B612A23752B5A42915
|
||||
2: F4EB, 90EF542D89F867CDFB1A0807F8AA3CC6
|
||||
3: F5A59B, 1BED873B613096546D4C201347CC3858
|
||||
4: F454610B, FB4035F28AA75221F599668ABBE21782
|
||||
5: 382FC932F1, B40270E2084E8DCEB14C6603D080D7C2
|
||||
6: 18F921441119, 47F1F889B307298150750E81E94AB360
|
||||
7: EF01C70C9D1810, AE0439DBB3825F27CF846B43E4C3AA80
|
||||
8: 89863EDCAD471C3A, F4E8AF73BFC4CB79AECBBB3774DAF8C2
|
||||
9: A6F494092E066A70F6, F73D3B04752B7D913420C17E656C7F86
|
||||
10: 342459682E0A8D53AF4F, 61E7CF14E9878E0726C64B1E8CA08BFF
|
||||
11: 65E520D5A99825DE2441D1, 7A2AA740D786EB7015C61B31959E55D9
|
||||
12: 2F96D0BB72E37DA202410302, 1A313242527FB522289094B9AFDB5F7B
|
||||
13: 3E8F8A1FCEE3F866EC29128BA0, B8065DA2DABF04129E5AE28ECC11A15B
|
||||
14: C2C15976D3C2499ACB9454878131, 372CAD486E104098EB1AA78A2922A1BE
|
||||
15: 1F12CADABAEE80E448B7EDCB42F8FE, 86A38DE5363787F55B16462C684E08DC
|
||||
16: 3B9ABB3304E75BF5B63E7F5B5A3F3980, 1FBD6B93E457B9779E2D12D78301EFA9
|
||||
17: DC0CD805E43675A4317452E378AD48AC4C, 40AE4AFA4B3E580EFDB4AD0AF5BC4E4A
|
||||
18: E9DD52EA7264C6C7BBA39B761B6E87B65687, 4061DD65D5E7FFFE8D3D4261494D4F8C
|
||||
19: 80A9735CA1175072823828123413CCE772D521, D3378A12E79C49A37378DF527A460AB2
|
||||
20: 09AD495AFFBF7CB8841262E7E5E8952878D4391A, C25D7A98C6F260B5FBCA3B8B5F7F33C1
|
||||
21: 3925615707CC40C351D4A49794778545BC1F683175, 97622437A7208383A4A8D276D5551876
|
||||
22: 5BB0D41ECD7BD2CF0B12A933255D95A3FE35E4C896BB, 4B8AD84EEA3156765A46AC19C68B6F88
|
||||
23: 1EE71FE23CBFD5683AB1B391FC12B4E5952E4E6AA3D189, B0FD75996F28E071EB6C86BD7102BAA5
|
||||
24: 0AA3D8C98AADEEE1867B13B017DD263BD16E960DA64FD071, 5204780963A62C2F4F7B3555BFF73836
|
||||
25: 3A88B6F2AE321B226DA90B98E04A6A1589411BEDBE994632D5, 5638AF04EACF1EB986AC0702B4373A22
|
||||
26: C2731661AC634A4DC0345F040DA7AEE507A3B9D019B5958543BA, 4C67D3FE37ABEE928B3BB812E7346823
|
||||
27: D3E7651AA6DA035D05D599EFB806E8FD45177224593B5974758419, 5814E84258E1B9BD56A188AAE6F25138
|
||||
28: 17818E7102B8C123230C5D64F18BE94C3159B85C8F7B64A7D4712CDA, FAA905B587A93DCF600BA8589A985432
|
||||
29: BCA4335C6C29D978032C216114D39C01C6F161BF69D5A1CE55FBA8C575, BE24424A162E43A19755E2EFD274DBED
|
||||
30: 24C33CEE022F8A633DE9DFD009F535B52BCF64F390D2375E5BED65B70D08, 138F21D54B6B7E34628397DCDE0D33BF
|
||||
31: 838FE950C8165ADBBD6B61E9732F9A727CA7AE74376981382F0C531C331915, 0742E769CCBA2D1CAC7CAD4E0F012810
|
||||
32: 57CD778DAD477271794FBF763662D97F8A10B17D70A69FDCB974FFE67E558519, 942C7D1C200C3845748F8131DF71AE26
|
||||
0: , C810FFEC70BB008FD7C314A732B226E6
|
||||
1: D0, 3C48A2C7E0CE9B9099221EF2CEC56767
|
||||
2: 5542, 518EDB8174B067CBF2568C6911378137
|
||||
3: 65E8A4, 3E4EFF5F6FBC99EF3B71B11F566A20FB
|
||||
4: 3D0EF863, A366D5CE05F564B5E676EC78938CCC85
|
||||
5: 89B17BA512, 0E83095D771F654CBD630AC114501A0F
|
||||
6: E9AF5FCFEFED, 3A283F7FF02274DD4B48C2CD7E36182D
|
||||
7: F7A001CEC51C30, 8392CC274521BB452134713153F36268
|
||||
8: D796E3F23E31D4F2, 351C7B0304E127287A9A1DE38BB3167A
|
||||
9: C4E2BBF6B4827E1A84, 275907279D0764CF80D7E6626D81F994
|
||||
10: 6C61226E61F70408A61A, 941AD1718D272BFCB8C5ACE08F90B2D1
|
||||
11: 3C195850E7FD63EFC11F7C, 348A975B60908445230D4D56A0CAB008
|
||||
12: EE5FF5362DA3744C9EAD274B, 875C2167BFAEB65F5601F2DB9035444C
|
||||
13: 7DB5392ED1933ED858EC0C52F5, BE6507D8AC743805A872658C680A4D06
|
||||
14: FEDEAE2EC2059D22B960813B5E7D, A559933509C47854176CEEDEC12EB8B4
|
||||
15: 64C81F2169F7CEFBF51E68D4186A36, FFE84A9B49F0E77A9799EDEC7D76B987
|
||||
16: 66532B678D23130714E088FE874C4743, AF95ADA553A68319DBEBDA4172E18A22
|
||||
17: 53E56845C091A1E2372F3FC772017C9804, 9A6AB7CEB632429F2B31FB91C141B6F0
|
||||
18: DAF6832520591B886E2E962ACF5B9D0A38E9, 73FFEBA8997E0C55CB0B4ABE59C86BF6
|
||||
19: 108F04FEFCB5EE68033E57346012CDEB348D14, E08E90976E0F7868994B017D7A007AB8
|
||||
20: 101682160DEB9667FB073F96ED1D9C063ABCE668, FB79A4BEBCA9A7832C72116AD9B98D41
|
||||
21: E10AB0D22A6C4C253D818AB6AF1A3FF5811C6CEF24, 174CD350B069A239F9EB80A7BCADE8B7
|
||||
22: 9F62A79B25D4F5532D78228A50516F97ACB7A2C5DF13, DD25DD14174B5667B0AD70732323C8C4
|
||||
23: 2A0AA96147E74A3B881D62BA692EE27927A9EAB351C6DB, 9CE03AACF9318770BF7E095F90B470DB
|
||||
24: 29E38605973D0218AA8BAF2FBAB7722DB242C4775E453372, 72D6038E8927EDDE469F98B84C74A8A3
|
||||
25: 8DBF8C2B5477DBA6E07B269293713D60D60BE29E677CA35C33, 83100BBC1401C890B36890A3FD0CD4EE
|
||||
26: 13DE9776093827F254DBF500EEBE0C65DC602A5FDF6AEFFC34D9, D142F6CE9E43633CBE94A2BDCC9AC5A8
|
||||
27: 4A25370043862CF7A12A00A5A278623F9BF8DE33212D35661591EC, 62064DD74F9F6D77682B43D9B44E26B8
|
||||
28: 37C6C6C40DA0581BF041770E330A40185E90426A1A4AC9BCDBC5CA7D, E77EE99F62EB1A38CCD1E90CED6EB5C7
|
||||
29: 6B9047158068957CBF77F35988E5C926C7B262A8EBA9D33638A15B1505, 913DC491D3B2AFF172053CC4D1271F46
|
||||
30: 949E5F05396F60722877EDBAA5D7437DDB24B3E25651458C266992D0854E, 87D4396BBC24646659F10179823066B2
|
||||
31: D48489C360F6EB2BF4155FFD7CCAFA4793B8870BFA4A95C9BEDD372F51C04E, 173EEB238E6186D5A93AC6072A22B772
|
||||
32: ACB6F91E8BDB4CFFE1F2A5F6C712D16177EE06842E4CF27F61C8F68D44C842FF, A1E5F2560183B0AFE466243EF3921E4D
|
||||
|
||||
OCB-skipjack (10 byte key)
|
||||
0: , 90EAAB5131AEB43B
|
||||
@@ -459,3 +459,111 @@ OCB-khazad (16 byte key)
|
||||
15: D870479780CC5B3B13A7A39029A56F, 003D3FCD31D497B5
|
||||
16: A47BF1218AC86A60F6002CE004AF5E50, B4EC27091D5DCD58
|
||||
|
||||
OCB-seed (16 byte key)
|
||||
0: , D80D16D2D0FB2BD9EBA4912468B893D7
|
||||
1: 12, 8776140CB818C1CBFD2CFCD8BDFC9FFA
|
||||
2: F8A1, 597381977898AC43194C302216113CEB
|
||||
3: B35B5E, BC327275E7A552C4E0AC0FCB8403A6C4
|
||||
4: 19F57542, 4E49DE569547B619E4187239D9B755C2
|
||||
5: EAD2D99E86, 53DCC5FAB4DE25541A22AF0309C9FE78
|
||||
6: 4902A8FF9AF9, 950D9A28DFBDAECE5F14D47E6B7A8B8B
|
||||
7: 45FE502602EA4E, 69CD243A3CF17FE51ABBFA2CDE510BCC
|
||||
8: D54F2EDE48207CFB, 775EE6140AACF9D56787071F08F36F67
|
||||
9: FEDBBFD9FAABC80186, B37B2C643D62A205BD009BB55D50B918
|
||||
10: 3541A86C889AFEB783B7, FE41A36AC076F417B6A3870DB712CC1F
|
||||
11: 62EB71A2EAFDDE1A050AFC, A953ECF1F0B53438E869F0CFB84CB142
|
||||
12: 77AFE377460D6A51208194DB, 5CC2A9D8499F1B25D78937DAFB1DED10
|
||||
13: A34FCDD7CA45DFAA2178CDC7E8, A14A119115143EE2B4719282C9E2356C
|
||||
14: A61FA4E9550280C8AAC87EF7A204, A87DDD9631C87ED0792C067E8D7F1D9B
|
||||
15: EE82AF5C51896AED298B0C12E00ECF, 9051873090B013508F93677D3A080E96
|
||||
16: 5D532646FAD510E984959C4E14F853D7, 275D8DF932818030F1269804DE06A73B
|
||||
17: 1D77F8916DF479DDCE3F49A1D9DEFA40FB, 99611A067F45F140AFDB6FB7E9C23DF2
|
||||
18: 5857267B77E7B8D7732509AEAC0AA80BDB2C, 3159BF09910493977A33268C7F7DBC01
|
||||
19: 1CF64E54D48811F02DAAE472846E65235DC8B7, 78F88A35E2D93A0746058D1B37762A27
|
||||
20: 8CC20A5FEFE9AAE81742DE70453F62A961188DB7, EDA9E9208EC38152E53AFD62ABC77F0B
|
||||
21: 1D6CCEEEC72CC7369C33F5CD83ED0DCD6F5613D562, 9FEFD274F3F906B11DD87CC2C0F9D0A2
|
||||
22: 20A9C1EAD88F005DB8F69C8BE005D8A010B261FF2EAD, A341F754932DCBC6DAFE4231918A9CF1
|
||||
23: DCEC1BB28E8D77D69B5148FB02E02C281B68BA6E9768B0, 6AAB2EEB1D25D2DF7CEEFA6054E295DA
|
||||
24: 7C4F7165943DB1EFA5731F5C75931F4391F0C40D5731BC54, 3FBFF88733ACE5289D9FB9CD24C44C3F
|
||||
25: F5E2C8A9B3A02E0BB86F9E969B0EDA5F554B0C8902BB6F4643, DFB22569019686B2EE92ABA9EE6610B0
|
||||
26: 42B7D0E9613AFAD6E8093E4F638BC96E22413F15A84202188C31, 002F0F602F596236A8F239E81CE47FC0
|
||||
27: 88B89B7756BD3BE09467998FABD12BCE87E5FE994ADE9B30844AE6, 05E0E8AFA55C3B571A849CE4C9F1F477
|
||||
28: 10452565D15D1D829FC54F61960C6A749AFB91086E388269CF6B588A, DD88B0C63E040DF8878B3C919AA95218
|
||||
29: E68619409B86082C744496FC3F645CE1134E84192D2CBCE1CFEEB12612, 83258C337EF21302724CE051A03195D6
|
||||
30: 840277319319EF1DDF6A57682B6695550157F5B76756BF81BFFB3394AFC0, 183FA85F8E91F8972DA23108FA066F20
|
||||
31: C74A4B01328B809397C07F4FC16131FBEE6396293181C327ADB50EF39CC936, D6C5CF79D47995D7CDB5745F601D859F
|
||||
32: FF3FEE866339B01DD2C1EC0C0E569A458A77DD014AF0CC9C0A8DC52A52133940, BF1AF01F2CB34CBAF1EAB96FBCCB5404
|
||||
|
||||
OCB-kasumi (16 byte key)
|
||||
0: , 7B4CE3A5B7284F8B
|
||||
1: F8, 80584D787B7AE753
|
||||
2: D37A, 7BD7B52BE65B995C
|
||||
3: 2D07BF, 6E6E16FDFE808D21
|
||||
4: 9F1A8E7F, 810CDE98B80F2CF2
|
||||
5: C6A7842512, CB6E9709AD7E8545
|
||||
6: 056553F25EE5, 24A74A113D68E373
|
||||
7: C3E0215DEABD43, 80B9F0ABDC207E04
|
||||
8: 38DA7B24B04DDF91, AEEB273DCAE4F743
|
||||
9: 34169FBF64966E0EB8, 1D10D18FC0DF5372
|
||||
10: 5B3A510F1AE97BFCE1EA, 5B1342A77724DBF7
|
||||
11: 39D1B5067E584E59BB6603, 38EDA20D46B2563D
|
||||
12: AC2DD02E2406D7D8175EB308, AE7DCB1AE6188975
|
||||
13: B0623EDBC20FEBEDF9B4AB70E6, E218732D221A04A4
|
||||
14: 82F57A435A92E28B56F4EF5E7EA8, CC5842752D089C26
|
||||
15: F2D54E3B9022AB32F668AD5A20D050, D811DF3DE76089FF
|
||||
16: 1CAC13A538AFC64D9747226AC23F072C, 2DF49C64213B35B9
|
||||
|
||||
OCB-multi2 (40 byte key)
|
||||
0: , 70A2AD75028C8B3E
|
||||
1: 3E, 76BE76B249142049
|
||||
2: 5C21, E31CDBD0ED6B864D
|
||||
3: 62BC9F, F1124FC4C9C82617
|
||||
4: BB5AC85A, 97035E20D4FFEC81
|
||||
5: 500D9D05E3, 86D5EC5AD1D55434
|
||||
6: 5179B8442E46, 432EAB80B938A00E
|
||||
7: 361000D13C364B, 5ADB3F9FD65EC776
|
||||
8: 5C5BD790B927CBE4, F6ED8E9D330FD37E
|
||||
9: 2020DD735C5D7B4739, F98DEFD6A8368E1F
|
||||
10: 008A8548790A3582C2AC, 041C4E2FA196390C
|
||||
11: E6409403D3E2E4385EE54E, 25AE9113A0E7A3EF
|
||||
12: E23E598908C755FCF9D51E39, 21BF8C9F319FB44F
|
||||
13: C1F13F46FF04717C7E54FFBDC7, E7D8CDF40A1D78A5
|
||||
14: 27721EB66D4F6362308B96DD9895, A374C96FCA94C809
|
||||
15: 1A393F94CB9ACD3BB93D8766C63569, 45A090303B71D35D
|
||||
16: BCC0498FB13CEE8A615FF6409EDF1707, 9589A4CBC481A455
|
||||
|
||||
OCB-camellia (16 byte key)
|
||||
0: , 6972CC27A9711EAE6654851AB8E0C53F
|
||||
1: A2, 208D783961FD532E14376B4EE904FE52
|
||||
2: 1177, C7CC74015F7EDD9A72F7435494D8A050
|
||||
3: 0F8502, F1A708AA0F485A554E2E76592CD9D7F4
|
||||
4: 9986180B, D47186A8B539F890824DEBA223861ACD
|
||||
5: C0FF4519C3, 4430A9453016E4974CFB5380A1F3E95F
|
||||
6: 2AC54E3E6A0B, 6E320BE8DAF4BA0462A57BECC574740F
|
||||
7: 846053E1A37A6A, 5B91B680B92517781DC362C2F3E144E4
|
||||
8: CCB09ECFF76EEE2C, F91E7E245F4C8A404F3ECC7DE49261C3
|
||||
9: E049E2AA271388106E, 8C6981A160D831F4DC57FACE5ACCF006
|
||||
10: 761782341D52BA8AD12F, 672DC4B06DBBCED80381CE4845757F0B
|
||||
11: 92AD781DEC4549940265C6, DB04CAABC54E71FE1A9C41DF1ED5C52E
|
||||
12: D507B77EEE9BE07EAD700143, B3EFCC0B27DC85166E04E7BC39E45C58
|
||||
13: 5AA1AD6B9CAE3001D4C1CC4048, 424D8A22F7B9ADA30AAC0C1D3D4E77F9
|
||||
14: C69E96F7A4B9A6F0F2C7EFA72C26, 678144F802AE9DD83D11877779B48972
|
||||
15: E2596B3FE48EF6EC50D857C8B4E3F4, DDB3BD2B8AB2FA71C7F56C8E57AFF2C2
|
||||
16: D81664A002E03A75E08CF16EE7670E97, B56A0B0955E15E62C557C6E66782AF4C
|
||||
17: A8F2696A972A87C784FDC775439470D822, 36E3AD03CB18002A17D49E466CE64814
|
||||
18: C2B537D807BD1ACA734AA072D9C2B836F588, 449B05D145666D1E5A92E204FC3507D7
|
||||
19: D5418F1288BFA7D39D23B3C6ECF797397D3D44, B0CFBA612544B8AB159E9D4AD1FFB3D4
|
||||
20: 2F9522460182291C6F264308E0363B9FE312E517, 1EE4CB38075B67463FB9DE26DF9D581C
|
||||
21: DF2881568BECA504A66E4B15BEA58AE6E99D0270E6, 3283D46803FC33098BB262FC1D2B2157
|
||||
22: 4B0083A4CF7E166C8466A5B991AD0CDF71F9DF010EE7, 7C91D9A5DF6C76CB02D83D8C7F3D8D07
|
||||
23: AC0457474B4193647D62906BD08D8C8EB32BE151555B68, 0A448FF3C468D7CDC945724172CEB66F
|
||||
24: E6E7786EBECDC296F072CD66C89141C700DE2A8B5DBF6549, 68ACCB5FEC04717FB21FF3B46A34BC74
|
||||
25: 860865770047A9798D90C9365E9C9F8210CB804D785D65E2C0, A58F22FFC4CBFE3BBA451BE4B3B95723
|
||||
26: F157588B4F98D798E6850D8F04ABF9905C1BBB2D055ADE1EA424, D6960C1EA6DAF225366374333D38EBDB
|
||||
27: DE3431977821BC861CD88E4236BCAAAFFE3C894607498FB8D68746, A3D23729464BD38338F4AC5B4D9F5C81
|
||||
28: 3F2F0AB546E118B76B937D539806DC02D02A5D42D64926A9E1101D66, 3C0D2D23F5DAF7D36DDC0F87B4163F42
|
||||
29: 3F9FFAE1D7BC62BB80A2FA2728FC33FF02E26CB9F52EA8D03FFE95A49A, 96B45B3F946E629ED974EFA7B66F5DDF
|
||||
30: A398B66C8425CE9E8A6BF5AB900CEA1EAE811E06AC7BC0D69A53FB2015BB, F83411C72B7DB201B254565D1DD8D1BF
|
||||
31: 9C760ED6C10A80C52F092ED20AB1D03A52427B6235F3C7FE7541033AACDD74, 8AB98FCA89D1245B177E0AC06E083024
|
||||
32: C38F260587B3BA9919601BD0A56909FB36ABCEB8968D08DD6B74F1EF5ED7065C, E357D0D56124276790DACA38D95792BB
|
||||
|
||||
|
||||
@@ -57,23 +57,23 @@ OMAC-blowfish (8 byte key)
|
||||
16: 8E6831D5370678EF
|
||||
|
||||
OMAC-xtea (16 byte key)
|
||||
0: 4A0B6160602E6C69
|
||||
1: 1B797D5E14237F21
|
||||
2: 938300C83B99D0AC
|
||||
3: F989B99B3DE563C6
|
||||
4: F65DEA2A6AD45D1E
|
||||
5: 1DB329F0239E162E
|
||||
6: C0C148C4EE8B4E1F
|
||||
7: D82B387D5DFFE1FB
|
||||
8: 1D027A4493898DF2
|
||||
9: 196369F6B0AF971A
|
||||
10: 2A37A2655191D10A
|
||||
11: BD514BE32718EB4A
|
||||
12: B4DBC978F8EE74ED
|
||||
13: 8ACCAD35C3D436AE
|
||||
14: 73ABDC1956630C9B
|
||||
15: 73410D3D169373CE
|
||||
16: 23D797B3C7919374
|
||||
0: A821403929958A1A
|
||||
1: 68C4A02D47C2E7C0
|
||||
2: 7D37358141506DC1
|
||||
3: 9BEA3AAE55B75F52
|
||||
4: 884D053D05CC8DE4
|
||||
5: E953747483FF4E0D
|
||||
6: B6E77E72C9738E4F
|
||||
7: 8AB67D2B24E3D512
|
||||
8: 329C0B9D504A0D41
|
||||
9: 50323DA8ACEF4164
|
||||
10: FA3239C668C34DA3
|
||||
11: B5A12FC81FC24084
|
||||
12: 71A01A3ED3936934
|
||||
13: F29B630CEB6AEDDB
|
||||
14: F8802F0D4504D55E
|
||||
15: F844B92162038F99
|
||||
16: 99AECD7CA69F0465
|
||||
|
||||
OMAC-rc5 (8 byte key)
|
||||
0: E374E40562C3CB23
|
||||
@@ -352,39 +352,39 @@ OMAC-cast5 (8 byte key)
|
||||
16: E8B0B219D4CB699B
|
||||
|
||||
OMAC-noekeon (16 byte key)
|
||||
0: EC61647B281C47C1B43F9815064BF953
|
||||
1: B100B1B6CD96DCED8F47A77E70670A92
|
||||
2: A96CDE3C48831A6B0A5ADFECA6399BDB
|
||||
3: 14E75E7CAD840208834918B29A5D4430
|
||||
4: 9577083713AE6E44EEC987C77C93C072
|
||||
5: 2A738C02841E461238C02F5CFC8E66A6
|
||||
6: A901327E451BE0D2D9DEC83DEEA9A022
|
||||
7: 5ED7EE1BE04A64A689D15F6970A821A6
|
||||
8: BA053E24FCFD02C731A8CFCA19EE66A0
|
||||
9: 57139CA8C91072555B29F85A19E2C84D
|
||||
10: 4585EAC7EFB84869FD96EE7A5FDD350B
|
||||
11: 62AF6C415CA73E54E82EA306254C1BDE
|
||||
12: 75304F9724BD364F84371EE154F5210E
|
||||
13: 7FE5DBCEE826760434745D417453182B
|
||||
14: EC98DA2A580E9131218D1CDE835423D4
|
||||
15: 631BD9EAFD1AE445F2C1C35E2B4416ED
|
||||
16: CA2D902A1D83388FE35BAB7C29F359BA
|
||||
17: 0DBF0AF7FCBEEE21FB6159C0A2FFCD4C
|
||||
18: BD7CD2C49241032DA33B1975EE2EE982
|
||||
19: B30B090EE8626D77D310EDB957552D46
|
||||
20: 64F608AC5707C381AC6878AA38345144
|
||||
21: 28513CA7795B23A02B37DC3732413D23
|
||||
22: 9F440700094517847E9E013C8915C433
|
||||
23: 8CA483F313D20BFE7E0C089DAA4145BD
|
||||
24: FA44872743E20E5E0A069B3C4578DB50
|
||||
25: F6DE8FFBECD52CC1F213CD9E406DF3BC
|
||||
26: B9702B7E846735A3DCC0724255F88FEC
|
||||
27: A1DDAFED2B1732C7BA89C2F194AF039E
|
||||
28: 2549C5F0E30F8F4002431D2C098805B8
|
||||
29: 52E3836181BF5C9B09A507D5330CD14F
|
||||
30: 01C55DCBCCFD9D7A4D27BDE2A89AA8EF
|
||||
31: 3CF721A0CF006702CDA91F2FF3E4D5E3
|
||||
32: 6D264B9065BE98C170E68E9D2A4DE86E
|
||||
0: A9F50A6567FAD338AB5727B3B94DEB82
|
||||
1: C9EC17EF3656C9056E64E692A449AD24
|
||||
2: 7D1F6A3373BF20D4E65804B745D40855
|
||||
3: FE3484F11C338721F3FCB4DCC608BD6E
|
||||
4: C45670D31D48CE9AD70BADE9F7A6A5B3
|
||||
5: 6AF86480F1AE638DCAC40939B864D4DE
|
||||
6: CBBAFED3A5891A7BD8692055E4C59444
|
||||
7: B23439FC6D1CF0E3B04BE5201CAF9283
|
||||
8: 385D2C64F55B3FE976E660155FAC4C90
|
||||
9: 239D4B8F663248076E64CF743AC14EC0
|
||||
10: B942C5E06C6E68866440EB10747643B6
|
||||
11: 9B591FA2FD9A20C367FB03366150D1E7
|
||||
12: F90183F872D062AB4642DCDCED399970
|
||||
13: 86003C2F260EAFC81BC45A0614F88381
|
||||
14: C80F88A148FF906D42E6D75A50049468
|
||||
15: 0A81478238ED815D7CB04C0DC5A4A4D5
|
||||
16: DFE74730DB9CF4F994084C88923A8931
|
||||
17: 91194DAAAB458B5B34E991EF534D4BD8
|
||||
18: DAA1CCA0B644AB9F8B4D889D7F1268FB
|
||||
19: A93AE4F41DFB6CA311FAAA148A9D53D9
|
||||
20: 6FFD47B80A991A6C09775060E4A4B13E
|
||||
21: 4BE3101511BCA3251559ED6D3BFCC304
|
||||
22: 3C1AA3485241175A9A17F440A1F2FF5F
|
||||
23: 11D2C5E4FC75639CC61C8FE66C2F5135
|
||||
24: 3EDBF9F32259650ABC2C835301FA6556
|
||||
25: 56FA9AA43C01CA5BA798780D3BF40FA1
|
||||
26: 40AE1F352003026C6D4C5F44430DD5ED
|
||||
27: 264E11C88266029588A1B8369F0C5B73
|
||||
28: 60CE0E6D2C2C74D122DBDE57B3EA44AB
|
||||
29: 5E4078E7CEFA94886E9CF0D083C4B468
|
||||
30: CEC169560600ECEED6E5C8F06C76E702
|
||||
31: B4209736F08EAAE6D5B4923D83EB3EE2
|
||||
32: 5DC8D45C9954B82864F1C2388858D97B
|
||||
|
||||
OMAC-skipjack (10 byte key)
|
||||
0: 84EDFA769040603C
|
||||
@@ -459,3 +459,111 @@ OMAC-khazad (16 byte key)
|
||||
15: BCAB623CAB7AAA23
|
||||
16: 9BCEAB857596E478
|
||||
|
||||
OMAC-seed (16 byte key)
|
||||
0: F184C3569AE39C95609E878E8E69D276
|
||||
1: 6B94C6CEB7347C7E478D33FD1892032B
|
||||
2: 9FA405B299D5887181C5F09A27AF9F76
|
||||
3: 7457B824FA672F0D939B3CD161A3D229
|
||||
4: EF164E3F30058EA7BA10B1D7ABD945F8
|
||||
5: 22FAD3E42EB96A6E6A66FA73FC96A9E4
|
||||
6: 9BE414C3CD92860A67AFB7C45D0E0EEE
|
||||
7: 40DA2A768F6593E45214CB7F054A9BAA
|
||||
8: 9AFBBEEC8EFAFA7A22752F3BEE055811
|
||||
9: 45EBA2A3EE9276A90FE7FC705086F59B
|
||||
10: 9FE7E1DE176065440B45B1F8F012B8E7
|
||||
11: 5D45CE9EFB14AE973C6567E804492D4A
|
||||
12: BB37B25C98998B0CBDF7AA2BF86FBF3B
|
||||
13: D68EA4AD5B7C3E243872F5BCF7F24EE2
|
||||
14: E880AEA09E328C58ED99928C7BB97DEE
|
||||
15: 4A9EBD30EAB684544D79A066545B100A
|
||||
16: CEFD858C3179B39BADA7EA0F6D3AB150
|
||||
17: BD3336CB8C5AC6D327B310C2093FD087
|
||||
18: ACB4B352003B45FE5E872647ACD2C945
|
||||
19: 74FF04F0ED7ACBDFC2B8EDB0193312BF
|
||||
20: 950B9587B448A73F0566B6E5D30BD85E
|
||||
21: A1CEB1E515BEE6C0C2253415CEDB7F54
|
||||
22: 5E3B9B8F983B882D48853403152BBD09
|
||||
23: E7BB12680BFDC81851D08870862F5F70
|
||||
24: C89D50E7BC1692A3EE29585F4C2861DB
|
||||
25: 1ACBB14354F3A1E002BBD065930F56B8
|
||||
26: AECF4E3972E26A862DC9A0D0F78F4A75
|
||||
27: 4E8663B1FD460CC7B6CA7D6D880209C8
|
||||
28: 0350DFE2A107BB68BAD09A9461EE5E64
|
||||
29: 89B70BBAF6E7F4E7E37F40D122588B0A
|
||||
30: EB0B22BCD7D61272372502B7EADA68A7
|
||||
31: CC4FB973D094008F4B90D687CD91B4C9
|
||||
32: C7162431A53216C22D47FA511B0A619E
|
||||
|
||||
OMAC-kasumi (16 byte key)
|
||||
0: AF4289889D9AD5A1
|
||||
1: C58E7863B4E8CE54
|
||||
2: 2927047C455329BD
|
||||
3: 62905068423B826C
|
||||
4: 0BC0C92B5162FA20
|
||||
5: 03E6D71DE770BB3A
|
||||
6: 6D48AB1CE5EC49FB
|
||||
7: 338597E9545657E8
|
||||
8: 418BAF4EFB83DD50
|
||||
9: A47BA8181D187753
|
||||
10: 76FAA6B0FF3B9D4D
|
||||
11: C540C8A06345FAAE
|
||||
12: 67E454776D871265
|
||||
13: D4E0ABD317993766
|
||||
14: BD328F89D3C1FEA5
|
||||
15: 580E74CB054A9F7D
|
||||
16: 121002BF94F18D90
|
||||
|
||||
OMAC-multi2 (40 byte key)
|
||||
0: 3A06523F10C9F2C5
|
||||
1: 310F665F3A12E82A
|
||||
2: 459FB6A9AC69FE27
|
||||
3: DEB259E248440826
|
||||
4: 6598F16BC1BFB8C8
|
||||
5: B37DFDF8DD61D479
|
||||
6: 0CE3BD7843FC83C4
|
||||
7: 3BB7880A7E8D6C9E
|
||||
8: 74BAA5B4EEFCFDB5
|
||||
9: B71CC55A72D4BB4F
|
||||
10: BEF0C7D0781B368B
|
||||
11: 0CA0D02961398164
|
||||
12: CF3848FA94C45657
|
||||
13: 57EA86B185A210D3
|
||||
14: 05887EB7679F4B62
|
||||
15: F6A007FF4A175F82
|
||||
16: 57E61B59AC9F3240
|
||||
|
||||
OMAC-camellia (16 byte key)
|
||||
0: B5664C5148FFB45297703BCC46C19E4E
|
||||
1: 126EC31A554E8B3B635DE4617092ECE8
|
||||
2: FD57148685F4AA85AF48017AFD72B410
|
||||
3: 1427607464A408C1775B4036509E9659
|
||||
4: D8F5A7112CC8A9DF28B331FE7184BF08
|
||||
5: 0E29B0F09409DABECF645F05C4A5717C
|
||||
6: C4155442FDC29685028AF4AADEDCC266
|
||||
7: 92356ACB98AE2EDAABE0D3ED0C90772B
|
||||
8: AA3C828618F72258D91BC391876776C3
|
||||
9: 189458BA4D98E85802E7028E5C57A25F
|
||||
10: EE652D70328DA00D63B42A5E85D70E63
|
||||
11: F9D1E5F8E1539F2D657A047755CD232E
|
||||
12: 56FF5979FD3DEAD90EAAAF79A9AF1DCD
|
||||
13: 7E8B39D459D5AB449A8C5917B0CD0C4E
|
||||
14: 822D9B9C434C6FF7F0E5A25281740A91
|
||||
15: 654909D2836CCB06501CB359C717C1B9
|
||||
16: E8996FC89D47C91543B7BA3DC1C34B73
|
||||
17: DC29D51B2372DD7564CF56AF8702924F
|
||||
18: AD74D081197644DFE2723CABC991B1AC
|
||||
19: 26145C6DF074CA53125F6F386FBEA373
|
||||
20: 72C6C760A70FE410FAD113D8BE711D75
|
||||
21: 099D3B5802D7FB699B6B8F031BE10B3F
|
||||
22: A9D5DD3988A18AA7BC6F9C050BDBE8D2
|
||||
23: F7E99E4C3C7D127FF04FF325F7B06997
|
||||
24: E99A2F7547B5C6EDF3BC2EC2B8F05198
|
||||
25: 46C42FF49FCCFC49FBC99FEB08FEF10A
|
||||
26: DC349D600A754F73ACE6A7D2D00D3551
|
||||
27: FC2E5434ABBA44ABD9D724A9BB6CA2A6
|
||||
28: BA923927BF0074AD73BA8A6914194297
|
||||
29: 7DAB39F8D7E5CB93265568E6713C7CCD
|
||||
30: 9F60259B759B68E1C8F89CC36C7E170E
|
||||
31: 7D611F8BFEF0491CED8815C0E3D4CAFF
|
||||
32: 31E04DE5F9D1403C660E39891DE0D8DE
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
PMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are OMAC'ed. The initial key is
|
||||
of the same format (length specified per cipher). The OMAC key in step N+1 is the OMAC output of
|
||||
PMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are PMAC'ed. The initial key is
|
||||
of the same format (length specified per cipher). The PMAC key in step N+1 is the PMAC output of
|
||||
step N (repeated as required to fill the array).
|
||||
|
||||
PMAC-aes (16 byte key)
|
||||
@@ -57,23 +57,23 @@ PMAC-blowfish (8 byte key)
|
||||
16: BDFE0C7F0254BAD5
|
||||
|
||||
PMAC-xtea (16 byte key)
|
||||
0: A7EF6BB667216DDA
|
||||
1: B039E53812C4ABDC
|
||||
2: 87D2F8EA5FB6864D
|
||||
3: F85E3F4C1D9F5EFC
|
||||
4: 4EB749D982FB5FE2
|
||||
5: 0BFA0F172027441A
|
||||
6: FF82D01F36A6EC91
|
||||
7: 3BC2AA2028EBBD7A
|
||||
8: 15AA03A97A971E2A
|
||||
9: C974691F5D66B835
|
||||
10: 4FC7AA8F399A79ED
|
||||
11: 2633DA9E94673BAE
|
||||
12: 82A9FD48C5B60902
|
||||
13: 31BF6DA9EE0CE7E4
|
||||
14: 26B2538601B7620E
|
||||
15: D103F3C0B4579BE5
|
||||
16: 031346BA20CD87BC
|
||||
0: F5E28630DFDE34E0
|
||||
1: FFCC52D905DA5198
|
||||
2: 25198AB18B2B290D
|
||||
3: 18914E50791161E9
|
||||
4: 200F832212AD6747
|
||||
5: A9D09C41D734DDF7
|
||||
6: 32D7CCA3F4BD8215
|
||||
7: 91A1AA9389CD5D02
|
||||
8: 35CB1F77D7C25E2F
|
||||
9: D91EEE6D0A3874F3
|
||||
10: A42872686A8FF6F2
|
||||
11: 7568908634A79CBD
|
||||
12: 5B91A633D919BC34
|
||||
13: 32DCD17176896F1D
|
||||
14: 2BBBA64F30E672B6
|
||||
15: AFEB07DBC636AEED
|
||||
16: 7A417347CA03C598
|
||||
|
||||
PMAC-rc5 (8 byte key)
|
||||
0: C6B48F8DEC631F7C
|
||||
@@ -352,39 +352,39 @@ PMAC-cast5 (8 byte key)
|
||||
16: 87D907CACA80A138
|
||||
|
||||
PMAC-noekeon (16 byte key)
|
||||
0: A1E4C84B5958726557DF0855B37AA551
|
||||
1: 5DE20299CA919D3365B493D3D4895F92
|
||||
2: AF7E70C336571A857F62A18649EDB197
|
||||
3: C5F55CFE1AA119C352B64252AD246CBD
|
||||
4: FEF68A0CE08E8BA315B73B62F861824F
|
||||
5: 8321C2958DE4903DC12C42A8845ECC20
|
||||
6: 370466D1324AECF1F5B42E0E01381613
|
||||
7: 5CB900190F5CACBACFE5EAB0CC289D87
|
||||
8: A13C043E6CAAA1E34601A93C497446A4
|
||||
9: 865E11622A4CC8A9E1408E00F56C4543
|
||||
10: 9DC42C26868374649BD17D69D025CA1B
|
||||
11: 37D33C11B433C91DA09925CA9E86757A
|
||||
12: 1373D769C270E7137C953AC0F8F37941
|
||||
13: 7E81DEC583348B1E2F6267ECF82CB994
|
||||
14: 505B6329338556518FF364CAA730F5E8
|
||||
15: 0C085AEEB315968B0BDE904E8BBC6FD0
|
||||
16: 5FED63259364BE7E5133FF0507DD2D4C
|
||||
17: F7EE5C80A99AAEADB49E7CC69BFFF679
|
||||
18: 4388FA5E763A641130940EB705BEFD08
|
||||
19: 1BC31CA79EBE1674CEBE01BC9988267B
|
||||
20: BE88961637EFFE2D6905D104FEDD51A4
|
||||
21: 9C341004FB22AFCC496094E3207CA761
|
||||
22: B9DAA3620E38FFC7C5D5E7D2D8FE3DE4
|
||||
23: A38D2E571F037061B4400F1131FDBDEA
|
||||
24: 61DB71AE77A6EB47F2E9E14E8CBF2F4B
|
||||
25: 9903A072274CC048EF2C51493266D9ED
|
||||
26: 1EBEA421DD08859C17DDF39B20A82102
|
||||
27: F425858618E1A86F4912E4714EFB9E75
|
||||
28: 3B3D4EA07F7FE6DDFDD02D624ACDFC9F
|
||||
29: CEEE256591D701514EB17DF73B08A970
|
||||
30: 5CC56D5D46120C530A23B6C511C685FC
|
||||
31: 68E484CE18BE28EADD0BBF23291B8237
|
||||
32: ABD58A9CDF8AA68168A1A402074CF520
|
||||
0: 276019CC8E43A1B3F300C47B55B7AA22
|
||||
1: B93E353A2CC21CEAD81C91EC2FCD348E
|
||||
2: E8B9737CAD705C499F246744DCFE9641
|
||||
3: EF36B0FFB5439FF8668F35FD1822D0EA
|
||||
4: B7F5AD89538FC3F03923E98ADF95D0CC
|
||||
5: 558FCA30F602B4BC6697F44053875204
|
||||
6: 6B2D6D5A1CF670BE80E4BBB945CD3871
|
||||
7: 9CFA28FCA22EA12A13AC1093EF5D5EB9
|
||||
8: 04EDA6C71B9F1177F4A5368684FBBAFB
|
||||
9: 43C56B31D440EBECE4C74B90750A4653
|
||||
10: 23D5FA9AFFB2DC3DD372F22690487BAC
|
||||
11: FD61731F27CF8E791535AAB579A018B4
|
||||
12: 502D3A64FDED3CA2A2C8A5E986B27E03
|
||||
13: 1EABBC65B0A08F6CB15218E7153A6003
|
||||
14: B05DBC66CF92B045FC99395E9D405C4F
|
||||
15: EE841A0BF2C91C1E2078F06D022F2E6C
|
||||
16: EA749FBAC6BA9F672796C9D58A8C3294
|
||||
17: BBEF3CDFB93E5F462773579986F08374
|
||||
18: B17F7645F80BF5A2817C228987B43C03
|
||||
19: C995A102DFBB38FA397A4E508B85093D
|
||||
20: 9011CA395AC3FCD8594C13E67C22E95B
|
||||
21: 364BF53974D68B8BCF53CAADC5469DEC
|
||||
22: 5BAD7041372F28DE28BAAAC1A89C10A8
|
||||
23: 77874E908BFCE6F5E36888A484A754C0
|
||||
24: 9BDA525416A3129C55886134B79BAEDE
|
||||
25: 84E3201FA7958223B302D1BC2AC57D55
|
||||
26: 2B8FA1A95DADB4DC2F7A308D8E3D8C81
|
||||
27: F74EBF0ACCC187569BDE549F5FC96C36
|
||||
28: 7023D209F1965EC32253D11835CDFFA5
|
||||
29: C3C6397D9B0A1D741335882ACDFAC20D
|
||||
30: 7BC92905F2AF6754256BE087CC4F54DB
|
||||
31: 0BBA0A507767530F26C3A465DAB11359
|
||||
32: D2891C8EA1F574A6B2AB091057E0FB2C
|
||||
|
||||
PMAC-skipjack (10 byte key)
|
||||
0: 9CD94B75BC43B647
|
||||
@@ -459,3 +459,111 @@ PMAC-khazad (16 byte key)
|
||||
15: 93098DA8A180AA35
|
||||
16: BACE2F4DA8A89E32
|
||||
|
||||
PMAC-seed (16 byte key)
|
||||
0: 58844BC0C53AACF808587A7C35C37DE2
|
||||
1: 481E3E0831DF5AED135C71BBBD075F4A
|
||||
2: 11355F9D42E7BAD967DF90E9088D45A7
|
||||
3: 5E3F82EF0B3CA70DCB614C1016DDB052
|
||||
4: 35E283B0E6C538ED5F2DF4E004324865
|
||||
5: 56467B8BA87BDE89DF4A64DC9B9409CF
|
||||
6: 9315AAAE6CA0868FDCBC397B7DC2DF84
|
||||
7: A265D861DCE6C9B80CCFF92463DB27D3
|
||||
8: 196A0813E4EB49F47A1C3713950B194E
|
||||
9: 261372868D259E609BE5080F282B361A
|
||||
10: DFDC55CDF60A0CB6A33BC6F4B5E5A481
|
||||
11: 0BD99E075BC93386CDB40C2AAF8E8918
|
||||
12: CA1B80D0088D7267C9AFB037DCD8FA56
|
||||
13: 8EDBC9F77D4DAB3DFABEAB0891622F1C
|
||||
14: D1A8F869C961739ABFE7F401FA41D6F6
|
||||
15: 653041670E0BAD5D1FE77A19D9439CEE
|
||||
16: 440EF361908A528B2A3ED7C50C1A47AB
|
||||
17: DCE2613438A5DC42AC8F5CE753DDF01D
|
||||
18: F9E313156CA5345CECB1A5F963E9B201
|
||||
19: 34D72FB89BA3C41E1D0597531849C6C9
|
||||
20: 7ED20B28067BA27E37606387D641B75F
|
||||
21: 933A2E06DA91C208297305FFF4F7795B
|
||||
22: CC455E1FB196CF5B233921AA6A048B81
|
||||
23: 613AC1EE5B8D0C3123A18BED9A352980
|
||||
24: 00A2BBEEB98DB190A694B67EF85A65A4
|
||||
25: 1A7D50E6051D85CA81D9DD7DE81BF02E
|
||||
26: A7F948B36D7AF08FB405A1B8C8C6AC6D
|
||||
27: 967DC3981E7C718B562A93E5292B872F
|
||||
28: 2674544D8D3E3F750590992C0AFB36AF
|
||||
29: 193A2CC794CB285B4CB87197EE3550ED
|
||||
30: 312AAC97C92279428FB1AA0882DB7088
|
||||
31: 3B9CBA2FF7FF4113BB2DC0DF6BCADDD0
|
||||
32: 45C5C71122C70F4337F5EC74BA6B446D
|
||||
|
||||
PMAC-kasumi (16 byte key)
|
||||
0: 52DF2D9A9EB4816A
|
||||
1: 201C1024E6D2AF23
|
||||
2: 04E7B341BFC96D1A
|
||||
3: CC11D07594C50F31
|
||||
4: EE27EAEED00E2F97
|
||||
5: 51DB73EC42ADB789
|
||||
6: 097A5F01A90BFE7F
|
||||
7: 7FD121FD6B504A9D
|
||||
8: 8A09BC5C1E7FA48C
|
||||
9: B7A88328D7D84C9E
|
||||
10: 1D34173FA9F1DFCD
|
||||
11: 129AC84C0429E80E
|
||||
12: 81D236AC427123E4
|
||||
13: 72D4EFEDD56F6253
|
||||
14: ACFC8D6AF30F8B64
|
||||
15: C7F75094394C1765
|
||||
16: D95208BCB48FAA38
|
||||
|
||||
PMAC-multi2 (40 byte key)
|
||||
0: 4799ECD07D95FF68
|
||||
1: 5B94DBFD53C531D7
|
||||
2: DF09EDE792536619
|
||||
3: 01FB72E4EE79DFEF
|
||||
4: 4159642D6ED0D4D8
|
||||
5: B6909A449A0A85BB
|
||||
6: 20B167D3AA349DEA
|
||||
7: E550AAB246D99D92
|
||||
8: 5E1042397C86B08C
|
||||
9: 3789D96B64C85AC0
|
||||
10: 72C0921EF5B5DEDE
|
||||
11: 5923493300FA910E
|
||||
12: B589609B09B4D12F
|
||||
13: 5EA42FE501CD696D
|
||||
14: 4413763D2689108B
|
||||
15: 07207040BAFC8E6D
|
||||
16: 4E80F408AA6F1DD9
|
||||
|
||||
PMAC-camellia (16 byte key)
|
||||
0: 33C03F6AA205F3816A17DA92BEE0BAD2
|
||||
1: AD1EC293DD032511579235B2F29CC909
|
||||
2: E71363EAF5A311DCFB035C69BBCE5DC0
|
||||
3: 22661D6CD3496FB5C9B3D89FC62E3981
|
||||
4: B142A96AF9C481B61E55B7B5896847C4
|
||||
5: A286C0769989120F8A31A8DAD7574F22
|
||||
6: 09E711382FDB6B938C802D11A66EF657
|
||||
7: DF9ABA4F5CF5B0647F045C3AA631BB62
|
||||
8: 499A8F68DAEC7FE56E64DB59B0993741
|
||||
9: AFFDA4F40A1BDF673EE9123CAE321F16
|
||||
10: B6F2E39D0126AA85D9152C4457365235
|
||||
11: 2922AAC2FF4F0B77DEE4B3E28EF5094F
|
||||
12: 369D18F985D18B5ADDFFFC1151DE6BBA
|
||||
13: 1B7641D1A38C4114EE829B7D25BF0EFF
|
||||
14: DEF9092BA185FD5238A25C6FCF410C52
|
||||
15: D59FEE8047D64032329318DC7A2277B8
|
||||
16: B4561A4A092E031F8FE998FAC87F9BFB
|
||||
17: F27EF7D0823B056F692BA369D1B2E7B4
|
||||
18: F62C4F7B749CF31A6F5485BFDED7EEBD
|
||||
19: 22BD3AB334BE6E04C84D6197FF69CAE3
|
||||
20: E617D108BED8E9ACBA55FAF60863F8C3
|
||||
21: 0DB60AE0725D37855F3AF1DDF78E98EB
|
||||
22: C76DD5A075AB30AB66FC448BD19B6588
|
||||
23: 60231366598BEB2D16D33A1A8019B9A1
|
||||
24: 247E925C96064801490A1D062A0C1F18
|
||||
25: 1C1081E20DE3BE26FF24BEC3DFBA9BF2
|
||||
26: 3B16562B3CD862C00A03B7ADC99E46C5
|
||||
27: C1E8BA560851254640D523A0CEE846AF
|
||||
28: C36E8CF324A0A4EBC6C76EA01CDFD158
|
||||
29: EAED84E721777F5E30184E496DA2C0FA
|
||||
30: 6655CA0D8741440212AA0DB218E5C7FE
|
||||
31: D5C0143E1BA233BA5F862EE6E11A8F58
|
||||
32: C8DAF08BD68F4AE401C6663393C257CB
|
||||
|
||||
|
||||
11
libtomcrypt/notes/rsa-testvectors/makefile
Normal file
11
libtomcrypt/notes/rsa-testvectors/makefile
Normal file
@@ -0,0 +1,11 @@
|
||||
default: regen
|
||||
|
||||
clean:
|
||||
rm -f *.c
|
||||
|
||||
regen:
|
||||
python rt.py pss-vect.txt pss > pss-vect.c
|
||||
python rt.py oaep-vect.txt oaep > oaep-vect.c
|
||||
python rt.py pkcs1v15sign-vectors.txt emsa > pkcs1v15sign-vectors.c
|
||||
python rt.py pkcs1v15crypt-vectors.txt eme > pkcs1v15crypt-vectors.c
|
||||
|
||||
369
libtomcrypt/notes/rsa-testvectors/oaep-int.txt
Normal file
369
libtomcrypt/notes/rsa-testvectors/oaep-int.txt
Normal file
@@ -0,0 +1,369 @@
|
||||
# =================================
|
||||
# WORKED-OUT EXAMPLE FOR RSAES-OAEP
|
||||
# =================================
|
||||
#
|
||||
# This file gives an example of the process of
|
||||
# encrypting and decrypting a message with
|
||||
# RSAES-OAEP as specified in PKCS #1 v2.1.
|
||||
#
|
||||
# The message is a bit string of length 128,
|
||||
# while the size of the modulus in the public
|
||||
# key is 1024 bits. The second representation
|
||||
# of the private key is used, which means that
|
||||
# CRT is applied in the decryption process.
|
||||
#
|
||||
# The underlying hash function is SHA-1; the
|
||||
# mask generation function is MGF1 with SHA-1
|
||||
# as specified in PKCS #1 v2.1.
|
||||
#
|
||||
# This file also contains a demonstration of
|
||||
# the RSADP decryption primitive with CRT.
|
||||
# Finally, DER encodings of the RSA keys are
|
||||
# given at the end of the file.
|
||||
#
|
||||
#
|
||||
# Integers are represented by strings of octets
|
||||
# with the leftmost octet being the most
|
||||
# significant octet. For example,
|
||||
#
|
||||
# 9,202,000 = (0x)8c 69 50.
|
||||
#
|
||||
# =============================================
|
||||
|
||||
# ------------------------------
|
||||
# Components of the RSA Key Pair
|
||||
# ------------------------------
|
||||
|
||||
# RSA modulus n:
|
||||
bb f8 2f 09 06 82 ce 9c 23 38 ac 2b 9d a8 71 f7
|
||||
36 8d 07 ee d4 10 43 a4 40 d6 b6 f0 74 54 f5 1f
|
||||
b8 df ba af 03 5c 02 ab 61 ea 48 ce eb 6f cd 48
|
||||
76 ed 52 0d 60 e1 ec 46 19 71 9d 8a 5b 8b 80 7f
|
||||
af b8 e0 a3 df c7 37 72 3e e6 b4 b7 d9 3a 25 84
|
||||
ee 6a 64 9d 06 09 53 74 88 34 b2 45 45 98 39 4e
|
||||
e0 aa b1 2d 7b 61 a5 1f 52 7a 9a 41 f6 c1 68 7f
|
||||
e2 53 72 98 ca 2a 8f 59 46 f8 e5 fd 09 1d bd cb
|
||||
|
||||
# RSA public exponent e:
|
||||
(0x)11
|
||||
|
||||
# Prime p:
|
||||
ee cf ae 81 b1 b9 b3 c9 08 81 0b 10 a1 b5 60 01
|
||||
99 eb 9f 44 ae f4 fd a4 93 b8 1a 9e 3d 84 f6 32
|
||||
12 4e f0 23 6e 5d 1e 3b 7e 28 fa e7 aa 04 0a 2d
|
||||
5b 25 21 76 45 9d 1f 39 75 41 ba 2a 58 fb 65 99
|
||||
|
||||
# Prime q:
|
||||
c9 7f b1 f0 27 f4 53 f6 34 12 33 ea aa d1 d9 35
|
||||
3f 6c 42 d0 88 66 b1 d0 5a 0f 20 35 02 8b 9d 86
|
||||
98 40 b4 16 66 b4 2e 92 ea 0d a3 b4 32 04 b5 cf
|
||||
ce 33 52 52 4d 04 16 a5 a4 41 e7 00 af 46 15 03
|
||||
|
||||
# p's CRT exponent dP:
|
||||
54 49 4c a6 3e ba 03 37 e4 e2 40 23 fc d6 9a 5a
|
||||
eb 07 dd dc 01 83 a4 d0 ac 9b 54 b0 51 f2 b1 3e
|
||||
d9 49 09 75 ea b7 74 14 ff 59 c1 f7 69 2e 9a 2e
|
||||
20 2b 38 fc 91 0a 47 41 74 ad c9 3c 1f 67 c9 81
|
||||
|
||||
# q's CRT exponent dQ:
|
||||
47 1e 02 90 ff 0a f0 75 03 51 b7 f8 78 86 4c a9
|
||||
61 ad bd 3a 8a 7e 99 1c 5c 05 56 a9 4c 31 46 a7
|
||||
f9 80 3f 8f 6f 8a e3 42 e9 31 fd 8a e4 7a 22 0d
|
||||
1b 99 a4 95 84 98 07 fe 39 f9 24 5a 98 36 da 3d
|
||||
|
||||
# CRT coefficient qInv:
|
||||
b0 6c 4f da bb 63 01 19 8d 26 5b db ae 94 23 b3
|
||||
80 f2 71 f7 34 53 88 50 93 07 7f cd 39 e2 11 9f
|
||||
c9 86 32 15 4f 58 83 b1 67 a9 67 bf 40 2b 4e 9e
|
||||
2e 0f 96 56 e6 98 ea 36 66 ed fb 25 79 80 39 f7
|
||||
|
||||
# ----------------------------------
|
||||
# Step-by-step RSAES-OAEP Encryption
|
||||
# ----------------------------------
|
||||
|
||||
# Message M to be encrypted:
|
||||
d4 36 e9 95 69 fd 32 a7 c8 a0 5b bc 90 d3 2c 49
|
||||
|
||||
# Label L:
|
||||
(the empty string)
|
||||
|
||||
# lHash = Hash(L)
|
||||
# DB = lHash || Padding || M
|
||||
# seed = random string of octets
|
||||
# dbMask = MGF(seed, length(DB))
|
||||
# maskedDB = DB xor dbMask
|
||||
# seedMask = MGF(maskedDB, length(seed))
|
||||
# maskedSeed = seed xor seedMask
|
||||
# EM = 0x00 || maskedSeed || maskedDB
|
||||
|
||||
# lHash:
|
||||
da 39 a3 ee 5e 6b 4b 0d 32 55 bf ef 95 60 18 90
|
||||
af d8 07 09
|
||||
|
||||
# DB:
|
||||
da 39 a3 ee 5e 6b 4b 0d 32 55 bf ef 95 60 18 90
|
||||
af d8 07 09 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 01 d4 36 e9 95 69
|
||||
fd 32 a7 c8 a0 5b bc 90 d3 2c 49
|
||||
|
||||
# seed:
|
||||
aa fd 12 f6 59 ca e6 34 89 b4 79 e5 07 6d de c2
|
||||
f0 6c b5 8f
|
||||
|
||||
# dbMask:
|
||||
06 e1 de b2 36 9a a5 a5 c7 07 d8 2c 8e 4e 93 24
|
||||
8a c7 83 de e0 b2 c0 46 26 f5 af f9 3e dc fb 25
|
||||
c9 c2 b3 ff 8a e1 0e 83 9a 2d db 4c dc fe 4f f4
|
||||
77 28 b4 a1 b7 c1 36 2b aa d2 9a b4 8d 28 69 d5
|
||||
02 41 21 43 58 11 59 1b e3 92 f9 82 fb 3e 87 d0
|
||||
95 ae b4 04 48 db 97 2f 3a c1 4e af f4 9c 8c 3b
|
||||
7c fc 95 1a 51 ec d1 dd e6 12 64
|
||||
|
||||
# maskedDB:
|
||||
dc d8 7d 5c 68 f1 ee a8 f5 52 67 c3 1b 2e 8b b4
|
||||
25 1f 84 d7 e0 b2 c0 46 26 f5 af f9 3e dc fb 25
|
||||
c9 c2 b3 ff 8a e1 0e 83 9a 2d db 4c dc fe 4f f4
|
||||
77 28 b4 a1 b7 c1 36 2b aa d2 9a b4 8d 28 69 d5
|
||||
02 41 21 43 58 11 59 1b e3 92 f9 82 fb 3e 87 d0
|
||||
95 ae b4 04 48 db 97 2f 3a c1 4f 7b c2 75 19 52
|
||||
81 ce 32 d2 f1 b7 6d 4d 35 3e 2d
|
||||
|
||||
# seedMask:
|
||||
41 87 0b 5a b0 29 e6 57 d9 57 50 b5 4c 28 3c 08
|
||||
72 5d be a9
|
||||
|
||||
# maskedSeed:
|
||||
eb 7a 19 ac e9 e3 00 63 50 e3 29 50 4b 45 e2 ca
|
||||
82 31 0b 26
|
||||
|
||||
# EM = 00 || maskedSeed || maskedDB:
|
||||
00 eb 7a 19 ac e9 e3 00 63 50 e3 29 50 4b 45 e2
|
||||
ca 82 31 0b 26 dc d8 7d 5c 68 f1 ee a8 f5 52 67
|
||||
c3 1b 2e 8b b4 25 1f 84 d7 e0 b2 c0 46 26 f5 af
|
||||
f9 3e dc fb 25 c9 c2 b3 ff 8a e1 0e 83 9a 2d db
|
||||
4c dc fe 4f f4 77 28 b4 a1 b7 c1 36 2b aa d2 9a
|
||||
b4 8d 28 69 d5 02 41 21 43 58 11 59 1b e3 92 f9
|
||||
82 fb 3e 87 d0 95 ae b4 04 48 db 97 2f 3a c1 4f
|
||||
7b c2 75 19 52 81 ce 32 d2 f1 b7 6d 4d 35 3e 2d
|
||||
|
||||
# Ciphertext, the RSA encryption of EM:
|
||||
12 53 e0 4d c0 a5 39 7b b4 4a 7a b8 7e 9b f2 a0
|
||||
39 a3 3d 1e 99 6f c8 2a 94 cc d3 00 74 c9 5d f7
|
||||
63 72 20 17 06 9e 52 68 da 5d 1c 0b 4f 87 2c f6
|
||||
53 c1 1d f8 23 14 a6 79 68 df ea e2 8d ef 04 bb
|
||||
6d 84 b1 c3 1d 65 4a 19 70 e5 78 3b d6 eb 96 a0
|
||||
24 c2 ca 2f 4a 90 fe 9f 2e f5 c9 c1 40 e5 bb 48
|
||||
da 95 36 ad 87 00 c8 4f c9 13 0a de a7 4e 55 8d
|
||||
51 a7 4d df 85 d8 b5 0d e9 68 38 d6 06 3e 09 55
|
||||
|
||||
# --------------------------------------------
|
||||
# Step-by-step RSAES-OAEP Decryption Using CRT
|
||||
# --------------------------------------------
|
||||
|
||||
# c = the integer value of C above
|
||||
# m1 = c^dP mod p = (c mod p)^dP mod p
|
||||
# m2 = c^dQ mod q = (c mod q)^dQ mod q
|
||||
# h = (m1-m2)*qInv mod p
|
||||
# m = m2 + q*h = the integer value of EM above
|
||||
|
||||
# c mod p:
|
||||
de 63 d4 72 35 66 fa a7 59 bf e4 08 82 1d d5 25
|
||||
72 ec 92 85 4d df 87 a2 b6 64 d4 4d aa 37 ca 34
|
||||
6a 05 20 3d 82 ff 2d e8 e3 6c ec 1d 34 f9 8e b6
|
||||
05 e2 a7 d2 6d e7 af 36 9c e4 ec ae 14 e3 56 33
|
||||
|
||||
# c mod q:
|
||||
a2 d9 24 de d9 c3 6d 62 3e d9 a6 5b 5d 86 2c fb
|
||||
ec 8b 19 9c 64 27 9c 54 14 e6 41 19 6e f1 c9 3c
|
||||
50 7a 9b 52 13 88 1a ad 05 b4 cc fa 02 8a c1 ec
|
||||
61 42 09 74 bf 16 25 83 6b 0b 7d 05 fb b7 53 36
|
||||
|
||||
# m1:
|
||||
89 6c a2 6c d7 e4 87 1c 7f c9 68 a8 ed ea 11 e2
|
||||
71 82 4f 0e 03 65 52 17 94 f1 e9 e9 43 b4 a4 4b
|
||||
57 c9 e3 95 a1 46 74 78 f5 26 49 6b 4b b9 1f 1c
|
||||
ba ea 90 0f fc 60 2c f0 c6 63 6e ba 84 fc 9f f7
|
||||
|
||||
# m2:
|
||||
4e bb 22 75 85 f0 c1 31 2d ca 19 e0 b5 41 db 14
|
||||
99 fb f1 4e 27 0e 69 8e 23 9a 8c 27 a9 6c da 9a
|
||||
74 09 74 de 93 7b 5c 9c 93 ea d9 46 2c 65 75 02
|
||||
1a 23 d4 64 99 dc 9f 6b 35 89 75 59 60 8f 19 be
|
||||
|
||||
# h:
|
||||
01 2b 2b 24 15 0e 76 e1 59 bd 8d db 42 76 e0 7b
|
||||
fa c1 88 e0 8d 60 47 cf 0e fb 8a e2 ae bd f2 51
|
||||
c4 0e bc 23 dc fd 4a 34 42 43 94 ad a9 2c fc be
|
||||
1b 2e ff bb 60 fd fb 03 35 9a 95 36 8d 98 09 25
|
||||
|
||||
# m:
|
||||
00 eb 7a 19 ac e9 e3 00 63 50 e3 29 50 4b 45 e2
|
||||
ca 82 31 0b 26 dc d8 7d 5c 68 f1 ee a8 f5 52 67
|
||||
c3 1b 2e 8b b4 25 1f 84 d7 e0 b2 c0 46 26 f5 af
|
||||
f9 3e dc fb 25 c9 c2 b3 ff 8a e1 0e 83 9a 2d db
|
||||
4c dc fe 4f f4 77 28 b4 a1 b7 c1 36 2b aa d2 9a
|
||||
b4 8d 28 69 d5 02 41 21 43 58 11 59 1b e3 92 f9
|
||||
82 fb 3e 87 d0 95 ae b4 04 48 db 97 2f 3a c1 4f
|
||||
7b c2 75 19 52 81 ce 32 d2 f1 b7 6d 4d 35 3e 2d
|
||||
|
||||
# The intermediate values in the remaining
|
||||
# decryption process are the same as during
|
||||
# RSAES-OAEP encryption of M.
|
||||
|
||||
# =============================================
|
||||
|
||||
# ========================
|
||||
# DER Encoding of RSA Keys
|
||||
# ========================
|
||||
|
||||
# ------------
|
||||
# RSAPublicKey
|
||||
# ------------
|
||||
30 81 87
|
||||
# modulus
|
||||
02 81 81
|
||||
00 bb f8 2f 09 06 82 ce
|
||||
9c 23 38 ac 2b 9d a8 71
|
||||
f7 36 8d 07 ee d4 10 43
|
||||
a4 40 d6 b6 f0 74 54 f5
|
||||
1f b8 df ba af 03 5c 02
|
||||
ab 61 ea 48 ce eb 6f cd
|
||||
48 76 ed 52 0d 60 e1 ec
|
||||
46 19 71 9d 8a 5b 8b 80
|
||||
7f af b8 e0 a3 df c7 37
|
||||
72 3e e6 b4 b7 d9 3a 25
|
||||
84 ee 6a 64 9d 06 09 53
|
||||
74 88 34 b2 45 45 98 39
|
||||
4e e0 aa b1 2d 7b 61 a5
|
||||
1f 52 7a 9a 41 f6 c1 68
|
||||
7f e2 53 72 98 ca 2a 8f
|
||||
59 46 f8 e5 fd 09 1d bd
|
||||
cb
|
||||
# publicExponent
|
||||
02 01
|
||||
11
|
||||
|
||||
# -------------
|
||||
# RSAPrivateKey
|
||||
# -------------
|
||||
30 82 02 5b
|
||||
# version
|
||||
02 01
|
||||
00
|
||||
# modulus
|
||||
02 81 81
|
||||
00 bb f8 2f 09 06 82 ce
|
||||
9c 23 38 ac 2b 9d a8 71
|
||||
f7 36 8d 07 ee d4 10 43
|
||||
a4 40 d6 b6 f0 74 54 f5
|
||||
1f b8 df ba af 03 5c 02
|
||||
ab 61 ea 48 ce eb 6f cd
|
||||
48 76 ed 52 0d 60 e1 ec
|
||||
46 19 71 9d 8a 5b 8b 80
|
||||
7f af b8 e0 a3 df c7 37
|
||||
72 3e e6 b4 b7 d9 3a 25
|
||||
84 ee 6a 64 9d 06 09 53
|
||||
74 88 34 b2 45 45 98 39
|
||||
4e e0 aa b1 2d 7b 61 a5
|
||||
1f 52 7a 9a 41 f6 c1 68
|
||||
7f e2 53 72 98 ca 2a 8f
|
||||
59 46 f8 e5 fd 09 1d bd
|
||||
cb
|
||||
# publicExponent
|
||||
02 01
|
||||
11
|
||||
# privateExponent
|
||||
02 81 81
|
||||
00 a5 da fc 53 41 fa f2
|
||||
89 c4 b9 88 db 30 c1 cd
|
||||
f8 3f 31 25 1e 06 68 b4
|
||||
27 84 81 38 01 57 96 41
|
||||
b2 94 10 b3 c7 99 8d 6b
|
||||
c4 65 74 5e 5c 39 26 69
|
||||
d6 87 0d a2 c0 82 a9 39
|
||||
e3 7f dc b8 2e c9 3e da
|
||||
c9 7f f3 ad 59 50 ac cf
|
||||
bc 11 1c 76 f1 a9 52 94
|
||||
44 e5 6a af 68 c5 6c 09
|
||||
2c d3 8d c3 be f5 d2 0a
|
||||
93 99 26 ed 4f 74 a1 3e
|
||||
dd fb e1 a1 ce cc 48 94
|
||||
af 94 28 c2 b7 b8 88 3f
|
||||
e4 46 3a 4b c8 5b 1c b3
|
||||
c1
|
||||
# prime1
|
||||
02 41
|
||||
00 ee cf ae 81 b1 b9 b3
|
||||
c9 08 81 0b 10 a1 b5 60
|
||||
01 99 eb 9f 44 ae f4 fd
|
||||
a4 93 b8 1a 9e 3d 84 f6
|
||||
32 12 4e f0 23 6e 5d 1e
|
||||
3b 7e 28 fa e7 aa 04 0a
|
||||
2d 5b 25 21 76 45 9d 1f
|
||||
39 75 41 ba 2a 58 fb 65
|
||||
99
|
||||
# prime2
|
||||
02 41
|
||||
00 c9 7f b1 f0 27 f4 53
|
||||
f6 34 12 33 ea aa d1 d9
|
||||
35 3f 6c 42 d0 88 66 b1
|
||||
d0 5a 0f 20 35 02 8b 9d
|
||||
86 98 40 b4 16 66 b4 2e
|
||||
92 ea 0d a3 b4 32 04 b5
|
||||
cf ce 33 52 52 4d 04 16
|
||||
a5 a4 41 e7 00 af 46 15
|
||||
03
|
||||
# exponent1
|
||||
02 40
|
||||
54 49 4c a6 3e ba 03 37
|
||||
e4 e2 40 23 fc d6 9a 5a
|
||||
eb 07 dd dc 01 83 a4 d0
|
||||
ac 9b 54 b0 51 f2 b1 3e
|
||||
d9 49 09 75 ea b7 74 14
|
||||
ff 59 c1 f7 69 2e 9a 2e
|
||||
20 2b 38 fc 91 0a 47 41
|
||||
74 ad c9 3c 1f 67 c9 81
|
||||
# exponent2
|
||||
02 40
|
||||
47 1e 02 90 ff 0a f0 75
|
||||
03 51 b7 f8 78 86 4c a9
|
||||
61 ad bd 3a 8a 7e 99 1c
|
||||
5c 05 56 a9 4c 31 46 a7
|
||||
f9 80 3f 8f 6f 8a e3 42
|
||||
e9 31 fd 8a e4 7a 22 0d
|
||||
1b 99 a4 95 84 98 07 fe
|
||||
39 f9 24 5a 98 36 da 3d
|
||||
# coefficient
|
||||
02 41
|
||||
00 b0 6c 4f da bb 63 01
|
||||
19 8d 26 5b db ae 94 23
|
||||
b3 80 f2 71 f7 34 53 88
|
||||
50 93 07 7f cd 39 e2 11
|
||||
9f c9 86 32 15 4f 58 83
|
||||
b1 67 a9 67 bf 40 2b 4e
|
||||
9e 2e 0f 96 56 e6 98 ea
|
||||
36 66 ed fb 25 79 80 39
|
||||
f7
|
||||
|
||||
# ------------------------
|
||||
# PrivateKeyInfo (PKCS #8)
|
||||
# ------------------------
|
||||
30 82 02 75
|
||||
# version
|
||||
02 01
|
||||
00
|
||||
# privateKeyAlgorithmIdentifier
|
||||
30 0d
|
||||
06 09
|
||||
2a 86 48 86 f7 0d 01 01 01
|
||||
# parameters
|
||||
05 00
|
||||
# privateKey = RSAPrivateKey encoding
|
||||
04 82 02 5f
|
||||
# DER encoding of RSAPrivateKey structure
|
||||
30 82 02 5b ... 79 80 39 f7
|
||||
|
||||
# =============================================
|
||||
1418
libtomcrypt/notes/rsa-testvectors/oaep-vect.c
Normal file
1418
libtomcrypt/notes/rsa-testvectors/oaep-vect.c
Normal file
File diff suppressed because it is too large
Load Diff
2212
libtomcrypt/notes/rsa-testvectors/oaep-vect.txt
Normal file
2212
libtomcrypt/notes/rsa-testvectors/oaep-vect.txt
Normal file
File diff suppressed because it is too large
Load Diff
5463
libtomcrypt/notes/rsa-testvectors/pkcs1v15crypt-vectors.c
Normal file
5463
libtomcrypt/notes/rsa-testvectors/pkcs1v15crypt-vectors.c
Normal file
File diff suppressed because it is too large
Load Diff
9709
libtomcrypt/notes/rsa-testvectors/pkcs1v15crypt-vectors.txt
Normal file
9709
libtomcrypt/notes/rsa-testvectors/pkcs1v15crypt-vectors.txt
Normal file
File diff suppressed because it is too large
Load Diff
4261
libtomcrypt/notes/rsa-testvectors/pkcs1v15sign-vectors.c
Normal file
4261
libtomcrypt/notes/rsa-testvectors/pkcs1v15sign-vectors.c
Normal file
File diff suppressed because it is too large
Load Diff
9049
libtomcrypt/notes/rsa-testvectors/pkcs1v15sign-vectors.txt
Normal file
9049
libtomcrypt/notes/rsa-testvectors/pkcs1v15sign-vectors.txt
Normal file
File diff suppressed because it is too large
Load Diff
162
libtomcrypt/notes/rsa-testvectors/pss-int.txt
Normal file
162
libtomcrypt/notes/rsa-testvectors/pss-int.txt
Normal file
@@ -0,0 +1,162 @@
|
||||
# =================================
|
||||
# WORKED-OUT EXAMPLE FOR RSASSA-PSS
|
||||
# =================================
|
||||
#
|
||||
# This file gives an example of the process of
|
||||
# signing a message with RSASSA-PSS as
|
||||
# specified in PKCS #1 v2.1.
|
||||
#
|
||||
# The message is an octet string of length 114,
|
||||
# while the size of the modulus in the public
|
||||
# key is 1024 bits. The message is signed via a
|
||||
# random salt of length 20 octets
|
||||
#
|
||||
# The underlying hash function in the EMSA-PSS
|
||||
# encoding method is SHA-1; the mask generation
|
||||
# function is MGF1 with SHA-1 as specified in
|
||||
# PKCS #1 v2.1.
|
||||
#
|
||||
# Integers are represented by strings of octets
|
||||
# with the leftmost octet being the most
|
||||
# significant octet. For example,
|
||||
#
|
||||
# 9,202,000 = (0x)8c 69 50.
|
||||
#
|
||||
# =============================================
|
||||
|
||||
# ------------------------------
|
||||
# Components of the RSA Key Pair
|
||||
# ------------------------------
|
||||
|
||||
# RSA modulus n:
|
||||
a2 ba 40 ee 07 e3 b2 bd 2f 02 ce 22 7f 36 a1 95
|
||||
02 44 86 e4 9c 19 cb 41 bb bd fb ba 98 b2 2b 0e
|
||||
57 7c 2e ea ff a2 0d 88 3a 76 e6 5e 39 4c 69 d4
|
||||
b3 c0 5a 1e 8f ad da 27 ed b2 a4 2b c0 00 fe 88
|
||||
8b 9b 32 c2 2d 15 ad d0 cd 76 b3 e7 93 6e 19 95
|
||||
5b 22 0d d1 7d 4e a9 04 b1 ec 10 2b 2e 4d e7 75
|
||||
12 22 aa 99 15 10 24 c7 cb 41 cc 5e a2 1d 00 ee
|
||||
b4 1f 7c 80 08 34 d2 c6 e0 6b ce 3b ce 7e a9 a5
|
||||
|
||||
# RSA public exponent e:
|
||||
01 00 01
|
||||
|
||||
# Prime p:
|
||||
d1 7f 65 5b f2 7c 8b 16 d3 54 62 c9 05 cc 04 a2
|
||||
6f 37 e2 a6 7f a9 c0 ce 0d ce d4 72 39 4a 0d f7
|
||||
43 fe 7f 92 9e 37 8e fd b3 68 ed df f4 53 cf 00
|
||||
7a f6 d9 48 e0 ad e7 57 37 1f 8a 71 1e 27 8f 6b
|
||||
|
||||
# Prime q:
|
||||
c6 d9 2b 6f ee 74 14 d1 35 8c e1 54 6f b6 29 87
|
||||
53 0b 90 bd 15 e0 f1 49 63 a5 e2 63 5a db 69 34
|
||||
7e c0 c0 1b 2a b1 76 3f d8 ac 1a 59 2f b2 27 57
|
||||
46 3a 98 24 25 bb 97 a3 a4 37 c5 bf 86 d0 3f 2f
|
||||
|
||||
# p's CRT exponent dP:
|
||||
9d 0d bf 83 e5 ce 9e 4b 17 54 dc d5 cd 05 bc b7
|
||||
b5 5f 15 08 33 0e a4 9f 14 d4 e8 89 55 0f 82 56
|
||||
cb 5f 80 6d ff 34 b1 7a da 44 20 88 53 57 7d 08
|
||||
e4 26 28 90 ac f7 52 46 1c ea 05 54 76 01 bc 4f
|
||||
|
||||
# q's CRT exponent dQ:
|
||||
12 91 a5 24 c6 b7 c0 59 e9 0e 46 dc 83 b2 17 1e
|
||||
b3 fa 98 81 8f d1 79 b6 c8 bf 6c ec aa 47 63 03
|
||||
ab f2 83 fe 05 76 9c fc 49 57 88 fe 5b 1d df de
|
||||
9e 88 4a 3c d5 e9 36 b7 e9 55 eb f9 7e b5 63 b1
|
||||
|
||||
# CRT coefficient qInv:
|
||||
a6 3f 1d a3 8b 95 0c 9a d1 c6 7c e0 d6 77 ec 29
|
||||
14 cd 7d 40 06 2d f4 2a 67 eb 19 8a 17 6f 97 42
|
||||
aa c7 c5 fe a1 4f 22 97 66 2b 84 81 2c 4d ef c4
|
||||
9a 80 25 ab 43 82 28 6b e4 c0 37 88 dd 01 d6 9f
|
||||
|
||||
# ---------------------------------
|
||||
# Step-by-step RSASSA-PSS Signature
|
||||
# ---------------------------------
|
||||
|
||||
# Message M to be signed:
|
||||
85 9e ef 2f d7 8a ca 00 30 8b dc 47 11 93 bf 55
|
||||
bf 9d 78 db 8f 8a 67 2b 48 46 34 f3 c9 c2 6e 64
|
||||
78 ae 10 26 0f e0 dd 8c 08 2e 53 a5 29 3a f2 17
|
||||
3c d5 0c 6d 5d 35 4f eb f7 8b 26 02 1c 25 c0 27
|
||||
12 e7 8c d4 69 4c 9f 46 97 77 e4 51 e7 f8 e9 e0
|
||||
4c d3 73 9c 6b bf ed ae 48 7f b5 56 44 e9 ca 74
|
||||
ff 77 a5 3c b7 29 80 2f 6e d4 a5 ff a8 ba 15 98
|
||||
90 fc
|
||||
|
||||
# mHash = Hash(M)
|
||||
# salt = random string of octets
|
||||
# M' = Padding || mHash || salt
|
||||
# H = Hash(M')
|
||||
# DB = Padding || salt
|
||||
# dbMask = MGF(H, length(DB))
|
||||
# maskedDB = DB xor dbMask (leftmost bit set to
|
||||
# zero)
|
||||
# EM = maskedDB || H || 0xbc
|
||||
|
||||
# mHash:
|
||||
37 b6 6a e0 44 58 43 35 3d 47 ec b0 b4 fd 14 c1
|
||||
10 e6 2d 6a
|
||||
|
||||
# salt:
|
||||
e3 b5 d5 d0 02 c1 bc e5 0c 2b 65 ef 88 a1 88 d8
|
||||
3b ce 7e 61
|
||||
|
||||
# M':
|
||||
00 00 00 00 00 00 00 00 37 b6 6a e0 44 58 43 35
|
||||
3d 47 ec b0 b4 fd 14 c1 10 e6 2d 6a e3 b5 d5 d0
|
||||
02 c1 bc e5 0c 2b 65 ef 88 a1 88 d8 3b ce 7e 61
|
||||
|
||||
# H:
|
||||
df 1a 89 6f 9d 8b c8 16 d9 7c d7 a2 c4 3b ad 54
|
||||
6f be 8c fe
|
||||
|
||||
# DB:
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 01 e3 b5 d5 d0 02 c1 bc e5 0c
|
||||
2b 65 ef 88 a1 88 d8 3b ce 7e 61
|
||||
|
||||
# dbMask:
|
||||
66 e4 67 2e 83 6a d1 21 ba 24 4b ed 65 76 b8 67
|
||||
d9 a4 47 c2 8a 6e 66 a5 b8 7d ee 7f bc 7e 65 af
|
||||
50 57 f8 6f ae 89 84 d9 ba 7f 96 9a d6 fe 02 a4
|
||||
d7 5f 74 45 fe fd d8 5b 6d 3a 47 7c 28 d2 4b a1
|
||||
e3 75 6f 79 2d d1 dc e8 ca 94 44 0e cb 52 79 ec
|
||||
d3 18 3a 31 1f c8 97 39 a9 66 43 13 6e 8b 0f 46
|
||||
5e 87 a4 53 5c d4 c5 9b 10 02 8d
|
||||
|
||||
# maskedDB:
|
||||
66 e4 67 2e 83 6a d1 21 ba 24 4b ed 65 76 b8 67
|
||||
d9 a4 47 c2 8a 6e 66 a5 b8 7d ee 7f bc 7e 65 af
|
||||
50 57 f8 6f ae 89 84 d9 ba 7f 96 9a d6 fe 02 a4
|
||||
d7 5f 74 45 fe fd d8 5b 6d 3a 47 7c 28 d2 4b a1
|
||||
e3 75 6f 79 2d d1 dc e8 ca 94 44 0e cb 52 79 ec
|
||||
d3 18 3a 31 1f c8 96 da 1c b3 93 11 af 37 ea 4a
|
||||
75 e2 4b db fd 5c 1d a0 de 7c ec
|
||||
|
||||
# Encoded message EM:
|
||||
66 e4 67 2e 83 6a d1 21 ba 24 4b ed 65 76 b8 67
|
||||
d9 a4 47 c2 8a 6e 66 a5 b8 7d ee 7f bc 7e 65 af
|
||||
50 57 f8 6f ae 89 84 d9 ba 7f 96 9a d6 fe 02 a4
|
||||
d7 5f 74 45 fe fd d8 5b 6d 3a 47 7c 28 d2 4b a1
|
||||
e3 75 6f 79 2d d1 dc e8 ca 94 44 0e cb 52 79 ec
|
||||
d3 18 3a 31 1f c8 96 da 1c b3 93 11 af 37 ea 4a
|
||||
75 e2 4b db fd 5c 1d a0 de 7c ec df 1a 89 6f 9d
|
||||
8b c8 16 d9 7c d7 a2 c4 3b ad 54 6f be 8c fe bc
|
||||
|
||||
# Signature S, the RSA decryption of EM:
|
||||
8d aa 62 7d 3d e7 59 5d 63 05 6c 7e c6 59 e5 44
|
||||
06 f1 06 10 12 8b aa e8 21 c8 b2 a0 f3 93 6d 54
|
||||
dc 3b dc e4 66 89 f6 b7 95 1b b1 8e 84 05 42 76
|
||||
97 18 d5 71 5d 21 0d 85 ef bb 59 61 92 03 2c 42
|
||||
be 4c 29 97 2c 85 62 75 eb 6d 5a 45 f0 5f 51 87
|
||||
6f c6 74 3d ed dd 28 ca ec 9b b3 0e a9 9e 02 c3
|
||||
48 82 69 60 4f e4 97 f7 4c cd 7c 7f ca 16 71 89
|
||||
71 23 cb d3 0d ef 5d 54 a2 b5 53 6a d9 0a 74 7e
|
||||
|
||||
# =============================================
|
||||
1418
libtomcrypt/notes/rsa-testvectors/pss-vect.c
Normal file
1418
libtomcrypt/notes/rsa-testvectors/pss-vect.c
Normal file
File diff suppressed because it is too large
Load Diff
2581
libtomcrypt/notes/rsa-testvectors/pss-vect.txt
Normal file
2581
libtomcrypt/notes/rsa-testvectors/pss-vect.txt
Normal file
File diff suppressed because it is too large
Load Diff
22
libtomcrypt/notes/rsa-testvectors/readme.txt
Normal file
22
libtomcrypt/notes/rsa-testvectors/readme.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
====================
|
||||
pkcs-1v2-1-vec.zip
|
||||
====================
|
||||
|
||||
This directory contains test vectors for RSAES-OAEP and
|
||||
RSASSA-PSS as defined in PKCS #1 v2.1.
|
||||
|
||||
The files:
|
||||
|
||||
readme.txt This file.
|
||||
|
||||
oaep-vect.txt Test vectors for RSAES-OAEP encryption.
|
||||
|
||||
oaep-int.txt Intermediate values for RSAES-OAEP
|
||||
encryption and RSA decryption with CRT.
|
||||
Also, DER-encoded RSAPrivateKey and
|
||||
RSAPublicKey types.
|
||||
|
||||
pss-vect.txt Test vectors for RSASSA-PSS signing.
|
||||
|
||||
pss-int.txt Intermediate values for RSASSA-PSS
|
||||
signing.
|
||||
253
libtomcrypt/notes/rsa-testvectors/rt.py
Executable file
253
libtomcrypt/notes/rsa-testvectors/rt.py
Executable file
@@ -0,0 +1,253 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import os
|
||||
import hashlib
|
||||
|
||||
def md5_for_file(path, block_size=256*128):
|
||||
'''
|
||||
Block size directly depends on the block size of your filesystem
|
||||
to avoid performances issues
|
||||
Here I have blocks of 4096 octets (Default NTFS)
|
||||
'''
|
||||
md5 = hashlib.md5()
|
||||
with open(path,'rb') as f:
|
||||
for chunk in iter(lambda: f.read(block_size), b''):
|
||||
md5.update(chunk)
|
||||
f.close()
|
||||
return md5.hexdigest()
|
||||
|
||||
def read_until_ends(f, s):
|
||||
while True:
|
||||
l = f.readline()
|
||||
if l.strip().endswith(s):
|
||||
break
|
||||
return l
|
||||
|
||||
def read_until_start(f, s):
|
||||
while True:
|
||||
l = f.readline()
|
||||
if l.startswith(s):
|
||||
break
|
||||
return l
|
||||
|
||||
def read_hex(f):
|
||||
t = []
|
||||
while True:
|
||||
l = f.readline()
|
||||
if l.strip() == '':
|
||||
break
|
||||
t.extend(l.strip().split(' '))
|
||||
return t
|
||||
|
||||
class NamedData(object):
|
||||
def __init__(self, name, data):
|
||||
self.name = name
|
||||
self.data = data
|
||||
|
||||
def __str__(self):
|
||||
return " /* {0} */\n {1},\n {{ {2} }}\n".format(self.name, len(self.data), ', '.join('0x' + x for x in self.data))
|
||||
|
||||
def read_part(f, s):
|
||||
name = read_until_start(f, s).strip().lstrip('# ').rstrip(':')
|
||||
data = read_hex(f)
|
||||
e = NamedData(name, data)
|
||||
return e
|
||||
|
||||
class RsaKey(object):
|
||||
def __init__(self, n, e, d, p, q, dP, dQ, qInv):
|
||||
self.n = n
|
||||
self.e = e
|
||||
self.d = d
|
||||
self.p = p
|
||||
self.q = q
|
||||
self.dP = dP
|
||||
self.dQ = dQ
|
||||
self.qInv = qInv
|
||||
|
||||
def __str__(self):
|
||||
return "{{\n{0},\n{1},\n{2},\n{3},\n{4},\n{5},\n{6},\n{7}\n}}\n".format(self.n, self.e, self.d, self.p, self.q, self.dP, self.dQ, self.qInv)
|
||||
|
||||
def read_key(f):
|
||||
if ftype.version == 1:
|
||||
read_until_start(f, '# Private key')
|
||||
n = read_part(f, ftype.n)
|
||||
e = read_part(f, ftype.e)
|
||||
d = read_part(f, ftype.d)
|
||||
p = read_part(f, ftype.p)
|
||||
q = read_part(f, ftype.q)
|
||||
dP = read_part(f, ftype.dP)
|
||||
dQ = read_part(f, ftype.dQ)
|
||||
qInv = read_part(f, ftype.qInv)
|
||||
k = RsaKey(n, e, d, p, q, dP, dQ, qInv)
|
||||
return k
|
||||
|
||||
class Data(object):
|
||||
def __init__(self, name, obj1, obj2, obj3):
|
||||
self.name = name
|
||||
self.obj1 = obj1
|
||||
self.obj2 = obj2
|
||||
self.obj3 = obj3
|
||||
|
||||
def __str__(self):
|
||||
if self.obj3 == None:
|
||||
return "{{\n \"{0}\",\n{1},\n{2}\n}}\n,".format(self.name, self.obj1, self.obj2)
|
||||
else:
|
||||
return "{{\n \"{0}\",\n{1},\n{2},\n{3}\n}}\n,".format(self.name, self.obj1, self.obj2, self.obj3)
|
||||
|
||||
def read_data(f):
|
||||
name = read_until_start(f, ftype.o).strip().lstrip('# ')
|
||||
obj1 = read_part(f, ftype.o1)
|
||||
obj2 = read_part(f, ftype.o2)
|
||||
if ftype.name == 'emsa':
|
||||
obj3 = None
|
||||
else:
|
||||
obj3 = read_part(f, ftype.o3)
|
||||
s = Data(name, obj1, obj2, obj3)
|
||||
return s
|
||||
|
||||
class Example(object):
|
||||
def __init__(self, name, key, data):
|
||||
self.name = name
|
||||
self.key = key
|
||||
self.data = data
|
||||
|
||||
def __str__(self):
|
||||
res = "{{\n \"{0}\",\n{1},\n{{".format(self.name, str(self.key))
|
||||
for idx, d in enumerate(self.data, 1):
|
||||
if idx == 2:
|
||||
res += '#ifdef LTC_TEST_EXT\n'
|
||||
res += str(d) + '\n'
|
||||
if idx == ftype.numcases:
|
||||
res += '#endif /* LTC_TEST_EXT */\n'
|
||||
res += '}\n},'
|
||||
return res
|
||||
|
||||
def read_example(f):
|
||||
name = read_until_start(f, '# Example').strip().lstrip('# ')
|
||||
key = read_key(f)
|
||||
l = read_until_start(f, ftype.sod)
|
||||
d = []
|
||||
while l.strip().startswith(ftype.sod):
|
||||
if ftype.version == 1:
|
||||
f.seek(-len(l), os.SEEK_CUR)
|
||||
data = read_data(f)
|
||||
d.append(data)
|
||||
l = read_until_start(f, '#')
|
||||
|
||||
e = Example(name, key, d)
|
||||
f.seek(-len(l), os.SEEK_CUR)
|
||||
return e
|
||||
|
||||
|
||||
class PkcsType(object):
|
||||
def __init__(self, name):
|
||||
if name == 'pss':
|
||||
self.o = '# RSASSA-PSS Signature Example'
|
||||
self.o1 = '# Message to be signed'
|
||||
self.o2 = '# Salt'
|
||||
self.o3 = '# Signature'
|
||||
elif name == 'oaep':
|
||||
self.o = '# RSAES-OAEP Encryption Example'
|
||||
self.o1 = '# Message to be encrypted'
|
||||
self.o2 = '# Seed'
|
||||
self.o3 = '# Encryption'
|
||||
elif name == 'emsa':
|
||||
self.o = '# PKCS#1 v1.5 Signature Example'
|
||||
self.o1 = '# Message to be signed'
|
||||
self.o2 = '# Signature'
|
||||
elif name == 'eme':
|
||||
self.o = '# PKCS#1 v1.5 Encryption Example'
|
||||
self.o1 = '# Message'
|
||||
self.o2 = '# Seed'
|
||||
self.o3 = '# Encryption'
|
||||
else:
|
||||
raise ValueError('Type unknown: ' + name)
|
||||
|
||||
if name == 'pss' or name == 'oaep':
|
||||
self.version = 2
|
||||
self.numcases = 6
|
||||
self.n = '# RSA modulus n'
|
||||
self.e = '# RSA public exponent e'
|
||||
self.d = '# RSA private exponent d'
|
||||
self.p = '# Prime p'
|
||||
self.q = '# Prime q'
|
||||
self.dP = '# p\'s CRT exponent dP'
|
||||
self.dQ = '# q\'s CRT exponent dQ'
|
||||
self.qInv = '# CRT coefficient qInv'
|
||||
self.sod = '# --------------------------------'
|
||||
elif name == 'emsa' or name == 'eme':
|
||||
self.version = 1
|
||||
self.numcases = 20
|
||||
self.n = '# Modulus'
|
||||
self.e = '# Public exponent'
|
||||
self.d = '# Exponent'
|
||||
self.p = '# Prime 1'
|
||||
self.q = '# Prime 2'
|
||||
self.dP = '# Prime exponent 1'
|
||||
self.dQ = '# Prime exponent 2'
|
||||
self.qInv = '# Coefficient'
|
||||
self.sod = self.o
|
||||
self.name = name
|
||||
|
||||
ftype = PkcsType(sys.argv[2])
|
||||
|
||||
print('/* Generated from file: %s\n * with md5 hash: %s\n */\n' % (sys.argv[1], md5_for_file(sys.argv[1])))
|
||||
print('''
|
||||
typedef struct rsaKey {
|
||||
int n_l;
|
||||
unsigned char n[256];
|
||||
int e_l;
|
||||
unsigned char e[256];
|
||||
int d_l;
|
||||
unsigned char d[256];
|
||||
int p_l;
|
||||
unsigned char p[256];
|
||||
int q_l;
|
||||
unsigned char q[256];
|
||||
int dP_l;
|
||||
unsigned char dP[256];
|
||||
int dQ_l;
|
||||
unsigned char dQ[256];
|
||||
int qInv_l;
|
||||
unsigned char qInv[256];
|
||||
} rsaKey_t;
|
||||
|
||||
typedef struct rsaData {
|
||||
const char* name;
|
||||
int o1_l;
|
||||
unsigned char o1[256];
|
||||
int o2_l;
|
||||
unsigned char o2[256];''')
|
||||
|
||||
if ftype.name != 'emsa':
|
||||
print(''' int o3_l;
|
||||
unsigned char o3[256];''')
|
||||
|
||||
print('''} rsaData_t;
|
||||
|
||||
typedef struct testcase {
|
||||
const char* name;
|
||||
rsaKey_t rsa;
|
||||
#ifdef LTC_TEST_EXT
|
||||
rsaData_t data[%d];
|
||||
#else
|
||||
rsaData_t data[1];
|
||||
#endif /* LTC_TEST_EXT */
|
||||
} testcase_t;
|
||||
|
||||
testcase_t testcases_%s[] =
|
||||
{''' % (ftype.numcases, sys.argv[2]))
|
||||
|
||||
with open(sys.argv[1], 'rb') as f:
|
||||
ex = []
|
||||
while read_until_ends(f, '============================================='):
|
||||
if f.tell() == os.path.getsize(sys.argv[1]):
|
||||
break
|
||||
e = read_example(f)
|
||||
ex.append(e)
|
||||
|
||||
for i in ex:
|
||||
print(i)
|
||||
f.close()
|
||||
print('};\n')
|
||||
@@ -47,6 +47,6 @@ as a hash) CAST5 is perhaps a "runner-up" choice. CAST5 has been around longer
|
||||
fairly fast as well.
|
||||
|
||||
You can easily accomplish this via the "config.pl" script. Simply answer "n" to all of the ciphers except the one you want
|
||||
and then rebuild the library. [or you can hand edit mycrypt_custom.h]
|
||||
and then rebuild the library. [or you can hand edit tomcrypt_custom.h]
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user