Skip to content

Commit d9215be

Browse files
committed
Remove katja
1 parent e31e757 commit d9215be

File tree

16 files changed

+2
-978
lines changed

16 files changed

+2
-978
lines changed

demos/timing.c

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -821,78 +821,6 @@ static void time_rsa(void)
821821
static void time_rsa(void) { fprintf(stderr, "NO RSA\n"); }
822822
#endif
823823

824-
#if defined(LTC_MKAT)
825-
/* time various KAT operations */
826-
static void time_katja(void)
827-
{
828-
katja_key key;
829-
ulong64 t1, t2;
830-
unsigned char buf[2][4096];
831-
unsigned long x, y, z, zzz;
832-
int err, zz;
833-
834-
if (ltc_mp.name == NULL) return;
835-
836-
for (x = 1024; x <= 2048; x += 256) {
837-
t2 = 0;
838-
for (y = 0; y < 4; y++) {
839-
t_start();
840-
t1 = t_read();
841-
if ((err = katja_make_key(&yarrow_prng, find_prng("yarrow"), x/8, &key)) != CRYPT_OK) {
842-
fprintf(stderr, "\n\nkatja_make_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK));
843-
exit(EXIT_FAILURE);
844-
}
845-
t1 = t_read() - t1;
846-
t2 += t1;
847-
848-
if (y < 3) {
849-
katja_free(&key);
850-
}
851-
}
852-
t2 >>= 2;
853-
fprintf(stderr, "Katja-%lu make_key took %15"PRI64"u cycles\n", x, t2);
854-
855-
t2 = 0;
856-
for (y = 0; y < 16; y++) {
857-
t_start();
858-
t1 = t_read();
859-
z = sizeof(buf[1]);
860-
if ((err = katja_encrypt_key(buf[0], 32, buf[1], &z, "testprog", 8, &yarrow_prng,
861-
find_prng("yarrow"), find_hash("sha1"),
862-
&key)) != CRYPT_OK) {
863-
fprintf(stderr, "\n\nkatja_encrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK));
864-
exit(EXIT_FAILURE);
865-
}
866-
t1 = t_read() - t1;
867-
t2 += t1;
868-
}
869-
t2 >>= 4;
870-
fprintf(stderr, "Katja-%lu encrypt_key took %15"PRI64"u cycles\n", x, t2);
871-
872-
t2 = 0;
873-
for (y = 0; y < 2048; y++) {
874-
t_start();
875-
t1 = t_read();
876-
zzz = sizeof(buf[0]);
877-
if ((err = katja_decrypt_key(buf[1], z, buf[0], &zzz, "testprog", 8, find_hash("sha1"),
878-
&zz, &key)) != CRYPT_OK) {
879-
fprintf(stderr, "\n\nkatja_decrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK));
880-
exit(EXIT_FAILURE);
881-
}
882-
t1 = t_read() - t1;
883-
t2 += t1;
884-
}
885-
t2 >>= 11;
886-
fprintf(stderr, "Katja-%lu decrypt_key took %15"PRI64"u cycles\n", x, t2);
887-
888-
889-
katja_free(&key);
890-
}
891-
}
892-
#else
893-
static void time_katja(void) { fprintf(stderr, "NO Katja\n"); }
894-
#endif
895-
896824
#if defined(LTC_MDH)
897825
/* time various DH operations */
898826
static void time_dh(void)
@@ -1424,7 +1352,6 @@ const struct
14241352
LTC_TEST_FN(time_dsa),
14251353
LTC_TEST_FN(time_ecc),
14261354
LTC_TEST_FN(time_dh),
1427-
LTC_TEST_FN(time_katja)
14281355
};
14291356
char *single_test = NULL;
14301357
unsigned int i;

src/headers/tomcrypt_custom.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,6 @@
425425
#define LTC_DH8192
426426
#endif
427427

428-
/* Include Katja (a Rabin variant like RSA) */
429-
/* #define LTC_MKAT */
430-
431428
/* Digital Signature Algorithm */
432429
#define LTC_MDSA
433430

@@ -548,7 +545,7 @@
548545
#endif
549546
#endif
550547

551-
#if defined(LTC_MECC) || defined(LTC_MRSA) || defined(LTC_MDSA) || defined(LTC_MKAT)
548+
#if defined(LTC_MECC) || defined(LTC_MRSA) || defined(LTC_MDSA)
552549
/* Include the MPI functionality? (required by the PK algorithms) */
553550
#define LTC_MPI
554551

@@ -578,7 +575,7 @@
578575
#error ASN.1 DER requires MPI functionality
579576
#endif
580577

581-
#if (defined(LTC_MDSA) || defined(LTC_MRSA) || defined(LTC_MECC) || defined(LTC_MKAT)) && !defined(LTC_DER)
578+
#if (defined(LTC_MDSA) || defined(LTC_MRSA) || defined(LTC_MECC)) && !defined(LTC_DER)
582579
#error PK requires ASN.1 DER functionality, make sure LTC_DER is enabled
583580
#endif
584581

src/headers/tomcrypt_pk.h

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -126,61 +126,6 @@ int rsa_set_crt_params(const unsigned char *dP, unsigned long dPlen,
126126
rsa_key *key);
127127
#endif
128128

129-
/* ---- Katja ---- */
130-
#ifdef LTC_MKAT
131-
132-
/* Min and Max KAT key sizes (in bits) */
133-
#define MIN_KAT_SIZE 1024
134-
#define MAX_KAT_SIZE 4096
135-
136-
/** Katja PKCS style key */
137-
typedef struct KAT_key {
138-
/** Type of key, PK_PRIVATE or PK_PUBLIC */
139-
int type;
140-
/** The private exponent */
141-
void *d;
142-
/** The modulus */
143-
void *N;
144-
/** The p factor of N */
145-
void *p;
146-
/** The q factor of N */
147-
void *q;
148-
/** The 1/q mod p CRT param */
149-
void *qP;
150-
/** The d mod (p - 1) CRT param */
151-
void *dP;
152-
/** The d mod (q - 1) CRT param */
153-
void *dQ;
154-
/** The pq param */
155-
void *pq;
156-
} katja_key;
157-
158-
int katja_make_key(prng_state *prng, int wprng, int size, katja_key *key);
159-
160-
int katja_exptmod(const unsigned char *in, unsigned long inlen,
161-
unsigned char *out, unsigned long *outlen, int which,
162-
katja_key *key);
163-
164-
void katja_free(katja_key *key);
165-
166-
/* These use PKCS #1 v2.0 padding */
167-
int katja_encrypt_key(const unsigned char *in, unsigned long inlen,
168-
unsigned char *out, unsigned long *outlen,
169-
const unsigned char *lparam, unsigned long lparamlen,
170-
prng_state *prng, int prng_idx, int hash_idx, katja_key *key);
171-
172-
int katja_decrypt_key(const unsigned char *in, unsigned long inlen,
173-
unsigned char *out, unsigned long *outlen,
174-
const unsigned char *lparam, unsigned long lparamlen,
175-
int hash_idx, int *stat,
176-
katja_key *key);
177-
178-
/* PKCS #1 import/export */
179-
int katja_export(unsigned char *out, unsigned long *outlen, int type, katja_key *key);
180-
int katja_import(const unsigned char *in, unsigned long inlen, katja_key *key);
181-
182-
#endif
183-
184129
/* ---- DH Routines ---- */
185130
#ifdef LTC_MDH
186131

src/misc/crypt/crypt.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,6 @@ const char *crypt_build_settings =
353353
#if defined(LTC_MDSA)
354354
" DSA\n"
355355
#endif
356-
#if defined(LTC_MKAT)
357-
" Katja\n"
358-
#endif
359356
#if defined(LTC_PK_MAX_RETRIES)
360357
" "NAME_VALUE(LTC_PK_MAX_RETRIES)"\n"
361358
#endif

src/misc/crypt/crypt_constants.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,6 @@ static const crypt_constant _crypt_constants[] = {
9696
{"LTC_MRSA", 0},
9797
#endif
9898

99-
#ifdef LTC_MKAT
100-
{"LTC_MKAT", 1},
101-
_C_STRINGIFY(MIN_KAT_SIZE),
102-
_C_STRINGIFY(MAX_KAT_SIZE),
103-
#else
104-
{"LTC_MKAT", 0},
105-
#endif
106-
10799
#ifdef LTC_MECC
108100
{"LTC_MECC", 1},
109101
_C_STRINGIFY(ECC_BUF_SIZE),

src/misc/crypt/crypt_sizes.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,6 @@ static const crypt_size _crypt_sizes[] = {
249249
_SZ_STRINGIFY_T(ecc_point),
250250
_SZ_STRINGIFY_T(ecc_key),
251251
#endif
252-
#ifdef LTC_MKAT
253-
_SZ_STRINGIFY_T(katja_key),
254-
#endif
255252

256253
/* DER handling */
257254
#ifdef LTC_DER

src/pk/katja/katja_decrypt_key.c

Lines changed: 0 additions & 103 deletions
This file was deleted.

0 commit comments

Comments
 (0)