Fix build for g++

This commit is contained in:
ayy lmao
2022-07-06 18:19:23 +03:00
committed by lilmayofuksu
parent 850b282b70
commit 487b36a37e
3 changed files with 11 additions and 2 deletions

View File

@@ -3,12 +3,12 @@ fn main() {
.include("mhycrypto") .include("mhycrypto")
.cpp(true) .cpp(true)
.file("mhycrypto/aes.c") .file("mhycrypto/aes.cpp")
.file("mhycrypto/memecrypto.cpp") .file("mhycrypto/memecrypto.cpp")
.file("mhycrypto/metadata.cpp") .file("mhycrypto/metadata.cpp")
.file("mhycrypto/metadatastringdec.cpp") .file("mhycrypto/metadatastringdec.cpp")
.compile("mhycrypto"); .compile("mhycrypto");
tauri_build::build() tauri_build::build()
} }

View File

@@ -5,8 +5,11 @@
// http://en.wikipedia.org/wiki/Rijndael_key_schedule // http://en.wikipedia.org/wiki/Rijndael_key_schedule
// http://en.wikipedia.org/wiki/Rijndael_mix_columns // http://en.wikipedia.org/wiki/Rijndael_mix_columns
// http://en.wikipedia.org/wiki/Rijndael_S-box // http://en.wikipedia.org/wiki/Rijndael_S-box
// This code is public domain, or any OSI-approved license, your choice. No warranty. // This code is public domain, or any OSI-approved license, your choice. No warranty.
extern "C" {
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -383,3 +386,5 @@ void oqs_mhy128_dec_c(const uint8_t *ciphertext, const void *_schedule, uint8_t
// Reverse the first Round // Reverse the first Round
xor_round_key(plaintext, schedule, 0); xor_round_key(plaintext, schedule, 0);
} }
}

View File

@@ -6,6 +6,8 @@
#ifndef __OQS_AES_H #ifndef __OQS_AES_H
#define __OQS_AES_H #define __OQS_AES_H
extern "C" {
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
@@ -63,4 +65,6 @@ void OQS_AES128_ECB_enc_sch(const uint8_t *plaintext, const size_t plaintext_len
*/ */
void OQS_AES128_ECB_dec_sch(const uint8_t *ciphertext, const size_t ciphertext_len, const void *schedule, uint8_t *plaintext); void OQS_AES128_ECB_dec_sch(const uint8_t *ciphertext, const size_t ciphertext_len, const void *schedule, uint8_t *plaintext);
}
#endif #endif