-/* $OpenBSD: blowfish.c,v 1.2 2024/03/27 11:54:29 jsing Exp $ */
+/* $OpenBSD: blowfish.c,v 1.3 2024/03/29 02:37:20 joshua Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
data[1] = l&0xffffffffL;
data[0] = r&0xffffffffL;
}
+LCRYPTO_ALIAS(BF_encrypt);
#ifndef BF_DEFAULT_OPTIONS
data[1] = l&0xffffffffL;
data[0] = r&0xffffffffL;
}
+LCRYPTO_ALIAS(BF_decrypt);
void
BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
tin0 = tin1 = tout0 = tout1 = xor0 = xor1 = 0;
tin[0] = tin[1] = 0;
}
+LCRYPTO_ALIAS(BF_cbc_encrypt);
/*
* The input and output encrypted as though 64bit cfb mode is being
v0 = v1 = ti[0] = ti[1] = t=c = cc = 0;
*num = n;
}
+LCRYPTO_ALIAS(BF_cfb64_encrypt);
void
BF_ecb_encrypt(const unsigned char *in, unsigned char *out,
l2n(l, out);
l = d[0] = d[1] = 0;
}
+LCRYPTO_ALIAS(BF_ecb_encrypt);
/*
* The input and output encrypted as though 64bit ofb mode is being
t = v0 = v1 = ti[0] = ti[1] = 0;
*num = n;
}
+LCRYPTO_ALIAS(BF_ofb64_encrypt);
void
BF_set_key(BF_KEY *key, int len, const unsigned char *data)
p[i + 1] = in[1];
}
}
+LCRYPTO_ALIAS(BF_set_key);
#endif
--- /dev/null
+/* $OpenBSD: blowfish.h,v 1.1 2024/03/29 02:37:20 joshua Exp $ */
+/*
+ * Copyright (c) 2024 Joshua Sing <joshua@joshuasing.dev>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _LIBCRYPTO_BLOWFISH_H
+#define _LIBCRYPTO_BLOWFISH_H
+
+#ifndef _MSC_VER
+#include_next <openssl/blowfish.h>
+#else
+#include "../include/openssl/blowfish.h"
+#endif
+#include "crypto_namespace.h"
+
+LCRYPTO_USED(BF_set_key);
+LCRYPTO_USED(BF_encrypt);
+LCRYPTO_USED(BF_decrypt);
+LCRYPTO_USED(BF_ecb_encrypt);
+LCRYPTO_USED(BF_cbc_encrypt);
+LCRYPTO_USED(BF_cfb64_encrypt);
+LCRYPTO_USED(BF_ofb64_encrypt);
+
+#endif /* _LIBCRYPTO_BLOWFISH_H */