public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH][v2] crypto/fsl: Make function names consistent for blob encapsulation/decapsulation.
@ 2015-02-20  8:47 Gaurav Rana
  2015-02-24 22:43 ` York Sun
  0 siblings, 1 reply; 3+ messages in thread
From: Gaurav Rana @ 2015-02-20  8:47 UTC (permalink / raw)
  To: u-boot

This patch does the following:

1. The function names for encapsulation and decapsulation
were inconsitent in freescale's implementation and cmd_blob file.
This patch corrects the issues.
2. The function protopye is also modified to change the length parameter
from u8 to u32 to allow encapsulation and decapsulation of larger images.
3. Modified the description of km paramter in the command usage for better
readability.

Signed-off-by: Gaurav Rana <gaurav.rana@freescale.com>
Reviewed-by: Ruchika Gupta <ruchika.gupta@freescale.com>
---
Changes in v2:
Modify blob_help_text[] array.

 common/cmd_blob.c             | 18 ++++++++++--------
 drivers/crypto/fsl/fsl_blob.c |  4 ++--
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/common/cmd_blob.c b/common/cmd_blob.c
index 82ecaf0..6178939 100644
--- a/common/cmd_blob.c
+++ b/common/cmd_blob.c
@@ -90,17 +90,19 @@ static char blob_help_text[] =
 	"enc src dst len km - Encapsulate and create blob of data\n"
 	"                          $len bytes long at address $src and\n"
 	"                          store the result at address $dst.\n"
-	"                          $km is the 16 byte key modifier\n"
-	"                          is also required for generation/use as\n"
-	"                          key for cryptographic operation. Key\n"
-	"                          modifier should be 16 byte long.\n"
+	"                          $km is the address where the key\n"
+	"                          modifier is stored.\n"
+	"                          The modifier is required for generation\n"
+	"                          /use as key for cryptographic operation.\n"
+	"                          Key modifier should be 16 byte long.\n"
 	"blob dec src dst len km - Decapsulate the  blob of data at address\n"
 	"                          $src and store result of $len byte at\n"
 	"                          addr $dst.\n"
-	"                          $km is the 16 byte key modifier\n"
-	"                          is also required for generation/use as\n"
-	"                          key for cryptographic operation. Key\n"
-	"                          modifier should be 16 byte long.\n";
+	"                          $km is the address where the key\n"
+	"                          modifier is stored.\n"
+	"                          The modifier is required for generation\n"
+	"                          /use as key for cryptographic operation.\n"
+	"                          Key modifier should be 16 byte long.\n"
 
 U_BOOT_CMD(
 	blob, 6, 1, do_blob,
diff --git a/drivers/crypto/fsl/fsl_blob.c b/drivers/crypto/fsl/fsl_blob.c
index bc01075..9923bcb 100644
--- a/drivers/crypto/fsl/fsl_blob.c
+++ b/drivers/crypto/fsl/fsl_blob.c
@@ -11,7 +11,7 @@
 #include "desc.h"
 #include "jr.h"
 
-int blob_decrypt(u8 *key_mod, u8 *src, u8 *dst, u8 len)
+int blob_decap(u8 *key_mod, u8 *src, u8 *dst, u32 len)
 {
 	int ret, i = 0;
 	u32 *desc;
@@ -36,7 +36,7 @@ int blob_decrypt(u8 *key_mod, u8 *src, u8 *dst, u8 len)
 	return ret;
 }
 
-int blob_encrypt(u8 *key_mod, u8 *src, u8 *dst, u8 len)
+int blob_encap(u8 *key_mod, u8 *src, u8 *dst, u32 len)
 {
 	int ret, i = 0;
 	u32 *desc;
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH][v2] crypto/fsl: Make function names consistent for blob encapsulation/decapsulation.
  2015-02-20  8:47 [U-Boot] [PATCH][v2] crypto/fsl: Make function names consistent for blob encapsulation/decapsulation Gaurav Rana
@ 2015-02-24 22:43 ` York Sun
  2015-02-24 23:20   ` York Sun
  0 siblings, 1 reply; 3+ messages in thread
From: York Sun @ 2015-02-24 22:43 UTC (permalink / raw)
  To: u-boot



On 02/20/2015 12:47 AM, Gaurav Rana wrote:
> This patch does the following:
> 
> 1. The function names for encapsulation and decapsulation
> were inconsitent in freescale's implementation and cmd_blob file.
> This patch corrects the issues.
> 2. The function protopye is also modified to change the length parameter
> from u8 to u32 to allow encapsulation and decapsulation of larger images.
> 3. Modified the description of km paramter in the command usage for better
> readability.
> 
> Signed-off-by: Gaurav Rana <gaurav.rana@freescale.com>
> Reviewed-by: Ruchika Gupta <ruchika.gupta@freescale.com>
> ---
> Changes in v2:
> Modify blob_help_text[] array.
> 
>  common/cmd_blob.c             | 18 ++++++++++--------
>  drivers/crypto/fsl/fsl_blob.c |  4 ++--
>  2 files changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/common/cmd_blob.c b/common/cmd_blob.c
> index 82ecaf0..6178939 100644
> --- a/common/cmd_blob.c
> +++ b/common/cmd_blob.c
> @@ -90,17 +90,19 @@ static char blob_help_text[] =
>  	"enc src dst len km - Encapsulate and create blob of data\n"
>  	"                          $len bytes long at address $src and\n"
>  	"                          store the result at address $dst.\n"
> -	"                          $km is the 16 byte key modifier\n"
> -	"                          is also required for generation/use as\n"
> -	"                          key for cryptographic operation. Key\n"
> -	"                          modifier should be 16 byte long.\n"
> +	"                          $km is the address where the key\n"
> +	"                          modifier is stored.\n"
> +	"                          The modifier is required for generation\n"
> +	"                          /use as key for cryptographic operation.\n"
> +	"                          Key modifier should be 16 byte long.\n"
>  	"blob dec src dst len km - Decapsulate the  blob of data at address\n"
>  	"                          $src and store result of $len byte at\n"
>  	"                          addr $dst.\n"
> -	"                          $km is the 16 byte key modifier\n"
> -	"                          is also required for generation/use as\n"
> -	"                          key for cryptographic operation. Key\n"
> -	"                          modifier should be 16 byte long.\n";
> +	"                          $km is the address where the key\n"
> +	"                          modifier is stored.\n"
> +	"                          The modifier is required for generation\n"
> +	"                          /use as key for cryptographic operation.\n"
> +	"                          Key modifier should be 16 byte long.\n"

You removed the semicolon here. Did you see any compiling error?

York

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH][v2] crypto/fsl: Make function names consistent for blob encapsulation/decapsulation.
  2015-02-24 22:43 ` York Sun
