i_ecb.c 808 字节
Newer Older
R
Rich Salz 已提交
1 2
/*
 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3
 *
R
Rich Salz 已提交
4 5 6 7
 * 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
8 9
 */

10
#include <openssl/idea.h>
11
#include "idea_lcl.h"
12
#include <openssl/opensslv.h>
13

R
Rich Salz 已提交
14
const char *IDEA_options(void)
15
{
K
KaoruToda 已提交
16
    return "idea(int)";
17
}
18

R
Rich Salz 已提交
19
void IDEA_ecb_encrypt(const unsigned char *in, unsigned char *out,
20 21 22
                      IDEA_KEY_SCHEDULE *ks)
{
    unsigned long l0, l1, d[2];
23

24 25 26 27
    n2l(in, l0);
    d[0] = l0;
    n2l(in, l1);
    d[1] = l1;
R
Rich Salz 已提交
28
    IDEA_encrypt(d, ks);
29 30 31 32 33 34
    l0 = d[0];
    l2n(l0, out);
    l1 = d[1];
    l2n(l1, out);
    l0 = l1 = d[0] = d[1] = 0;
}