增加编译控制选项

This commit is contained in:
Simon
2021-07-17 08:56:42 -07:00
parent 4159e6ddf5
commit 5dfd357e16
9 changed files with 78 additions and 4 deletions

View File

@@ -47,6 +47,7 @@
*/
#ifndef NO_AES
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -478,3 +479,4 @@ void aes_decrypt(const AES_KEY *aes_key, const uint8_t in[16], uint8_t out[16])
memset(state, 0, sizeof(state));
}
#endif

View File

@@ -46,6 +46,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NO_CHACHA20
#include <stdio.h>
#include <string.h>
@@ -121,3 +122,4 @@ void chacha20_generate_keystream(CHACHA20_STATE *state, unsigned int counts, uns
state->d[12]++;
}
}
#endif

View File

@@ -46,6 +46,8 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NO_DES
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -265,3 +267,4 @@ void des_encrypt(DES_KEY *key, const unsigned char in[DES_BLOCK_SIZE],
PUTU64(out, T);
}
#endif

View File

@@ -45,10 +45,13 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NO_RC4
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <gmssl/rc4.h>
void rc4_set_key(RC4_STATE *state, const unsigned char *key, size_t keylen)
@@ -115,3 +118,5 @@ unsigned char rc4_generate_keybyte(RC4_STATE *state)
rc4_generate_keystream(state, 1, out);
return out[0];
}
#endif