@ 2015-02-24 23:20   ` York Sun
  0 siblings, 0 replies; 3+ messages in thread
From: York Sun @ 2015-02-24 23:20 UTC (permalink / raw)
  To: u-boot



On 02/24/2015 02:43 PM, York Sun wrote:
> 
> 
> On 02/20/2015 12:47 AM, Gaurav Rana wrote:
>> This patch does the following:
>>
>> 1. The function names for encapsulation and decapsulation
>> were inconsitent in freescale's implementation and cmd_blob file.
>> This patch corrects the issues.
>> 2. The function protopye is also modified to change the length parameter
>> from u8 to u32 to allow encapsulation and decapsulation of larger images.
>> 3. Modified the description of km paramter in the command usage for better
>> readability.
>>
>> Signed-off-by: Gaurav Rana <gaurav.rana@freescale.com>
>> Reviewed-by: Ruchika Gupta <ruchika.gupta@freescale.com>
>> ---
>> Changes in v2:
>> Modify blob_help_text[] array.
>>
>>  common/cmd_blob.c             | 18 ++++++++++--------
>>  drivers/crypto/fsl/fsl_blob.c |  4 ++--
>>  2 files changed, 12 insertions(+), 10 deletions(-)
>>
>> diff --git a/common/cmd_blob.c b/common/cmd_blob.c
>> index 82ecaf0..6178939 100644
>> --- a/common/cmd_blob.c
>> +++ b/common/cmd_blob.c
>> @@ -90,17 +90,19 @@ static char blob_help_text[] =
>>  	"enc src dst len km - Encapsulate and create blob of data\n"
>>  	"                          $len bytes long at address $src and\n"
>>  	"                          store the result at address $dst.\n"
>> -	"                          $km is the 16 byte key modifier\n"
>> -	"                          is also required for generation/use as\n"
>> -	"                          key for cryptographic operation. Key\n"
>> -	"                          modifier should be 16 byte long.\n"
>> +	"                          $km is the address where the key\n"
>> +	"                          modifier is stored.\n"
>> +	"                          The modifier is required for generation\n"
>> +	"                          /use as key for cryptographic operation.\n"
>> +	"                          Key modifier should be 16 byte long.\n"
>>  	"blob dec src dst len km - Decapsulate the  blob of data at address\n"
>>  	"                          $src and store result of $len byte at\n"
>>  	"                          addr $dst.\n"
>> -	"                          $km is the 16 byte key modifier\n"
>> -	"                          is also required for generation/use as\n"
>> -	"                          key for cryptographic operation. Key\n"
>> -	"                          modifier should be 16 byte long.\n";
>> +	"                          $km is the address where the key\n"
>> +	"                          modifier is stored.\n"
>> +	"                          The modifier is required for generation\n"
>> +	"                          /use as key for cryptographic operation.\n"
>> +	"                          Key modifier should be 16 byte long.\n"
> 
> You removed the semicolon here. Did you see any compiling error?
> 
I think the semicolon should be added back. Otherwise, secure boot boards fail
to compile. I tested on LS1, P4, T2 targets. If you don't have other changes, I
can fix this one.

York

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-24 23:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-20  8:47 [U-Boot] [PATCH][v2] crypto/fsl: Make function names consistent for blob encapsulation/decapsulation Gaurav Rana
2015-02-24 22:43 ` York Sun
2015-02-24 23:20   ` York Sun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox