remove sha512 wrapper and use openssl directly

This commit is contained in:
IC Rainbow
2023-10-30 14:00:24 +02:00
parent 533e5737eb
commit f9f7781f09
5 changed files with 6 additions and 20 deletions

View File

@@ -1,9 +0,0 @@
#include <openssl/sha.h>
#include "sha512.h"
void crypto_hash_sha512 (unsigned char *out,
const unsigned char *in,
unsigned long long inlen)
{
SHA512(in, inlen, out);
}

View File

@@ -1,3 +0,0 @@
void crypto_hash_sha512 (unsigned char *out,
const unsigned char *in,
unsigned long long inlen);

View File

@@ -6,7 +6,7 @@
* - Christine van Vredendaal
*/
#include "sha512.h"
#include <openssl/sha.h>
#include "sntrup761.h"
#include "sxcrandom.h"
@@ -676,7 +676,7 @@ Hash_prefix (unsigned char *out, int b, const unsigned char *in, int inlen)
x[0] = b;
for (i = 0; i < inlen; ++i)
x[i + 1] = in[i];
crypto_hash_sha512 (h, x, inlen + 1);
SHA512 (x, inlen + 1, h);
for (i = 0; i < 32; ++i)
out[i] = h[i];
}

View File

@@ -20,7 +20,7 @@ category: Chat, Network, Web, System, Cryptography
extra-source-files:
- README.md
- CHANGELOG.md
- cbits/sha512.h
# - cbits/sha512.h
- cbits/sntrup761.h
- cbits/sxcrandom.h
@@ -91,11 +91,11 @@ when:
library:
source-dirs: src
c-sources:
- cbits/sha512.c
# - cbits/sha512.c
- cbits/sntrup761.c
- cbits/sxcrandom.c
include-dirs: cbits
extra-libraries: ssl crypto
extra-libraries: crypto
executables:
smp-server:

View File

@@ -26,7 +26,6 @@ build-type: Simple
extra-source-files:
README.md
CHANGELOG.md
cbits/sha512.h
cbits/sntrup761.h
cbits/sxcrandom.h
@@ -156,11 +155,10 @@ library
include-dirs:
cbits
c-sources:
cbits/sha512.c
cbits/sntrup761.c
cbits/sxcrandom.c
extra-libraries:
ssl crypto
crypto
build-depends:
aeson ==2.2.*
, ansi-terminal >=0.10 && <0.12