Skip to contentSkip to conversation

crypto: Add fpu template, a wrapper for blkcipher touching FPU

PATCH In review Huang Ying 2 participants 3 messages Mar 5, 2009 – Mar 6, 2009 Crypto API

lore
Share & tools
lore

Huang Ying

author
#0 lore raw

PATCH 2/3 crypto: Add fpu template, a wrapper for blkcipher touching FPU

Blkcipher touching FPU need to be enclosed by kernel_fpu_begin() and kernel_fpu_end(). If they are invoked in cipher algorithm implementation, they will be invoked for each block, so that performance will be hurt, because they are "slow" operations. This patch implements "fpu" template, which makes these operations to be invoked for each request.

---
 crypto/Kconfig  |    7 ++
 crypto/Makefile |    1 
 crypto/fpu.c    |  166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 174 insertions(+)
crypto/Kconfig +7 -0
@@ -236,6 +236,13 @@ config CRYPTO_XTS
 	  key size 256, 384 or 512 bits. This implementation currently
 	  can't handle a sectorsize which is not a multiple of 16 bytes.
 
+config CRYPTO_FPU
+	tristate "FPU wrapper"
+	select CRYPTO_BLKCIPHER
+	select CRYPTO_MANAGER
+	help
+	  FPU: Wrapper for blkcipher touching FPU.
+
 comment "Hash modes"
 
 config CRYPTO_HMAC
crypto/Makefile +1 -0
@@ -51,6 +51,7 @@ obj-$(CONFIG_CRYPTO_PCBC) += pcbc.o
 obj-$(CONFIG_CRYPTO_CTS) += cts.o
 obj-$(CONFIG_CRYPTO_LRW) += lrw.o
 obj-$(CONFIG_CRYPTO_XTS) += xts.o
+obj-$(CONFIG_CRYPTO_FPU) += fpu.o
 obj-$(CONFIG_CRYPTO_CTR) += ctr.o
 obj-$(CONFIG_CRYPTO_GCM) += gcm.o
 obj-$(CONFIG_CRYPTO_CCM) += ccm.o
crypto/fpu.c new file +166 -0

166 lines not on this page · raw message

#1 lore raw
Quoted 18 lines · * Huang Ying | 2009-03-05 10:25:41 [+0800]:

Blkcipher touching FPU need to be enclosed by kernel_fpu_begin() and kernel_fpu_end(). If they are invoked in cipher algorithm implementation, they will be invoked for each block, so that performance will be hurt, because they are "slow" operations. This patch implements "fpu" template, which makes these operations to be invoked for each request.

---

crypto/Kconfig  |    7 ++
crypto/Makefile |    1 
crypto/fpu.c    |  166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 174 insertions(+)

crypto/Kconfig config CRYPTO_XTS · line 244

Quoted 9 lines
crypto/Kconfig +6 -0
@@ -236,6 +236,13 @@ config CRYPTO_XTS
 	  key size 256, 384 or 512 bits. This implementation currently
 	  can't handle a sectorsize which is not a multiple of 16 bytes.
 
+config CRYPTO_FPU
+	tristate "FPU wrapper"
+	select CRYPTO_BLKCIPHER
+	select CRYPTO_MANAGER
+	help
+	  FPU: Wrapper for blkcipher touching FPU.

I as an end-user have to clue what this could be about. I suggest you don't make it visible since the explanation won't be helpfull either :)

Quoted 4 lines
crypto/Kconfig +1 -0
+

comment "Hash modes"

config CRYPTO_HMAC

Sebastian

author
#2 lore raw
Quoted 23 lines · Sebastian Andrzej Siewior
Quoted 21 lines · * Huang Ying | 2009-03-05 10:25:41 [+0800]:

Blkcipher touching FPU need to be enclosed by kernel_fpu_begin() and kernel_fpu_end(). If they are invoked in cipher algorithm implementation, they will be invoked for each block, so that performance will be hurt, because they are "slow" operations. This patch implements "fpu" template, which makes these operations to be invoked for each request.

---

crypto/Kconfig  |    7 ++
crypto/Makefile |    1 
crypto/fpu.c    |  166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 174 insertions(+)
crypto/Kconfig +0 -0
@@ -236,6 +236,13 @@ config CRYPTO_XTS
 	  key size 256, 384 or 512 bits. This implementation currently
 	  can't handle a sectorsize which is not a multiple of 16 bytes.
 
Quoted 8 lines

crypto/Kconfig config CRYPTO_XTS · line 244

Quoted 6 lines
crypto/Kconfig +6 -0
+config CRYPTO_FPU
+	tristate "FPU wrapper"
+	select CRYPTO_BLKCIPHER
+	select CRYPTO_MANAGER
+	help
+	  FPU: Wrapper for blkcipher touching FPU.

I as an end-user have to clue what this could be about. I suggest you don't make it visible since the explanation won't be helpfull either :)

Yes. That's better. I will change it.

Best Regards,
Huang Ying