plateform stringclasses 1
value | repo_name stringclasses 2
values | name stringlengths 1 78 | ext stringclasses 2
values | path stringlengths 15 1.11k | size int64 1 8.55M | source_encoding stringclasses 11
values | md5 stringlengths 32 32 | text stringlengths 0 8.49M |
|---|---|---|---|---|---|---|---|---|
google | android | pns | .c | platform/external/faad/pns.c | 6,407 | utf_8 | c25338f0d48f4afbd29f0df191a5eeb5 | /************************* MPEG-4 AAC Audio Decoder **************************
* *
* *
****************************************************************************/
/*
... |
google | android | dolby_adapt | .c | platform/external/faad/dolby_adapt.c | 22,812 | utf_8 | 618d58ecca09d3a576234ecbb7a87ef2 | /************************* MPEG-2 NBC Audio Decoder **************************
* *
* *
****************************************************************************/
/*
... |
google | android | decdata | .c | platform/external/faad/decdata.c | 7,364 | utf_8 | 509274f777a70c6569d23c06ef445c49 | /************************* MPEG-2 NBC Audio Decoder **************************
* *
* *
****************************************************************************/
#inc... |
google | android | huffinit | .c | platform/external/faad/huffinit.c | 4,279 | utf_8 | f74a0ec9a834a48972a3b798d68b6916 | /************************* MPEG-2 NBC Audio Decoder **************************
* *
* *
****************************************************************************/
#inc... |
google | android | intensity | .c | platform/external/faad/intensity.c | 3,566 | utf_8 | 571b74338fc9b1075d9620eed825402a | /************************* MPEG-2 NBC Audio Decoder **************************
* *
* *
****************************************************************************/
/*
... |
google | android | jsmn | .c | platform/external/jsmn/jsmn.c | 1,435 | utf_8 | 793571ccadd8b51f4aaba22e7ec2baf9 | /*
* SUCH DAMAGE.
*/
#define JSMN_IMPL
#include "jsmn.h" |
google | android | jsondump | .c | platform/external/jsmn/example/jsondump.c | 3,167 | utf_8 | 4af6000b1560d442720a41e00902e133 | #include "../jsmn.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
/* Function realloc_it() is a wrapper function for standard realloc()
* with one difference - it frees old memory pointer in case of realloc
* failure. Thus, DO NOT use old data pointer in anyway aft... |
google | android | simple | .c | platform/external/jsmn/example/simple.c | 2,410 | utf_8 | 704e9ceb2d4191ef116fb81c3da2736d | #include "../jsmn.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* A small example of jsmn parsing when JSON structure is known and number of
* tokens is predictable.
*/
static const char *JSON_STRING =
"{\"user\": \"johndoe\", \"admin\": false, \"uid\": 1000,\n "
"\"groups\": [\"users\"... |
google | android | tests | .c | platform/external/jsmn/test/tests.c | 11,618 | utf_8 | fc0c2df48f174a15885e7d41e7b495c0 | #include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "test.h"
#include "testutil.h"
int test_empty(void) {
check(parse("{}", 1, 1, JSMN_OBJECT, 0, 2, 0));
check(parse("[]", 1, 1, JSMN_ARRAY, 0, 2, 0));
check(parse("[{},{}]", 3, 3, JSMN_ARRAY, 0, 7, 2, JSMN_OBJECT, 1, 3, 0,
... |
google | android | wmediumd_gen_config | .c | platform/external/wmediumd/util/wmediumd_gen_config.c | 8,970 | utf_8 | 8bf4f8e7d39026044cb0a54f096825f4 | #include <ctype.h>
#include <errno.h>
#include <getopt.h>
#include <libconfig.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAC_ADDR_LEN 6
#define STR_MAC_ADDR_LEN 17
#define OPENWRT_MAC_ADDR_1 "42:00:00:00:00:00"
#define OPENWRT_MAC_A... |
google | android | wmediumd | .c | platform/external/wmediumd/wmediumd/wmediumd.c | 57,783 | utf_8 | 27edfa16e903a35cdf493d5c2db5f0d3 | /*
* wmediumd, wireless medium simulator for mac80211_hwsim kernel module
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
#include <netlink/netlink.h>
#include <netlink/genl/genl.h>
#include <netlink/genl/ctrl.h>
#include <netlink/genl/family.h>
#include <assert.h>
#include <st... |
google | android | config | .c | platform/external/wmediumd/wmediumd/config.c | 19,446 | utf_8 | 56bdbc0d5a0e613c3a4f93a7d27002bb | /*
* wmediumd, wireless medium simulator for mac80211_hwsim kernel module
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
#include <sys/timerfd.h>
#include <libconfig.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <math.h>
#include "wmediumd.h"
#include ... |
google | android | per | .c | platform/external/wmediumd/wmediumd/per.c | 6,166 | utf_8 | 31c304ff6299141d8a5e8e761613271d | /*
* Generate packet error rates for OFDM rates given signal level and
* packet length.
*/
#include <stdio.h>
#include <unistd.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "wmediumd.h"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
/* Code rates for convolutional cod... |
google | android | pmsr | .c | platform/external/wmediumd/wmediumd/pmsr.c | 5,666 | utf_8 | f7286450fa18daa041aa84ebc0dd932a | /*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
#include "pmsr.h"
#include <errno.h>
#include <stdio.h>
static int parse_pmsr_request_ftm(struct nlattr *req,
struct pmsr_request_ftm *out)
{
struct nlattr *tb[NL80211_PMSR_FTM_REQ_ATTR_MAX + 1];
nla_parse_nested(tb, NL8... |
google | android | loop | .c | platform/external/wmediumd/wmediumd/lib/loop.c | 1,696 | utf_8 | 85b7967bd7bfee3331e39ec5d8e480e2 | /*
*/
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <usfstl/loop.h>
#include <usfstl/list.h>
#include <assert.h>
#ifdef _WIN32
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
#include <winsock2.h>
#include <windows.h>
#else
#include <sys/select.h>
#endif
struct usfstl_list g... |
google | android | wallclock | .c | platform/external/wmediumd/wmediumd/lib/wallclock.c | 3,768 | utf_8 | e8600bf7fefcc734bc5d7c1499f1f8d2 | /*
*/
#include <stddef.h>
#include <stdint.h>
#include <time.h>
#include <sys/timerfd.h>
#include <usfstl/sched.h>
#include <usfstl/loop.h>
void usfstl_sched_wallclock_handle_fd(struct usfstl_loop_entry *entry)
{
struct usfstl_scheduler *sched;
uint64_t v;
sched = container_of(entry, struct usfstl_scheduler, wallcl... |
google | android | vhost | .c | platform/external/wmediumd/wmediumd/lib/vhost.c | 25,013 | utf_8 | 69254f0ced78bff541e5bc024e0b7040 | /*
*/
#include <stdlib.h>
#include <usfstl/list.h>
#include <usfstl/loop.h>
#include <usfstl/uds.h>
#include <sys/socket.h>
#include <sys/mman.h>
#include <sys/un.h>
#include <stdlib.h>
#include <errno.h>
#include <usfstl/vhost.h>
#include <linux/virtio_ring.h>
#include <linux/virtio_config.h>
#include <endian.h>
/* c... |
google | android | sched | .c | platform/external/wmediumd/wmediumd/lib/sched.c | 12,330 | utf_8 | f1c8016c07a125f6bc1f6c0737265e5e | /*
*/
#include <stddef.h>
#include <stdint.h>
#include <usfstl/assert.h>
#include <usfstl/sched.h>
#include <usfstl/list.h>
#include "internal.h"
uint64_t usfstl_sched_current_time(struct usfstl_scheduler *sched)
{
uint64_t current_time;
if (!sched->external_sync_from || !sched->waiting)
return sched->current_time... |
google | android | uds | .c | platform/external/wmediumd/wmediumd/lib/uds.c | 3,488 | utf_8 | a90d96eebad7bdda7069364bdd730397 | /*
*/
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <errno.h>
#include <usfstl/assert.h>
#include <usfstl/loop.h>
#include <usfstl/list.h>
#include "internal.h"
struc... |
google | android | schedctrl | .c | platform/external/wmediumd/wmediumd/lib/schedctrl.c | 6,311 | utf_8 | 7891903c21105fb1df107b3cea6b4936 | /*
*/
#include <usfstl/uds.h>
#include <usfstl/schedctrl.h>
#include <linux/um_timetravel.h>
#include "internal.h"
#include <stdio.h>
#include <stdlib.h>
static void _usfstl_sched_ctrl_send_msg(struct usfstl_sched_ctrl *ctrl,
enum um_timetravel_ops op,
uint64_t time, uint32_t seq)
{
struct um_timetravel_msg... |
google | android | wmediumd_ack_test_client | .c | platform/external/wmediumd/tests/wmediumd_ack_test_client.c | 3,858 | utf_8 | a733c19823508de6d40c0694ab51458e | #include <errno.h>
#include <getopt.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include "wmediumd/api.h"
void print_help(int exit_code) {
printf(
"wmediumd_ack_test_client - test client for wmediumd crash th... |
google | android | 2common | .c | platform/external/vboot_reference/firmware/2lib/2common.c | 2,504 | utf_8 | 0d32396b0e5b46f517e8847d10557e1e | *
* Common functions between firmware and kernel verified boot.
* (Firmware portion)
*/
#include "2sysincludes.h"
#include "2common.h"
#include "2rsa.h"
#include "2sha.h"
int vb2_safe_memcmp(const void *s1, const void *s2, size_t size)
{
const unsigned char *us1 = s1;
const unsigned char *us2 = s2;
int result = ... |
google | android | 2sha512 | .c | platform/external/vboot_reference/firmware/2lib/2sha512.c | 11,646 | utf_8 | f1c3ee4e38baca4ec303d774251115f4 | /* SHA-256 and SHA-512 implementation based on code by Oliver Gay
* without specific prior written permission.
*
* SUCH DAMAGE.
*/
#include "2sysincludes.h"
#include "2common.h"
#include "2sha.h"
#define SHFR(x, n) (x >> n)
#define ROTR(x, n) ((x >> n) | (x << ((sizeof(x) << 3) - n)))
#define ROTL(x, n) (... |
google | android | 2stub | .c | platform/external/vboot_reference/firmware/2lib/2stub.c | 1,379 | utf_8 | 01b72f96d5418217ffac9069d6c56b1b | *
* Stub API implementations which should be implemented by the caller.
*/
#include <stdarg.h>
#include <stdio.h>
#include "2sysincludes.h"
#include "2api.h"
__attribute__((weak))
void vb2ex_printf(const char *func, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
fprintf(stderr, "%s: ", func);
vfprintf(st... |
google | android | 2sha_utility | .c | platform/external/vboot_reference/firmware/2lib/2sha_utility.c | 3,373 | utf_8 | 31f61c07220a48d35a5bc4bf4a696877 | *
* Utility functions for message digest functions.
*/
#include "2sysincludes.h"
#include "2common.h"
#include "2rsa.h"
#include "2sha.h"
#if VB2_SUPPORT_SHA1
#define CTH_SHA1 VB2_HASH_SHA1
#else
#define CTH_SHA1 VB2_HASH_INVALID
#endif
#if VB2_SUPPORT_SHA256
#define CTH_SHA256 VB2_HASH_SHA256
#else
#define CTH_SHA2... |
google | android | 2rsa | .c | platform/external/vboot_reference/firmware/2lib/2rsa.c | 8,819 | utf_8 | 003456bddbd86f2e665f2e24ddfe7697 | */
/*
* Implementation of RSA signature verification which uses a pre-processed key
* for computation. The code extends Android's RSA verification code to support
* multiple RSA key lengths and hash digest algorithms.
*/
#include "2sysincludes.h"
#include "2common.h"
#include "2rsa.h"
#include "2sha.h"
/**
* a[] ... |
google | android | 2tpm_bootmode | .c | platform/external/vboot_reference/firmware/2lib/2tpm_bootmode.c | 1,826 | utf_8 | aee83cc98b0a557828a96785f5e7961f | *
* Functions for updating the TPM state with the status of boot path.
*/
#include "2sysincludes.h"
#include "2common.h"
#include "2sha.h"
#include "2tpm_bootmode.h"
/*
* Input digests for PCR extend.
* These are calculated as:
* SHA1("|Developer_Mode||Recovery_Mode||Keyblock_Mode|").
* Developer_Mode can be ... |
google | android | 2nvstorage | .c | platform/external/vboot_reference/firmware/2lib/2nvstorage.c | 8,154 | utf_8 | 88c975202d412d0f5cf8dbdcfe346767 | */
/* Non-volatile storage routines */
#include "2sysincludes.h"
#include "2common.h"
#include "2crc8.h"
#include "2misc.h"
#include "2nvstorage.h"
#include "2nvstorage_fields.h"
static void vb2_nv_regen_crc(struct vb2_context *ctx)
{
ctx->nvdata[VB2_NV_OFFS_CRC] = vb2_crc8(ctx->nvdata, VB2_NV_OFFS_CRC);
ctx->flags ... |
google | android | 2crc8 | .c | platform/external/vboot_reference/firmware/2lib/2crc8.c | 660 | utf_8 | f4304ce9d98359ee5fe5801087e3290b | */
#include "2sysincludes.h"
#include "2crc8.h"
uint8_t vb2_crc8(const void *vptr, uint32_t size)
{
const uint8_t *data = vptr;
unsigned crc = 0;
uint32_t i, j;
/*
* Calculate CRC-8 directly. A table-based algorithm would be faster,
* but for only a few bytes it isn't worth the code size.
*/
for (j = size;... |
google | android | 2sha256 | .c | platform/external/vboot_reference/firmware/2lib/2sha256.c | 11,303 | utf_8 | ebfc8a4855e1b80a40f7987d8d5e8499 | /* SHA-256 and SHA-512 implementation based on code by Oliver Gay
* without specific prior written permission.
*
* SUCH DAMAGE.
*/
#include "2sysincludes.h"
#include "2common.h"
#include "2sha.h"
#define SHFR(x, n) (x >> n)
#define ROTR(x, n) ((x >> n) | (x << ((sizeof(x) << 3) - n)))
#define ROTL(x, n) (... |
google | android | 2misc | .c | platform/external/vboot_reference/firmware/2lib/2misc.c | 10,127 | utf_8 | 808cf8f357b40e6913fc7b024c3e84c5 | *
* Misc functions which need access to vb2_context but are not public APIs
*/
#include "2sysincludes.h"
#include "2api.h"
#include "2common.h"
#include "2misc.h"
#include "2nvstorage.h"
#include "2secdata.h"
#include "2sha.h"
#include "2rsa.h"
int vb2_validate_gbb_signature(uint8_t *sig) {
const static uint8_t sig... |
google | android | 2secdata | .c | platform/external/vboot_reference/firmware/2lib/2secdata.c | 2,855 | utf_8 | 76780a322e0808d271656ac07723157b | *
* Secure storage APIs
*/
#include "2sysincludes.h"
#include "2common.h"
#include "2crc8.h"
#include "2misc.h"
#include "2secdata.h"
int vb2_secdata_check_crc(const struct vb2_context *ctx)
{
const struct vb2_secdata *sec =
(const struct vb2_secdata *)ctx->secdata;
/* Verify CRC */
if (sec->crc8 != vb2_crc8(se... |
google | android | 2sha1 | .c | platform/external/vboot_reference/firmware/2lib/2sha1.c | 6,235 | utf_8 | 03aa091ba02c15fd10b78259d283fde7 | *
* SHA-1 implementation largely based on libmincrypt in the the Android
* Open Source Project (platorm/system/core.git/libmincrypt/sha.c
*/
#include "2sysincludes.h"
#include "2common.h"
#include "2sha.h"
/*
* Some machines lack byteswap.h and endian.h. These have to use the
* slower code, even if they're little... |
google | android | 2api | .c | platform/external/vboot_reference/firmware/2lib/2api.c | 3,633 | utf_8 | 17edc7d6a994c8f6a8702fe59e7eab36 | *
* Externally-callable APIs
* (Firmware portion)
*/
#include "2sysincludes.h"
#include "2api.h"
#include "2common.h"
#include "2misc.h"
#include "2nvstorage.h"
#include "2secdata.h"
#include "2sha.h"
#include "2rsa.h"
#include "2tpm_bootmode.h"
int vb2api_secdata_check(const struct vb2_context *ctx)
{
return vb2_... |
google | android | utility_stub | .c | platform/external/vboot_reference/firmware/stub/utility_stub.c | 720 | utf_8 | 5af276adc4165fc226e2080644ab6f13 | *
* Stub implementations of utility functions which call their linux-specific
* equivalents.
*/
#include <stdint.h>
#define _STUB_IMPLEMENTATION_
#include "utility.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
int Memcmp(const void *src1, const void *src2, s... |
google | android | tpm_lite_stub | .c | platform/external/vboot_reference/firmware/stub/tpm_lite_stub.c | 6,886 | utf_8 | 00a3cf807e81ce5ae034f4dff13710ef | *
* Stub implementations of utility functions which call their linux-specific
* equivalents.
*/
#include <stdint.h>
#define _STUB_IMPLEMENTATION_
#include "tlcl.h"
#include "tlcl_internal.h"
#include "utility.h"
#include "vboot_api.h"
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#inc... |
google | android | vboot_api_stub_sf | .c | platform/external/vboot_reference/firmware/stub/vboot_api_stub_sf.c | 2,548 | utf_8 | f7234d60c8fbb04350e4bea7947c1556 | *
* Stub implementations of firmware-provided API functions.
*/
#include <execinfo.h>
#include <stdint.h>
#define _STUB_IMPLEMENTATION_
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include "vboot_api.h"
#define MAX_STACK_LEVELS 10
/* Keep track of nodes that a... |
google | android | vboot_api_stub | .c | platform/external/vboot_reference/firmware/stub/vboot_api_stub.c | 3,144 | utf_8 | b58260b54ee33d183898763f43aa96d1 | *
* Stub implementations of firmware-provided API functions.
*/
#include <stdint.h>
#define _STUB_IMPLEMENTATION_
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include "vboot_api.h"
static enum VbEcBootMode_t vboot_mode;
void VbExSleepMs(uint32_t msec)
{
}
VbEr... |
google | android | vboot_api_stub_stream | .c | platform/external/vboot_reference/firmware/stub/vboot_api_stub_stream.c | 1,786 | utf_8 | cac2223c4e165828d268d8e8762afcd7 | *
* Stub implementations of stream APIs.
*/
#include <stdint.h>
#define _STUB_IMPLEMENTATION_
#include "vboot_api.h"
/* The stub implementation assumes 512-byte disk sectors */
#define LBA_BYTES 512
/* Internal struct to simulate a stream for sector-based disks */
struct disk_stream {
/* Disk handle */
VbExDiskHan... |
google | android | vboot_api_stub_region | .c | platform/external/vboot_reference/firmware/stub/vboot_api_stub_region.c | 487 | utf_8 | b7569a2f245f4069840636e4ac472604 | *
* Stub implementations of region API function.
*/
#include <stdint.h>
#define _STUB_IMPLEMENTATION_
#include <stdlib.h>
#include "vboot_api.h"
VbError_t VbExRegionRead(VbCommonParams *cparams,
enum vb_firmware_region region, uint32_t offset,
uint32_t size, void *buf)
{
return VBERROR_SUCCESS;
} |
google | android | vboot_api_stub_static_sf | .c | platform/external/vboot_reference/firmware/stub/vboot_api_stub_static_sf.c | 740 | utf_8 | 768ace43694c34f948b97cdf740fb1aa | *
* Workaround for TODO(crbug.com/437107). Remove this file when it's fixed.
*/
#define _STUB_IMPLEMENTATION_
#include <stdio.h>
#include <stdlib.h>
#include "vboot_api.h"
void *VbExMalloc(size_t size)
{
void *p = malloc(size);
if (!p) {
/* Fatal Error. We must abort. */
abort();
}
return p;
}
void VbExFree(... |
google | android | vboot_api_stub_init | .c | platform/external/vboot_reference/firmware/stub/vboot_api_stub_init.c | 1,400 | utf_8 | 3565882148d7fd5f2c6b3575ea773f61 | *
* Stub implementations of firmware-provided API functions.
*/
#include <stdint.h>
#define _STUB_IMPLEMENTATION_
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include "vboot_api.h"
/* U-Boot's printf uses '%L' for uint64_t. gcc uses '%l'. */
#define MAX_FMT 25... |
google | android | vboot_api_stub_disk | .c | platform/external/vboot_reference/firmware/stub/vboot_api_stub_disk.c | 1,041 | utf_8 | 90b9d1dfa9520284c409f8b08a4ec33a | *
* Stub implementations of disk APIs.
*/
#include <stdint.h>
#define _STUB_IMPLEMENTATION_
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include "vboot_api.h"
VbError_t VbExDiskGetInfo(VbDiskInfo** infos_ptr, uint32_t* count,
uint32_t... |
google | android | common | .c | platform/external/vboot_reference/firmware/lib21/common.c | 11,726 | utf_8 | 95667edd49ede6fddae23026a4ff78e1 | *
* Signature validation functions
*/
#include "2sysincludes.h"
#include "2common.h"
#include "2rsa.h"
#include "2sha.h"
#include "vb2_common.h"
const char *vb2_common_desc(const void *buf)
{
const struct vb2_struct_common *c = buf;
return c->desc_size ? (const char *)c + c->fixed_size : "";
}
int vb2_verify_commo... |
google | android | misc | .c | platform/external/vboot_reference/firmware/lib21/misc.c | 6,663 | utf_8 | 18d9c82217a4ed72eb5f940893178246 | *
* Misc functions which need access to vb2_context but are not public APIs
*/
#include "2sysincludes.h"
#include "2api.h"
#include "2common.h"
#include "2misc.h"
#include "2nvstorage.h"
#include "2secdata.h"
#include "2sha.h"
#include "2rsa.h"
#include "vb2_common.h"
/**
* Read an object with a common struct heade... |
google | android | packed_key | .c | platform/external/vboot_reference/firmware/lib21/packed_key.c | 2,603 | utf_8 | e39f0e0759d212c4885f852323a24a76 | *
* Key unpacking functions
*/
#include "2sysincludes.h"
#include "2common.h"
#include "2rsa.h"
#include "vb2_common.h"
int vb2_unpack_key_data(struct vb2_public_key *key,
const uint8_t *key_data,
uint32_t key_size)
{
const uint32_t *buf32 = (const uint32_t *)key_data;
uint32_t expected_key_size = vb2_pack... |
google | android | api | .c | platform/external/vboot_reference/firmware/lib21/api.c | 4,306 | utf_8 | 99ada9ea5e7de6808d21291efb91cb50 | *
* Externally-callable APIs
* (Firmware portion)
*/
#include "2sysincludes.h"
#include "2api.h"
#include "2common.h"
#include "2misc.h"
#include "2nvstorage.h"
#include "2secdata.h"
#include "2sha.h"
#include "2rsa.h"
#include "vb2_common.h"
int vb2api_fw_phase3(struct vb2_context *ctx)
{
int rv;
/* Verify firmw... |
google | android | common | .c | platform/external/vboot_reference/firmware/lib20/common.c | 8,257 | utf_8 | d6b7abc586fb5ebdc3314c5dbe3e204a | *
* Common functions between firmware and kernel verified boot.
* (Firmware portion)
*/
#include "2sysincludes.h"
#include "2rsa.h"
#include "2sha.h"
#include "vb2_common.h"
uint8_t *vb2_signature_data(struct vb2_signature *sig)
{
return (uint8_t *)sig + sig->sig_offset;
}
int vb2_verify_member_inside(const void *... |
google | android | misc | .c | platform/external/vboot_reference/firmware/lib20/misc.c | 6,370 | utf_8 | 14b50734dffce25c2b762956574eb82b | *
* Misc functions which need access to vb2_context but are not public APIs
*/
#include "2sysincludes.h"
#include "2api.h"
#include "2misc.h"
#include "2nvstorage.h"
#include "2secdata.h"
#include "2sha.h"
#include "2rsa.h"
#include "vb2_common.h"
int vb2_load_fw_keyblock(struct vb2_context *ctx)
{
struct vb2_share... |
google | android | packed_key | .c | platform/external/vboot_reference/firmware/lib20/packed_key.c | 2,181 | utf_8 | 7aaab29ec55e37e0a87476caaa0ea9c3 | *
* Key unpacking functions
*/
#include "2sysincludes.h"
#include "2rsa.h"
#include "vb2_common.h"
const uint8_t *vb2_packed_key_data(const struct vb2_packed_key *key)
{
return (const uint8_t *)key + key->key_offset;
}
int vb2_verify_packed_key_inside(const void *parent,
uint32_t parent_size,
const struct... |
google | android | api | .c | platform/external/vboot_reference/firmware/lib20/api.c | 5,181 | utf_8 | 80e67bc51072fd56026139f8a31c139a | *
* Externally-callable APIs
* (Firmware portion)
*/
#include "2sysincludes.h"
#include "2api.h"
#include "2misc.h"
#include "2nvstorage.h"
#include "2secdata.h"
#include "2sha.h"
#include "2rsa.h"
#include "vb2_common.h"
int vb2api_fw_phase3(struct vb2_context *ctx)
{
int rv;
/* Verify firmware keyblock */
rv =... |
google | android | region-kernel | .c | platform/external/vboot_reference/firmware/lib/region-kernel.c | 5,136 | utf_8 | cb9304f35037b5bf70c9d05b8850474f | *
* High-level firmware API for loading and verifying rewritable firmware.
* (Firmware portion)
*/
#include "sysincludes.h"
#include "bmpblk_header.h"
#include "region.h"
#include "gbb_access.h"
#include "gbb_header.h"
#include "load_kernel_fw.h"
#include "utility.h"
#include "vboot_api.h"
#include "vboot_struct.h"... |
google | android | mocked_rollback_index | .c | platform/external/vboot_reference/firmware/lib/mocked_rollback_index.c | 1,669 | utf_8 | eedd674d4c705c729e23b833cbc73192 | *
* Functions for querying, manipulating and locking rollback indices
* stored in the TPM NVRAM.
*/
#include "sysincludes.h"
#include "utility.h"
#include "rollback_index.h"
#include "tss_constants.h"
uint32_t SetVirtualDevMode(int val) {
return TPM_SUCCESS;
}
uint32_t TPMClearAndReenable(void) {
return TPM_SUC... |
google | android | gpt_misc | .c | platform/external/vboot_reference/firmware/lib/gpt_misc.c | 6,552 | utf_8 | 37b6a7e852a8ebb8a140407c4518b080 | */
#include "sysincludes.h"
#include "cgptlib.h"
#include "cgptlib_internal.h"
#include "crc32.h"
#include "gpt.h"
#include "utility.h"
#include "vboot_api.h"
/**
* Allocate and read GPT data from the drive.
*
* The sector_bytes and gpt_drive_sectors fields should be filled on input. The
* primary and secondary h... |
google | android | region-init | .c | platform/external/vboot_reference/firmware/lib/region-init.c | 1,267 | utf_8 | 733e19aa4b8741713e967c3a2eec14aa | *
* High-level firmware API for loading and verifying rewritable firmware.
* (Firmware portion)
*/
#include "sysincludes.h"
#include "bmpblk_header.h"
#include "region.h"
#include "gbb_access.h"
#include "gbb_header.h"
#include "load_kernel_fw.h"
#include "utility.h"
#include "vboot_api.h"
#include "vboot_struct.h"... |
google | android | vboot_display | .c | platform/external/vboot_reference/firmware/lib/vboot_display.c | 21,197 | utf_8 | 112bb6dec7e50b77314bb41f81753517 | *
* Display functions used in kernel selection.
*/
#include "sysincludes.h"
#include "bmpblk_font.h"
#include "gbb_access.h"
#include "gbb_header.h"
#include "region.h"
#include "utility.h"
#include "vboot_api.h"
#include "vboot_common.h"
#include "vboot_display.h"
#include "vboot_nvstorage.h"
static uint32_t disp_c... |
google | android | vboot_nvstorage | .c | platform/external/vboot_reference/firmware/lib/vboot_nvstorage.c | 9,401 | utf_8 | c244302a5ecc27da788801216475f9db | */
/* Non-volatile storage routines.
*/
#include "sysincludes.h"
#include "crc8.h"
#include "utility.h"
#include "vboot_common.h"
#include "vboot_nvstorage.h"
/*
* Constants for NV storage. We use this rather than structs and bitfields so
* the data format is consistent across platforms and compilers.
*
* These ... |
google | android | utility_string | .c | platform/external/vboot_reference/firmware/lib/utility_string.c | 1,733 | utf_8 | 407cf8ac733c85da1de31263d817327f | *
* String utility functions that need to be built as part of the firmware.
*/
#include "sysincludes.h"
#include "utility.h"
uint32_t Uint64ToString(char *buf, uint32_t bufsize, uint64_t value,
uint32_t radix, uint32_t zero_pad_width)
{
char ibuf[UINT64_TO_STRING_MAX];
char *s;
uint32_t usedsize = 1;
if (!buf... |
google | android | vboot_nvstorage_rollback | .c | platform/external/vboot_reference/firmware/lib/vboot_nvstorage_rollback.c | 2,172 | utf_8 | 518c16c0fd5826c0121c2a4333f0a4a6 | */
/* Non-volatile storage routines.
*/
#include "sysincludes.h"
#include "crc8.h"
#include "utility.h"
#include "vboot_common.h"
#include "vboot_nvstorage.h"
#include "rollback_index.h"
/* These are the fields of the nvram that we want to back up. */
static const VbNvParam backup_params[] = {
VBNV_KERNEL_FIELD,
VB... |
google | android | mocked_tpm_bootmode | .c | platform/external/vboot_reference/firmware/lib/mocked_tpm_bootmode.c | 1,994 | utf_8 | 40b7f86d82eed3c8ea8785323cdf8639 | *
* Functions for updating the TPM state with the status of boot path.
*/
#include "sysincludes.h"
#include "tpm_bootmode.h"
#include "tss_constants.h"
const char* kBootStateSHA1Digests[] = {
/* SHA1("\x00\x00\x00") */
"\x29\xe2\xdc\xfb\xb1\x6f\x63\xbb\x02\x54\xdf\x75\x85\xa1\x5b\xb6"
"\xfb\x5e\x92\x7d",
/* ... |
google | android | stateful_util | .c | platform/external/vboot_reference/firmware/lib/stateful_util.c | 1,699 | utf_8 | 7ed6a27369ceb64b718e4e62a2d0e76f | *
* Implementations of stateful memory operations.
*/
#include "sysincludes.h"
#include "stateful_util.h"
#include "utility.h"
void StatefulInit(MemcpyState *state, void *buf, uint64_t len)
{
state->remaining_buf = buf;
state->remaining_len = len;
state->overrun = 0;
}
void *StatefulSkip(MemcpyState *state, uint6... |
google | android | utility | .c | platform/external/vboot_reference/firmware/lib/utility.c | 638 | utf_8 | c4f2c32384c3f68bf2aa1d333dae0c52 | *
* Utility functions that need to be built as part of the firmware.
*/
#include "sysincludes.h"
#include "utility.h"
int SafeMemcmp(const void *s1, const void *s2, size_t n) {
const unsigned char *us1 = s1;
const unsigned char *us2 = s2;
int result = 0;
if (0 == n)
return 0;
/*
* Code snippet without data-... |
google | android | vboot_api_firmware | .c | platform/external/vboot_reference/firmware/lib/vboot_api_firmware.c | 4,086 | utf_8 | e9c03f1efd8a2b62546685ce971dc6f8 | *
* High-level firmware wrapper API - entry points for init, firmware selection
*/
#include "sysincludes.h"
#include "gbb_access.h"
#include "gbb_header.h"
#include "load_firmware_fw.h"
#include "rollback_index.h"
#include "tpm_bootmode.h"
#include "utility.h"
#include "vboot_api.h"
#include "vboot_common.h"
#includ... |
google | android | vboot_firmware | .c | platform/external/vboot_reference/firmware/lib/vboot_firmware.c | 10,761 | utf_8 | e723b3995415bf3759d807f7fb4a2de6 | *
* High-level firmware API for loading and verifying rewritable firmware.
* (Firmware portion)
*/
#include "sysincludes.h"
#include "region.h"
#include "gbb_access.h"
#include "gbb_header.h"
#include "load_firmware_fw.h"
#include "utility.h"
#include "vboot_api.h"
#include "vboot_common.h"
#include "vboot_nvstorag... |
google | android | vboot_common | .c | platform/external/vboot_reference/firmware/lib/vboot_common.c | 15,592 | utf_8 | a0c842344b5c3bae121c6af1bf20f830 | *
* Common functions between firmware and kernel verified boot.
* (Firmware portion)
*/
#include "sysincludes.h"
#include "vboot_api.h"
#include "vboot_common.h"
#include "utility.h"
const char *kVbootErrors[VBOOT_ERROR_MAX] = {
"Success.",
"Key block invalid.",
"Key block signature failed.",
"Key block hash fa... |
google | android | tpm_bootmode | .c | platform/external/vboot_reference/firmware/lib/tpm_bootmode.c | 4,715 | utf_8 | 5cedcc9be858703da470325c81cb24a7 | *
* Functions for updating the TPM state with the status of boot path.
*/
#include "sysincludes.h"
#include "tlcl.h"
#include "tpm_bootmode.h"
#include "utility.h"
#include "vboot_api.h"
/* TPM PCRs to use for storing boot mode measurements. */
#define BOOT_MODE_PCR 0
#define HWID_DIGEST_PCR 1
/*
* Input digests fo... |
google | android | vboot_common_init | .c | platform/external/vboot_reference/firmware/lib/vboot_common_init.c | 1,228 | utf_8 | dd86f01a44055024c2c199e24204e6fe | *
* Common functions between firmware and kernel verified boot.
* (Firmware portion)
*/
#include "sysincludes.h"
#include "vboot_api.h"
#include "vboot_common.h"
#include "utility.h"
int VbSharedDataInit(VbSharedDataHeader *header, uint64_t size)
{
VBDEBUG(("VbSharedDataInit, %d bytes, header %d bytes\n", (int)siz... |
google | android | vboot_kernel | .c | platform/external/vboot_reference/firmware/lib/vboot_kernel.c | 16,546 | utf_8 | 86a86906abfbde2cb3e050562e73d9de | *
* Functions for loading a kernel from disk.
* (Firmware portion)
*/
#include "sysincludes.h"
#include "cgptlib.h"
#include "cgptlib_internal.h"
#include "region.h"
#include "gbb_access.h"
#include "gbb_header.h"
#include "gpt_misc.h"
#include "load_kernel_fw.h"
#include "utility.h"
#include "vboot_api.h"
#include... |
google | android | rollback_index | .c | platform/external/vboot_reference/firmware/lib/rollback_index.c | 19,897 | utf_8 | 5c67e95e5744d71ed2c03563fc5d1653 | *
* Functions for querying, manipulating and locking rollback indices
* stored in the TPM NVRAM.
*/
#include "sysincludes.h"
#include "crc8.h"
#include "rollback_index.h"
#include "tlcl.h"
#include "tss_constants.h"
#include "utility.h"
#include "vboot_api.h"
#ifndef offsetof
#define offsetof(A,B) __builtin_offseto... |
google | android | crc8 | .c | platform/external/vboot_reference/firmware/lib/crc8.c | 678 | utf_8 | 7707dbbc61131880a9f71e806df215ca | */
#include "sysincludes.h"
#include "crc8.h"
/**
* Return CRC-8 of the data, using x^8 + x^2 + x + 1 polynomial. A table-based
* algorithm would be faster, but for only a few bytes it isn't worth the code
* size. */
uint8_t Crc8(const void *vptr, int len)
{
const uint8_t *data = vptr;
unsigned crc = 0;
int i, ... |
google | android | vboot_api_kernel | .c | platform/external/vboot_reference/firmware/lib/vboot_api_kernel.c | 34,901 | utf_8 | 62e312d26b0c8e6987ef2e8eaea575e1 | *
* High-level firmware wrapper API - entry points for kernel selection
*/
#include "sysincludes.h"
#include "gbb_access.h"
#include "gbb_header.h"
#include "load_kernel_fw.h"
#include "region.h"
#include "rollback_index.h"
#include "utility.h"
#include "vboot_api.h"
#include "vboot_audio.h"
#include "vboot_common.h... |
google | android | vboot_api_init | .c | platform/external/vboot_reference/firmware/lib/vboot_api_init.c | 12,167 | utf_8 | 20d3d032d4a18f0b747e01cc723a778f | *
* High-level firmware wrapper API - entry points for init, firmware selection
*/
#include "sysincludes.h"
#include "region.h"
#include "gbb_access.h"
#include "gbb_header.h"
#include "load_firmware_fw.h"
#include "rollback_index.h"
#include "utility.h"
#include "vboot_api.h"
#include "vboot_common.h"
#include "vbo... |
google | android | vboot_audio | .c | platform/external/vboot_reference/firmware/lib/vboot_audio.c | 8,659 | utf_8 | 496788e182e99e66857c811dbf7ec947 | *
* Delay/beep functions used in dev-mode kernel selection.
*/
#include "sysincludes.h"
#include "crc32.h"
#include "gbb_header.h"
#include "utility.h"
#include "vboot_api.h"
#include "vboot_audio.h"
#include "vboot_audio_private.h"
#include "vboot_common.h"
/* BIOS doesn't have /usr/include */
#ifndef UINT_MAX
#def... |
google | android | region-fw | .c | platform/external/vboot_reference/firmware/lib/region-fw.c | 1,390 | utf_8 | cc6547c3645ba8a3a6c9aeb46a9efa97 | *
* High-level firmware API for loading and verifying rewritable firmware.
* (Firmware portion)
*/
#include "sysincludes.h"
#include "bmpblk_header.h"
#include "region.h"
#include "gbb_access.h"
#include "gbb_header.h"
#include "load_kernel_fw.h"
#include "utility.h"
#include "vboot_api.h"
#include "vboot_struct.h"... |
google | android | crc32 | .c | platform/external/vboot_reference/firmware/lib/cgptlib/crc32.c | 6,763 | utf_8 | c50ad74adeba83696411085e9b579578 | /* code or tables extracted from it, as desired without restriction. */
/* */
/* First, the polynomial itself and its table of feedback terms. The */
/* polynomial is */
/* X^32+X^2... |
google | android | cgptlib | .c | platform/external/vboot_reference/firmware/lib/cgptlib/cgptlib.c | 5,917 | utf_8 | b5494ff97cda9cffc974e099ed82ef49 | */
#include "sysincludes.h"
#include "cgptlib.h"
#include "cgptlib_internal.h"
#include "crc32.h"
#include "gpt.h"
#include "utility.h"
#include "vboot_api.h"
int GptInit(GptData *gpt)
{
int retval;
gpt->modified = 0;
gpt->current_kernel = CGPT_KERNEL_ENTRY_NOT_FOUND;
gpt->current_priority = 999;
retval = GptSani... |
google | android | cgptlib_internal | .c | platform/external/vboot_reference/firmware/lib/cgptlib/cgptlib_internal.c | 13,406 | utf_8 | 42a223dce2d78940462e5382e24e13bb | */
#include "sysincludes.h"
#include "cgptlib.h"
#include "cgptlib_internal.h"
#include "crc32.h"
#include "gpt.h"
#include "gpt_misc.h"
#include "utility.h"
const static int SECTOR_SIZE = 512;
size_t CalculateEntriesSectors(GptHeader* h) {
size_t bytes = h->number_of_entries * h->size_of_entry;
size_t ret = (byte... |
google | android | tlcl | .c | platform/external/vboot_reference/firmware/lib/tpm_lite/tlcl.c | 15,325 | utf_8 | b7093f9e26d090d07e6bb4fecd561715 | */
/* A lightweight TPM command library.
*
* The general idea is that TPM commands are array of bytes whose
* fields are mostly compile-time constant. The goal is to build much
* of the commands at compile time (or build time) and change some of
* the fields at run time as needed. The code in
* utility/tlcl_ge... |
google | android | mocked_tlcl | .c | platform/external/vboot_reference/firmware/lib/tpm_lite/mocked_tlcl.c | 3,310 | utf_8 | 3ba215ec483b35ffe9d54f35437e12da | */
#include "sysincludes.h"
#include "tlcl.h"
#include "tlcl_internal.h"
#include "utility.h"
#include "vboot_api.h"
uint32_t TlclLibInit(void) {
return VbExTpmInit();
}
uint32_t TlclLibClose(void) {
return TPM_SUCCESS;
}
uint32_t TlclStartup(void) {
return TPM_SUCCESS;
}
uint32_t TlclSaveState(void) {
return ... |
google | android | rsa | .c | platform/external/vboot_reference/firmware/lib/cryptolib/rsa.c | 4,948 | utf_8 | 598d53227bd3ef259ecb85fd2eeae68f | */
/* Implementation of RSA signature verification which uses a pre-processed
* key for computation. The code extends Android's RSA verification code to
* support multiple RSA key lengths and hash digest algorithms.
*/
#include "sysincludes.h"
#include "cryptolib.h"
#include "vboot_api.h"
#include "utility.h"
/* a[... |
google | android | sha1 | .c | platform/external/vboot_reference/firmware/lib/cryptolib/sha1.c | 6,981 | utf_8 | fed67be22f953dbf6278226bae68659b | *
* SHA-1 implementation largely based on libmincrypt in the the Android
* Open Source Project (platorm/system/core.git/libmincrypt/sha.c
*/
#include "sysincludes.h"
#include "cryptolib.h"
#include "utility.h"
/* Some machines lack byteswap.h and endian.h. These have to use the
* slower code, even if they're littl... |
google | android | sha256 | .c | platform/external/vboot_reference/firmware/lib/cryptolib/sha256.c | 12,595 | utf_8 | 4544e5cd197ae9c2d22b3ffc5875f121 | /* SHA-256 and SHA-512 implementation based on code by Oliver Gay
* without specific prior written permission.
*
* SUCH DAMAGE.
*/
#include "sysincludes.h"
#include "cryptolib.h"
#include "utility.h"
#define SHFR(x, n) (x >> n)
#define ROTR(x, n) ((x >> n) | (x << ((sizeof(x) << 3) - n)))
#define ROTL(x, n)... |
google | android | sha512 | .c | platform/external/vboot_reference/firmware/lib/cryptolib/sha512.c | 13,033 | utf_8 | f35d971cbac8b3ce195b1958d9c1d452 | /* SHA-256 and SHA-512 implementation based on code by Oliver Gay
* without specific prior written permission.
*
* SUCH DAMAGE.
*/
#include "sysincludes.h"
#include "cryptolib.h"
#include "utility.h"
#define SHFR(x, n) (x >> n)
#define ROTR(x, n) ((x >> n) | (x << ((sizeof(x) << 3) - n)))
#define ROTL(x, n)... |
google | android | padding | .c | platform/external/vboot_reference/firmware/lib/cryptolib/padding.c | 32,174 | utf_8 | efa3774ab3ee1701434b7b4f4b88c54c | /*
* DO NOT MODIFY THIS FILE DIRECTLY.
*
* This file is automatically generated by genpadding.sh and contains padding
* arrays corresponding to various combinations of algorithms for RSA signatures.
*/
#include "sysincludes.h"
#include "cryptolib.h"
/*
* PKCS 1.5 padding (from the RSA PKCS#1 v2.1 standard)
*... |
google | android | sha_utility | .c | platform/external/vboot_reference/firmware/lib/cryptolib/sha_utility.c | 3,213 | utf_8 | 0d6485c3da2451169e46bbb1434d69db | *
* Utility functions for message digest functions.
*/
#include "sysincludes.h"
#include "cryptolib.h"
#include "utility.h"
#include "vboot_api.h"
void DigestInit(DigestContext* ctx, int sig_algorithm) {
ctx->algorithm = hash_type_map[sig_algorithm];
switch(ctx->algorithm) {
#ifndef CHROMEOS_EC
case SHA1_DIG... |
google | android | rsa_utility | .c | platform/external/vboot_reference/firmware/lib/cryptolib/rsa_utility.c | 4,576 | utf_8 | fbbf3e6ec81de2b59269b0dce0272720 | *
* Implementation of RSA utility functions.
*/
#include "sysincludes.h"
#include "cryptolib.h"
#include "stateful_util.h"
#include "utility.h"
#include "vboot_api.h"
uint64_t RSAProcessedKeySize(uint64_t algorithm, uint64_t* out_size) {
int key_len; /* Key length in bytes. (int type matches siglen_map) */
if (... |
google | android | main | .c | platform/external/vboot_reference/firmware/linktest/main.c | 2,157 | utf_8 | 6147b2a3468007f0744fec87401c905f | */
#include "sysincludes.h"
#include "cgptlib.h"
#include "load_firmware_fw.h"
#include "load_kernel_fw.h"
#include "rollback_index.h"
#include "tlcl.h"
#include "tpm_bootmode.h"
#include "vboot_common.h"
#include "vboot_kernel.h"
#include "vboot_nvstorage.h"
int main(void)
{
/* cgptlib.h */
GptInit(0);
GptNextKern... |
google | android | main_vbsf | .c | platform/external/vboot_reference/firmware/linktest/main_vbsf.c | 377 | utf_8 | 0929ca4322e2e9b64885aea1da8f940d | */
#include "sysincludes.h"
#include "vboot_api.h"
int main(void)
{
/* vboot_api.h - entry points INTO vboot_reference */
VbSelectFirmware(0, 0);
VbUpdateFirmwareBodyHash(0, 0, 0);
return 0;
} |
google | android | main_vbinit | .c | platform/external/vboot_reference/firmware/linktest/main_vbinit.c | 330 | utf_8 | 12fd25d666ddf455c86aa3ff5d3ff900 | */
#include "sysincludes.h"
#include "vboot_api.h"
int main(void)
{
/* vboot_api.h - entry points INTO vboot_reference */
VbInit(0, 0);
return 0;
} |
google | android | vboot_api_kernel2_tests | .c | platform/external/vboot_reference/tests/vboot_api_kernel2_tests.c | 20,605 | utf_8 | 3d36f26f5c860eaaa7becb6f684589af | *
* Tests for vboot_api_kernel, part 2
*/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "gbb_header.h"
#include "host_common.h"
#include "load_kernel_fw.h"
#include "rollback_index.h"
#include "test_common.h"
#include "vboot_audio.h"
#include "vboot_common.h"
#include "vboot_kernel.h"
#include ... |
google | android | vb21_api_tests | .c | platform/external/vboot_reference/tests/vb21_api_tests.c | 10,666 | utf_8 | 185ab4b189e2c8e1f0b794c518273a3c | *
* Tests for api library, new style structs
*/
#include <stdio.h>
#include "2sysincludes.h"
#include "2api.h"
#include "2common.h"
#include "2misc.h"
#include "2nvstorage.h"
#include "2rsa.h"
#include "2secdata.h"
#include "vb2_common.h"
#include "host_key2.h"
#include "host_signature2.h"
#include "test_common.h"
/... |
google | android | vb21_common2_tests | .c | platform/external/vboot_reference/tests/vb21_common2_tests.c | 9,164 | utf_8 | 717be1c6577f175f2c7ab146b7a23a44 | *
* Tests for firmware image library.
*/
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "2sysincludes.h"
#include "2common.h"
#include "2rsa.h"
#include "vb2_common.h"
#include "host_common.h"
#include "host_key2.h"
#include "host_signature2.h"
#include "test_common.h"
static const uint8_t test_... |
google | android | vb2_nvstorage_tests | .c | platform/external/vboot_reference/tests/vb2_nvstorage_tests.c | 7,250 | utf_8 | 4634f790a781f197637398a6ef33c842 | *
* Tests for firmware NV storage library.
*/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "test_common.h"
#include "vboot_common.h"
#include "2api.h"
#include "2common.h"
#include "2misc.h"
#include "2nvstorage.h"
/* Single NV storage field to test */
struct nv_field {
en... |
google | android | crc32_test | .c | platform/external/vboot_reference/tests/crc32_test.c | 1,639 | utf_8 | 2a99fcf96f46e3fd618d14302542b987 | */
#include "crc32_test.h"
#include "cgptlib_test.h"
#include "crc32.h"
#include "test_common.h"
#include "utility.h"
#define MAX_VECTOR_LEN 256
int TestCrc32TestVectors() {
struct {
uint8_t vector[MAX_VECTOR_LEN];
int len;
uint32_t crc32;
} cases[] = {
{{0x00}, 1, 0xD202EF8D},
{{0x00, 0x00, 0x... |
google | android | vb21_common_tests | .c | platform/external/vboot_reference/tests/vb21_common_tests.c | 16,248 | utf_8 | 085fa914026e75a88f77ad0ee6d8fd56 | *
* Tests for firmware 2common.c
*/
#include "2sysincludes.h"
#include "2common.h"
#include "2rsa.h"
#include "vb2_common.h"
#include "host_fw_preamble2.h"
#include "host_key2.h"
#include "host_keyblock2.h"
#include "host_signature2.h"
#include "test_common.h"
static const uint8_t test_data[] = "This is some test da... |
google | android | vboot_api_devmode_tests | .c | platform/external/vboot_reference/tests/vboot_api_devmode_tests.c | 9,479 | utf_8 | 862b53e65a2006b193e54d7493789df4 | *
* Tests for vboot_api_firmware
*/
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "crc32.h"
#include "gbb_header.h"
#include "host_common.h"
#include "load_kernel_fw.h"
#include "rollback_index.h"
#include "test_common.h"
#include "vboot_common.h"
#include "vboot_display.h"
... |
google | android | rsa_padding_test | .c | platform/external/vboot_reference/tests/rsa_padding_test.c | 2,695 | utf_8 | bf230321ff5499ae6e7b0e3af5672288 | */
#include <stdint.h>
#include <stdio.h>
#include "cryptolib.h"
#include "file_keys.h"
#include "rsa_padding_test.h"
#include "test_common.h"
#include "utility.h"
/* Test valid and invalid signatures */
static void TestSignatures(RSAPublicKey* key) {
int unexpected_success;
int i;
/* The first test signature is... |
google | android | sha_benchmark | .c | platform/external/vboot_reference/tests/sha_benchmark.c | 1,640 | utf_8 | 57544b013f4fc3e2b79669011ee956a0 | */
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "cryptolib.h"
#include "host_common.h"
#include "timer_utils.h"
#define NUM_HASH_ALGORITHMS 3
#define TEST_BUFFER_SIZE 4000000
/* Table of hash function pointers and their description. */
typedef uint8_t* (*Hashptr) (const uint8_t*, uint64_t, uint8... |
google | android | vboot_common3_tests | .c | platform/external/vboot_reference/tests/vboot_common3_tests.c | 11,262 | utf_8 | aa70d4614bc5af3443b8f9b56c1473ef | *
* Tests for firmware image library.
*/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cryptolib.h"
#include "file_keys.h"
#include "host_common.h"
#include "test_common.h"
#include "vboot_common.h"
static void ReChecksumKeyBlock(VbKeyBlockHeader *h)
{
uint8_t *newchk = Di... |
google | android | tpm_bootmode_tests | .c | platform/external/vboot_reference/tests/tpm_bootmode_tests.c | 4,243 | utf_8 | af7e6d1637a1203ab6890d3e103e602c | *
* Tests for tpm_bootmode functions
*/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define _STUB_IMPLEMENTATION_ /* So we can use memset() ourselves */
#include "test_common.h"
#include "utility.h"
#include "tpm_bootmode.h"
extern const char* kBootStateSHA1Digests[];
/* Last in_d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.