49 "<image> [<image>...]" );
77 for ( i =
optind ; i < argc ; i++ ) {
86 digest_init (
digest, digest_ctx );
89 if ( frag_len >
sizeof ( buf ) )
90 frag_len =
sizeof ( buf );
92 digest_update (
digest, digest_ctx, buf, frag_len );
96 digest_final (
digest, digest_ctx, digest_out );
98 for ( j = 0 ; j <
sizeof ( digest_out ) ; j++ )
99 printf (
"%02x", digest_out[j] );
struct arbelprm_rc_send_wqe rc
int printf(const char *fmt,...)
Write a formatted string to the console.
userptr_t data
Raw file image.
static struct option_descriptor digest_opts[]
"digest" option list
int optind
Current option index.
FILE_LICENCE(GPL2_OR_LATER)
static __always_inline void copy_from_user(void *dest, userptr_t src, off_t src_off, size_t len)
Copy data from user buffer.
int parse_options(int argc, char **argv, struct command_descriptor *cmd, void *opts)
Parse command-line options.
struct command md5sum_command __command
static struct command_descriptor digest_cmd
"digest" command descriptor
static int md5sum_exec(int argc, char **argv)
Parse command-line options.
static void struct digest_algorithm * digest
HMAC-MD5 digest.
#define MAX_ARGUMENTS
No maximum number of arguments.
static userptr_t size_t offset
Offset of the first segment within the content.
size_t len
Length of raw file image.
Command line option parsing.
static union @437 opts
"cert<xxx>" option list
const char * name
Name of the command.
static int digest_exec(int argc, char **argv, struct digest_algorithm *digest)
The "digest" command.
size_t ctxsize
Context size.
size_t digestsize
Digest size.
A command-line option descriptor.
A message digest algorithm.
static int sha1sum_exec(int argc, char **argv)
#define COMMAND_DESC(_struct, _options, _min_args, _max_args, _usage)
Construct command descriptor.
int imgacquire(const char *name_uri, unsigned long timeout, struct image **image)
Acquire an image.
struct digest_algorithm md5_algorithm
MD5 algorithm.
struct digest_algorithm sha1_algorithm
SHA-1 algorithm.