• Home
  • Raw
  • Download

Lines Matching +full:safer +full:- +full:buffer

2  * Use of this source code is governed by a BSD-style license that can be
20 * required buffer size, so can't be turned into a static inline function.
31 /* Debug output printf() for tests. Otherwise, it's platform-dependent. */
43 * Alignment for work buffer pointers/allocations should be useful for any
45 * use explicit alignment to avoid run-time errors. For example:
59 /* Work buffer */
66 * Initialize a work buffer.
68 * @param wb Work buffer to init
69 * @param buf Pointer to work buffer data
70 * @param size Size of work buffer data in bytes
75 * Allocate space in a work buffer.
77 * Note that the returned buffer will always be aligned to VB2_WORKBUF_ALIGN.
79 * The work buffer acts like a stack, and detailed tracking of allocs and frees
84 * work buffer, then make a local copy. Allocations done to the local copy
85 * then don't change the passed-in work buffer, and will effectively be freed
88 * @param wb Work buffer
95 * Reallocate space in a work buffer.
97 * Note that the returned buffer will always be aligned to VB2_WORKBUF_ALIGN.
98 * The work buffer acts like a stack, so this must only be done to the most
99 * recently allocated buffer.
101 * @param wb Work buffer
113 * Note that the work buffer acts like a stack, and detailed tracking of
117 * @param wb Work buffer
122 /* Check if a pointer is aligned on an align-byte boundary */
123 #define vb2_aligned(ptr, align) (!(((uintptr_t)(ptr)) & ((align) - 1)))
126 * Safer memcmp() for use in crypto.
131 * indicates inequality, not which buffer is lesser.
133 * @param s1 First buffer
134 * @param s2 Second buffer
136 * @return 0 if match or size=0, non-zero if at least one byte mismatched.
141 * Align a buffer and check its size.
144 * @param *size Points to size of buffer pointed to by *ptr
147 * @return VB2_SUCCESS, or non-zero if error.
182 /* Size of work buffer sufficient for vb2_verify_digest() worst case. */
185 /* Size of work buffer sufficient for vb2_verify_data() worst case. */
191 /* Size of work buffer sufficient for vb2_verify_keyblock() worst case. */
194 /* Size of work buffer sufficient for vb2_verify_fw_preamble() worst case. */