mem.h 733 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright 2014-2022 The GmSSL Project. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the License); you may
  5. * not use this file except in compliance with the License.
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. */
  9. #ifndef GMSSL_MEM_H
  10. #define GMSSL_MEM_H
  11. #include <stdint.h>
  12. #include <stddef.h> // where size_t from
  13. void memxor(void *r, const void *a, size_t len);
  14. void gmssl_memxor(void *r, const void *a, const void *b, size_t len);
  15. int gmssl_secure_memcmp(const volatile void * volatile in_a, const volatile void * volatile in_b, size_t len);
  16. void gmssl_secure_clear(void *ptr, size_t len);
  17. int mem_is_zero(const uint8_t *buf, size_t len); // FIXME: uint8_t * to void *
  18. #endif