sha_pad_buffer.c 231 B

1234567891011
  1. #include "sha_pad_buffer.h"
  2. #include <string.h>
  3. void sha_pad_buffer(uint8_t* buffer, size_t size) {
  4. if(size > 0) {
  5. buffer[0] = 0x80;
  6. if(size > 1) {
  7. memset(&buffer[1], 0, size - 1);
  8. }
  9. }
  10. }