2016-05-18 02:51:34 +08:00
|
|
|
/*
|
|
|
|
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
1998-12-21 18:52:47 +08:00
|
|
|
*
|
2016-05-18 02:51:34 +08:00
|
|
|
* Licensed under the OpenSSL license (the "License"). You may not use
|
|
|
|
* this file except in compliance with the License. You can obtain a copy
|
|
|
|
* in the file LICENSE in the source distribution or at
|
|
|
|
* https://www.openssl.org/source/license.html
|
1998-12-21 18:52:47 +08:00
|
|
|
*/
|
|
|
|
|
1999-04-24 06:13:45 +08:00
|
|
|
#include <openssl/idea.h>
|
1998-12-21 18:52:47 +08:00
|
|
|
#include "idea_lcl.h"
|
1999-04-24 06:13:45 +08:00
|
|
|
#include <openssl/opensslv.h>
|
1998-12-21 18:52:47 +08:00
|
|
|
|
2016-04-18 19:43:54 +08:00
|
|
|
const char *IDEA_options(void)
|
2015-01-22 11:40:55 +08:00
|
|
|
{
|
2016-01-28 07:43:25 +08:00
|
|
|
return ("idea(int)");
|
2015-01-22 11:40:55 +08:00
|
|
|
}
|
1998-12-21 18:52:47 +08:00
|
|
|
|
2016-04-18 19:43:54 +08:00
|
|
|
void IDEA_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
2015-01-22 11:40:55 +08:00
|
|
|
IDEA_KEY_SCHEDULE *ks)
|
|
|
|
{
|
|
|
|
unsigned long l0, l1, d[2];
|
1998-12-21 18:52:47 +08:00
|
|
|
|
2015-01-22 11:40:55 +08:00
|
|
|
n2l(in, l0);
|
|
|
|
d[0] = l0;
|
|
|
|
n2l(in, l1);
|
|
|
|
d[1] = l1;
|
2016-04-18 19:43:54 +08:00
|
|
|
IDEA_encrypt(d, ks);
|
2015-01-22 11:40:55 +08:00
|
|
|
l0 = d[0];
|
|
|
|
l2n(l0, out);
|
|
|
|
l1 = d[1];
|
|
|
|
l2n(l1, out);
|
|
|
|
l0 = l1 = d[0] = d[1] = 0;
|
|
|
|
}
|