unleashed-firmware/applications/external/totp/services/hmac/sha_pad_buffer.c

11 lines
231 B
C
Raw Normal View History

2023-04-28 11:04:16 +00:00
#include "sha_pad_buffer.h"
#include <string.h>
void sha_pad_buffer(uint8_t* buffer, size_t size) {
if(size > 0) {
buffer[0] = 0x80;
if(size > 1) {
memset(&buffer[1], 0, size - 1);
}
}
}