Replace 8 with GRUB_CHAR_BIT in several places when appropriate.
This commit is contained in:
parent
ce7d92a9f2
commit
1865baa72c
4 changed files with 7 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2013-04-05 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
Replace 8 with GRUB_CHAR_BIT in several places when appropriate.
|
||||||
|
|
||||||
2013-04-05 Vladimir Serbinenko <phcoder@gmail.com>
|
2013-04-05 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
Add new defines GRUB_RSDP_SIGNATURE_SIZE and GRUB_RSDP_SIGNATURE.
|
Add new defines GRUB_RSDP_SIGNATURE_SIZE and GRUB_RSDP_SIGNATURE.
|
||||||
|
|
|
@ -103,7 +103,7 @@ gf_mul_be (grub_uint8_t *o, const grub_uint8_t *a, const grub_uint8_t *b)
|
||||||
grub_memcpy (t, b, GRUB_CRYPTODISK_GF_BYTES);
|
grub_memcpy (t, b, GRUB_CRYPTODISK_GF_BYTES);
|
||||||
for (i = 0; i < GRUB_CRYPTODISK_GF_SIZE; i++)
|
for (i = 0; i < GRUB_CRYPTODISK_GF_SIZE; i++)
|
||||||
{
|
{
|
||||||
if (((a[GRUB_CRYPTODISK_GF_BYTES - i / 8 - 1] >> (i % 8))) & 1)
|
if (((a[GRUB_CRYPTODISK_GF_BYTES - i / GRUB_CHAR_BIT - 1] >> (i % GRUB_CHAR_BIT))) & 1)
|
||||||
grub_crypto_xor (o, o, t, GRUB_CRYPTODISK_GF_BYTES);
|
grub_crypto_xor (o, o, t, GRUB_CRYPTODISK_GF_BYTES);
|
||||||
gf_mul_x_be (t);
|
gf_mul_x_be (t);
|
||||||
}
|
}
|
||||||
|
|
|
@ -501,7 +501,7 @@ grub_efidisk_open (const char *name, struct grub_disk *disk)
|
||||||
if (! d)
|
if (! d)
|
||||||
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such device");
|
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such device");
|
||||||
|
|
||||||
disk->id = ((num << 8) | name[0]);
|
disk->id = ((num << GRUB_CHAR_BIT) | name[0]);
|
||||||
m = d->block_io->media;
|
m = d->block_io->media;
|
||||||
/* FIXME: Probably it is better to store the block size in the disk,
|
/* FIXME: Probably it is better to store the block size in the disk,
|
||||||
and total sectors should be replaced with total blocks. */
|
and total sectors should be replaced with total blocks. */
|
||||||
|
|
|
@ -414,7 +414,7 @@ recover_key (grub_disk_t source, grub_cryptodisk_t dev)
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
keysize = grub_le_to_cpu16 (header.keylen) / 8;
|
keysize = grub_le_to_cpu16 (header.keylen) / GRUB_CHAR_BIT;
|
||||||
grub_memset (zero, 0, sizeof (zero));
|
grub_memset (zero, 0, sizeof (zero));
|
||||||
|
|
||||||
grub_puts_ (N_("Attempting to decrypt master key..."));
|
grub_puts_ (N_("Attempting to decrypt master key..."));
|
||||||
|
|
Loading…
Reference in a new issue