summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/f.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/asn1/f.c (renamed from src/lib/libssl/src/crypto/idea/idea.h)61
1 files changed, 21 insertions, 40 deletions
diff --git a/src/lib/libssl/src/crypto/idea/idea.h b/src/lib/libcrypto/asn1/f.c
index 67132414ee..82bccdfd51 100644
--- a/src/lib/libssl/src/crypto/idea/idea.h
+++ b/src/lib/libcrypto/asn1/f.c
@@ -1,5 +1,5 @@
1/* crypto/idea/idea.h */ 1/* crypto/asn1/f.c */
2/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * This package is an SSL implementation written 5 * This package is an SSL implementation written
@@ -55,45 +55,26 @@
55 * copied and put under another distribution licence 55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58#include <stdio.h>
59#include <openssl/asn1.h>
60#include <openssl/err.h>
58 61
59#ifndef HEADER_IDEA_H 62main()
60#define HEADER_IDEA_H
61
62#ifdef OPENSSL_NO_IDEA
63#error IDEA is disabled.
64#endif
65
66#define IDEA_ENCRYPT 1
67#define IDEA_DECRYPT 0
68
69#include <openssl/opensslconf.h> /* IDEA_INT */
70#define IDEA_BLOCK 8
71#define IDEA_KEY_LENGTH 16
72
73#ifdef __cplusplus
74extern "C" {
75#endif
76
77typedef struct idea_key_st
78 { 63 {
79 IDEA_INT data[9][6]; 64 ASN1_TYPE *at;
80 } IDEA_KEY_SCHEDULE; 65 char buf[512];
66 int n;
67 long l;
81 68
82const char *idea_options(void); 69 at=ASN1_TYPE_new();
83void idea_ecb_encrypt(const unsigned char *in, unsigned char *out,
84 IDEA_KEY_SCHEDULE *ks);
85void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks);
86void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk);
87void idea_cbc_encrypt(const unsigned char *in, unsigned char *out,
88 long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,int enc);
89void idea_cfb64_encrypt(const unsigned char *in, unsigned char *out,
90 long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
91 int *num,int enc);
92void idea_ofb64_encrypt(const unsigned char *in, unsigned char *out,
93 long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int *num);
94void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks);
95#ifdef __cplusplus
96}
97#endif
98 70
99#endif 71 n=ASN1_TYPE_set_int_octetstring(at,98736,"01234567",8);
72 printf("%d\n",n);
73 n=ASN1_TYPE_get_int_octetstring(at,&l,buf,8);
74 buf[8]='\0';
75 printf("%ld %d %d\n",l,n,buf[8]);
76 buf[8]='\0';
77 printf("%s\n",buf);
78 ERR_load_crypto_strings();
79 ERR_print_errors_fp(stderr);
80 }