2016-05-17 18:51:34 +00:00
|
|
|
/*
|
|
|
|
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
1998-12-21 10:52:47 +00:00
|
|
|
*
|
2016-05-17 18:51:34 +00: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 10:52:47 +00:00
|
|
|
*/
|
|
|
|
|
1999-04-23 22:13:45 +00:00
|
|
|
#include <openssl/idea.h>
|
1998-12-21 10:52:47 +00:00
|
|
|
#include "idea_lcl.h"
|
1999-04-23 22:13:45 +00:00
|
|
|
#include <openssl/opensslv.h>
|
1998-12-21 10:52:47 +00:00
|
|
|
|
2016-04-18 11:43:54 +00:00
|
|
|
const char *IDEA_options(void)
|
2015-01-22 03:40:55 +00:00
|
|
|
{
|
2017-10-17 14:04:09 +00:00
|
|
|
return "idea(int)";
|
2015-01-22 03:40:55 +00:00
|
|
|
}
|
1998-12-21 10:52:47 +00:00
|
|
|
|
2016-04-18 11:43:54 +00:00
|
|
|
void IDEA_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
2015-01-22 03:40:55 +00:00
|
|
|
IDEA_KEY_SCHEDULE *ks)
|
|
|
|
{
|
|
|
|
unsigned long l0, l1, d[2];
|
1998-12-21 10:52:47 +00:00
|
|
|
|
2015-01-22 03:40:55 +00:00
|
|
|
n2l(in, l0);
|
|
|
|
d[0] = l0;
|
|
|
|
n2l(in, l1);
|
|
|
|
d[1] = l1;
|
2016-04-18 11:43:54 +00:00
|
|
|
IDEA_encrypt(d, ks);
|
2015-01-22 03:40:55 +00:00
|
|
|
l0 = d[0];
|
|
|
|
l2n(l0, out);
|
|
|
|
l1 = d[1];
|
|
|
|
l2n(l1, out);
|
|
|
|
l0 = l1 = d[0] = d[1] = 0;
|
|
|
|
}
|