[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] GNU gnutls branch, master, updated. gnutls_3_0_3-38-g6ec8b57
From: |
Nikos Mavrogiannopoulos |
Subject: |
[SCM] GNU gnutls branch, master, updated. gnutls_3_0_3-38-g6ec8b57 |
Date: |
Thu, 29 Sep 2011 16:04:19 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".
http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=6ec8b573d566d1513f0db8f942d4d55d1d2ef9af
The branch, master has been updated
via 6ec8b573d566d1513f0db8f942d4d55d1d2ef9af (commit)
via a5c1bb3cd6eeab5b8f7c564be282178e87e4f57a (commit)
via 5678e62f9e4df7d0914bc266e83f9e446088a2d9 (commit)
via f3c1f6650707f5b923596c47e30494b6f40b2518 (commit)
via 3edaf986b6dd126397cede1f23d3c35edb5452ae (commit)
via 813e50d810b83c478e46bfe9634131e753ad3a0e (commit)
via 02ae5e25df2f5ceade31e2d79f50b639b446b1a3 (commit)
from e996072af9d15713cafb07b8f653222807bcd31b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6ec8b573d566d1513f0db8f942d4d55d1d2ef9af
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Thu Sep 29 18:04:14 2011 +0200
manually keep the IV.
commit a5c1bb3cd6eeab5b8f7c564be282178e87e4f57a
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Thu Sep 29 14:52:49 2011 +0200
re-added ecb
commit 5678e62f9e4df7d0914bc266e83f9e446088a2d9
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Thu Sep 29 14:01:18 2011 +0200
removed unused modes.
commit f3c1f6650707f5b923596c47e30494b6f40b2518
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Thu Sep 29 13:18:35 2011 +0200
Allow benchmarking the software version of ciphers.
commit 3edaf986b6dd126397cede1f23d3c35edb5452ae
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Thu Sep 29 12:58:15 2011 +0200
fixed compilation without p11-kit
commit 813e50d810b83c478e46bfe9634131e753ad3a0e
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Thu Sep 29 12:49:17 2011 +0200
enabled VIA acceleration.
commit 02ae5e25df2f5ceade31e2d79f50b639b446b1a3
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Thu Sep 29 12:49:02 2011 +0200
small update
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 1 +
lib/accelerated/intel/aes-padlock.c | 24 +-
lib/accelerated/intel/asm/padlock-x86-64.s | 320 --------------------------
lib/accelerated/intel/asm/padlock-x86.s | 338 +---------------------------
src/benchmark-cipher.c | 10 +-
src/benchmark.c | 4 +-
src/benchmark.h | 2 +-
src/cli-gaa.c | 89 ++++----
src/cli-gaa.h | 2 +-
src/cli.gaa | 3 +-
src/p11common.c | 3 +
11 files changed, 81 insertions(+), 715 deletions(-)
diff --git a/configure.ac b/configure.ac
index b3b6fb3..e60c58a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -136,6 +136,7 @@ if test "$with_p11_kit" != "no"; then
GNUTLS_REQUIRES_PRIVATE="${GNUTLS_REQUIRES_PRIVATE},
p11-kit-1"
fi
else
+ with_p11_kit=no
AC_MSG_WARN([[
***
*** p11-kit was not found. PKCS #11 support will be disabled.
diff --git a/lib/accelerated/intel/aes-padlock.c
b/lib/accelerated/intel/aes-padlock.c
index 2d9e042..3332e79 100644
--- a/lib/accelerated/intel/aes-padlock.c
+++ b/lib/accelerated/intel/aes-padlock.c
@@ -88,7 +88,7 @@ int padlock_aes_cipher_setkey(void *_ctx, const void
*userkey, size_t keysize)
/* expand key using nettle */
if (ctx->enc)
aes_set_encrypt_key(&nc, keysize, userkey);
- else
+ else
aes_set_decrypt_key(&nc, keysize, userkey);
memcpy(pce->ks.rd_key, nc.keys, sizeof(nc.keys));
@@ -118,7 +118,7 @@ static int aes_setiv(void *_ctx, const void *iv, size_t
iv_size)
}
static int
-padlock_aes_encrypt(void *_ctx, const void *src, size_t src_size,
+padlock_aes_cbc_encrypt(void *_ctx, const void *src, size_t src_size,
void *dst, size_t dst_size)
{
struct padlock_ctx *ctx = _ctx;
@@ -128,20 +128,24 @@ padlock_aes_encrypt(void *_ctx, const void *src, size_t
src_size,
padlock_cbc_encrypt(dst, src, pce, src_size);
+ memcpy(pce->iv, ((unsigned char*)dst)+(src_size-16), 16);
return 0;
}
static int
-padlock_aes_decrypt(void *_ctx, const void *src, size_t src_size,
+padlock_aes_cbc_decrypt(void *_ctx, const void *src, size_t src_size,
void *dst, size_t dst_size)
{
struct padlock_ctx *ctx = _ctx;
struct padlock_cipher_data *pcd;
+ unsigned char siv[16];
pcd = ALIGN16(&ctx->expanded_key);
+ memcpy(siv, ((unsigned char*)src)+(src_size-16), 16);
padlock_cbc_encrypt(dst, src, pcd, src_size);
+ memcpy(pcd->iv, siv, 16);
return 0;
}
@@ -155,8 +159,8 @@ static const gnutls_crypto_cipher_st aes_padlock_struct = {
.init = aes_cipher_init,
.setkey = padlock_aes_cipher_setkey,
.setiv = aes_setiv,
- .encrypt = padlock_aes_encrypt,
- .decrypt = padlock_aes_decrypt,
+ .encrypt = padlock_aes_cbc_encrypt,
+ .decrypt = padlock_aes_cbc_decrypt,
.deinit = aes_deinit,
};
@@ -167,20 +171,18 @@ static int check_padlock(void)
return ((edx & (0x3 << 6)) == (0x3 << 6));
}
-#ifdef ENABLE_VIA
static unsigned check_via(void)
{
unsigned int a, b, c, d;
_gnutls_cpuid(0, &a, &b, &c, &d);
- if ((memcmp(&b, "VIA ", 4) == 0 &&
- memcmp(&d, "VIA ", 4) == 0 && memcmp(&c, "VIA ", 4) == 0)) {
+ if ((memcmp(&b, "Cent", 4) == 0 &&
+ memcmp(&d, "aurH", 4) == 0 && memcmp(&c, "auls", 4) == 0)) {
return 1;
}
return 0;
}
-#endif
void register_padlock_crypto(void)
{
@@ -189,12 +191,8 @@ void register_padlock_crypto(void)
/* Only enable the 32-bit padlock variant, until
* the 64-bit code is tested.
*/
-#ifndef ENABLE_VIA
- return;
-#else
if (check_via() == 0)
return;
-#endif
if (check_padlock()) {
_gnutls_debug_log("Padlock AES accelerator was detected\n");
diff --git a/lib/accelerated/intel/asm/padlock-x86-64.s
b/lib/accelerated/intel/asm/padlock-x86-64.s
index ebca3ae..a30e212 100644
--- a/lib/accelerated/intel/asm/padlock-x86-64.s
+++ b/lib/accelerated/intel/asm/padlock-x86-64.s
@@ -390,326 +390,6 @@ padlock_cbc_encrypt:
popq %rbp
.byte 0xf3,0xc3
.size padlock_cbc_encrypt,.-padlock_cbc_encrypt
-.globl padlock_cfb_encrypt
-.type padlock_cfb_encrypt,@function
-.align 16
-padlock_cfb_encrypt:
- pushq %rbp
- pushq %rbx
-
- xorl %eax,%eax
- testq $15,%rdx
- jnz .Lcfb_abort
- testq $15,%rcx
- jnz .Lcfb_abort
- leaq .Lpadlock_saved_context(%rip),%rax
- pushf
- cld
- call _padlock_verify_ctx
- leaq 16(%rdx),%rdx
- xorl %eax,%eax
- xorl %ebx,%ebx
- testl $32,(%rdx)
- testq $15,%rdi
- setz %al
- testq $15,%rsi
- setz %bl
- testl %ebx,%eax
- jnz .Lcfb_aligned
- negq %rax
- movq $512,%rbx
- notq %rax
- leaq (%rsp),%rbp
- cmpq %rbx,%rcx
- cmovcq %rcx,%rbx
- andq %rbx,%rax
- movq %rcx,%rbx
- negq %rax
- andq $512-1,%rbx
- leaq (%rax,%rbp,1),%rsp
- jmp .Lcfb_loop
-.align 16
-.Lcfb_loop:
- movq %rdi,%r8
- movq %rsi,%r9
- movq %rcx,%r10
- movq %rbx,%rcx
- movq %rbx,%r11
- testq $15,%rdi
- cmovnzq %rsp,%rdi
- testq $15,%rsi
- jz .Lcfb_inp_aligned
- shrq $3,%rcx
-.byte 0xf3,0x48,0xa5
- subq %rbx,%rdi
- movq %rbx,%rcx
- movq %rdi,%rsi
-.Lcfb_inp_aligned:
- leaq -16(%rdx),%rax
- leaq 16(%rdx),%rbx
- shrq $4,%rcx
-.byte 0xf3,0x0f,0xa7,224
- movdqa (%rax),%xmm0
- movdqa %xmm0,-16(%rdx)
- movq %r8,%rdi
- movq %r11,%rbx
- testq $15,%rdi
- jz .Lcfb_out_aligned
- movq %rbx,%rcx
- shrq $3,%rcx
- leaq (%rsp),%rsi
-.byte 0xf3,0x48,0xa5
- subq %rbx,%rdi
-.Lcfb_out_aligned:
- movq %r9,%rsi
- movq %r10,%rcx
- addq %rbx,%rdi
- addq %rbx,%rsi
- subq %rbx,%rcx
- movq $512,%rbx
- jnz .Lcfb_loop
-
- testq $15,%rdi
- jz .Lcfb_done
-
- movq %rbp,%rcx
- movq %rsp,%rdi
- subq %rsp,%rcx
- xorq %rax,%rax
- shrq $3,%rcx
-.byte 0xf3,0x48,0xab
-.Lcfb_done:
- leaq (%rbp),%rsp
- jmp .Lcfb_exit
-
-.align 16
-.Lcfb_aligned:
- leaq -16(%rdx),%rax
- leaq 16(%rdx),%rbx
- shrq $4,%rcx
-.byte 0xf3,0x0f,0xa7,224
- movdqa (%rax),%xmm0
- movdqa %xmm0,-16(%rdx)
-.Lcfb_exit:
- movl $1,%eax
- leaq 8(%rsp),%rsp
-.Lcfb_abort:
- popq %rbx
- popq %rbp
- .byte 0xf3,0xc3
-.size padlock_cfb_encrypt,.-padlock_cfb_encrypt
-.globl padlock_ofb_encrypt
-.type padlock_ofb_encrypt,@function
-.align 16
-padlock_ofb_encrypt:
- pushq %rbp
- pushq %rbx
-
- xorl %eax,%eax
- testq $15,%rdx
- jnz .Lofb_abort
- testq $15,%rcx
- jnz .Lofb_abort
- leaq .Lpadlock_saved_context(%rip),%rax
- pushf
- cld
- call _padlock_verify_ctx
- leaq 16(%rdx),%rdx
- xorl %eax,%eax
- xorl %ebx,%ebx
- testl $32,(%rdx)
- testq $15,%rdi
- setz %al
- testq $15,%rsi
- setz %bl
- testl %ebx,%eax
- jnz .Lofb_aligned
- negq %rax
- movq $512,%rbx
- notq %rax
- leaq (%rsp),%rbp
- cmpq %rbx,%rcx
- cmovcq %rcx,%rbx
- andq %rbx,%rax
- movq %rcx,%rbx
- negq %rax
- andq $512-1,%rbx
- leaq (%rax,%rbp,1),%rsp
- jmp .Lofb_loop
-.align 16
-.Lofb_loop:
- movq %rdi,%r8
- movq %rsi,%r9
- movq %rcx,%r10
- movq %rbx,%rcx
- movq %rbx,%r11
- testq $15,%rdi
- cmovnzq %rsp,%rdi
- testq $15,%rsi
- jz .Lofb_inp_aligned
- shrq $3,%rcx
-.byte 0xf3,0x48,0xa5
- subq %rbx,%rdi
- movq %rbx,%rcx
- movq %rdi,%rsi
-.Lofb_inp_aligned:
- leaq -16(%rdx),%rax
- leaq 16(%rdx),%rbx
- shrq $4,%rcx
-.byte 0xf3,0x0f,0xa7,232
- movdqa (%rax),%xmm0
- movdqa %xmm0,-16(%rdx)
- movq %r8,%rdi
- movq %r11,%rbx
- testq $15,%rdi
- jz .Lofb_out_aligned
- movq %rbx,%rcx
- shrq $3,%rcx
- leaq (%rsp),%rsi
-.byte 0xf3,0x48,0xa5
- subq %rbx,%rdi
-.Lofb_out_aligned:
- movq %r9,%rsi
- movq %r10,%rcx
- addq %rbx,%rdi
- addq %rbx,%rsi
- subq %rbx,%rcx
- movq $512,%rbx
- jnz .Lofb_loop
-
- testq $15,%rdi
- jz .Lofb_done
-
- movq %rbp,%rcx
- movq %rsp,%rdi
- subq %rsp,%rcx
- xorq %rax,%rax
- shrq $3,%rcx
-.byte 0xf3,0x48,0xab
-.Lofb_done:
- leaq (%rbp),%rsp
- jmp .Lofb_exit
-
-.align 16
-.Lofb_aligned:
- leaq -16(%rdx),%rax
- leaq 16(%rdx),%rbx
- shrq $4,%rcx
-.byte 0xf3,0x0f,0xa7,232
- movdqa (%rax),%xmm0
- movdqa %xmm0,-16(%rdx)
-.Lofb_exit:
- movl $1,%eax
- leaq 8(%rsp),%rsp
-.Lofb_abort:
- popq %rbx
- popq %rbp
- .byte 0xf3,0xc3
-.size padlock_ofb_encrypt,.-padlock_ofb_encrypt
-.globl padlock_ctr16_encrypt
-.type padlock_ctr16_encrypt,@function
-.align 16
-padlock_ctr16_encrypt:
- pushq %rbp
- pushq %rbx
-
- xorl %eax,%eax
- testq $15,%rdx
- jnz .Lctr16_abort
- testq $15,%rcx
- jnz .Lctr16_abort
- leaq .Lpadlock_saved_context(%rip),%rax
- pushf
- cld
- call _padlock_verify_ctx
- leaq 16(%rdx),%rdx
- xorl %eax,%eax
- xorl %ebx,%ebx
- testl $32,(%rdx)
- testq $15,%rdi
- setz %al
- testq $15,%rsi
- setz %bl
- testl %ebx,%eax
- jnz .Lctr16_aligned
- negq %rax
- movq $512,%rbx
- notq %rax
- leaq (%rsp),%rbp
- cmpq %rbx,%rcx
- cmovcq %rcx,%rbx
- andq %rbx,%rax
- movq %rcx,%rbx
- negq %rax
- andq $512-1,%rbx
- leaq (%rax,%rbp,1),%rsp
- jmp .Lctr16_loop
-.align 16
-.Lctr16_loop:
- movq %rdi,%r8
- movq %rsi,%r9
- movq %rcx,%r10
- movq %rbx,%rcx
- movq %rbx,%r11
- testq $15,%rdi
- cmovnzq %rsp,%rdi
- testq $15,%rsi
- jz .Lctr16_inp_aligned
- shrq $3,%rcx
-.byte 0xf3,0x48,0xa5
- subq %rbx,%rdi
- movq %rbx,%rcx
- movq %rdi,%rsi
-.Lctr16_inp_aligned:
- leaq -16(%rdx),%rax
- leaq 16(%rdx),%rbx
- shrq $4,%rcx
-.byte 0xf3,0x0f,0xa7,216
- movq %r8,%rdi
- movq %r11,%rbx
- testq $15,%rdi
- jz .Lctr16_out_aligned
- movq %rbx,%rcx
- shrq $3,%rcx
- leaq (%rsp),%rsi
-.byte 0xf3,0x48,0xa5
- subq %rbx,%rdi
-.Lctr16_out_aligned:
- movq %r9,%rsi
- movq %r10,%rcx
- addq %rbx,%rdi
- addq %rbx,%rsi
- subq %rbx,%rcx
- movq $512,%rbx
- jnz .Lctr16_loop
-
- testq $15,%rdi
- jz .Lctr16_done
-
- movq %rbp,%rcx
- movq %rsp,%rdi
- subq %rsp,%rcx
- xorq %rax,%rax
- shrq $3,%rcx
-.byte 0xf3,0x48,0xab
-.Lctr16_done:
- leaq (%rbp),%rsp
- jmp .Lctr16_exit
-
-.align 16
-.Lctr16_aligned:
- leaq -16(%rdx),%rax
- leaq 16(%rdx),%rbx
- shrq $4,%rcx
-.byte 0xf3,0x0f,0xa7,216
-.Lctr16_exit:
- movl $1,%eax
- leaq 8(%rsp),%rsp
-.Lctr16_abort:
- popq %rbx
- popq %rbp
- .byte 0xf3,0xc3
-.size padlock_ctr16_encrypt,.-padlock_ctr16_encrypt
.byte
86,73,65,32,80,97,100,108,111,99,107,32,120,56,54,95,54,52,32,109,111,100,117,108,101,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
.align 16
.data
diff --git a/lib/accelerated/intel/asm/padlock-x86.s
b/lib/accelerated/intel/asm/padlock-x86.s
index e81c967..a55c61b 100644
--- a/lib/accelerated/intel/asm/padlock-x86.s
+++ b/lib/accelerated/intel/asm/padlock-x86.s
@@ -35,7 +35,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.file "e_padlock-x86.s"
+.file "padlock-x86.s"
.text
.globl padlock_capability
.type padlock_capability,@function
@@ -386,337 +386,6 @@ padlock_cbc_encrypt:
popl %ebp
ret
.size padlock_cbc_encrypt,.-.L_padlock_cbc_encrypt_begin
-.globl padlock_cfb_encrypt
-.type padlock_cfb_encrypt,@function
-.align 16
-padlock_cfb_encrypt:
-.L_padlock_cfb_encrypt_begin:
- pushl %ebp
- pushl %ebx
- pushl %esi
- pushl %edi
- movl 20(%esp),%edi
- movl 24(%esp),%esi
- movl 28(%esp),%edx
- movl 32(%esp),%ecx
- testl $15,%edx
- jnz .L020cfb_abort
- testl $15,%ecx
- jnz .L020cfb_abort
- leal .Lpadlock_saved_context-.L021cfb_pic_point,%eax
- pushfl
- cld
- call _padlock_verify_ctx
-.L021cfb_pic_point:
- leal 16(%edx),%edx
- xorl %eax,%eax
- xorl %ebx,%ebx
- testl $32,(%edx)
- jnz .L022cfb_aligned
- testl $15,%edi
- setz %al
- testl $15,%esi
- setz %bl
- testl %ebx,%eax
- jnz .L022cfb_aligned
- negl %eax
- movl $512,%ebx
- notl %eax
- leal -24(%esp),%ebp
- cmpl %ebx,%ecx
- cmovcl %ecx,%ebx
- andl %ebx,%eax
- movl %ecx,%ebx
- negl %eax
- andl $511,%ebx
- leal (%eax,%ebp,1),%esp
- andl $-16,%esp
- jmp .L023cfb_loop
-.align 16
-.L023cfb_loop:
- movl %edi,(%ebp)
- movl %esi,4(%ebp)
- movl %ecx,8(%ebp)
- movl %ebx,%ecx
- movl %ebx,12(%ebp)
- testl $15,%edi
- cmovnzl %esp,%edi
- testl $15,%esi
- jz .L024cfb_inp_aligned
- shrl $2,%ecx
-.byte 243,165
- subl %ebx,%edi
- movl %ebx,%ecx
- movl %edi,%esi
-.L024cfb_inp_aligned:
- leal -16(%edx),%eax
- leal 16(%edx),%ebx
- shrl $4,%ecx
-.byte 243,15,167,224
- movdqa (%eax),%xmm0
- movdqa %xmm0,-16(%edx)
- movl (%ebp),%edi
- movl 12(%ebp),%ebx
- testl $15,%edi
- jz .L025cfb_out_aligned
- movl %ebx,%ecx
- shrl $2,%ecx
- leal (%esp),%esi
-.byte 243,165
- subl %ebx,%edi
-.L025cfb_out_aligned:
- movl 4(%ebp),%esi
- movl 8(%ebp),%ecx
- addl %ebx,%edi
- addl %ebx,%esi
- subl %ebx,%ecx
- movl $512,%ebx
- jnz .L023cfb_loop
- testl $15,%edi
- jz .L026cfb_done
- movl %ebp,%ecx
- movl %esp,%edi
- subl %esp,%ecx
- xorl %eax,%eax
- shrl $2,%ecx
-.byte 243,171
-.L026cfb_done:
- leal 24(%ebp),%esp
- jmp .L027cfb_exit
-.align 16
-.L022cfb_aligned:
- leal -16(%edx),%eax
- leal 16(%edx),%ebx
- shrl $4,%ecx
-.byte 243,15,167,224
- movdqa (%eax),%xmm0
- movdqa %xmm0,-16(%edx)
-.L027cfb_exit:
- movl $1,%eax
- leal 4(%esp),%esp
-.L020cfb_abort:
- popl %edi
- popl %esi
- popl %ebx
- popl %ebp
- ret
-.size padlock_cfb_encrypt,.-.L_padlock_cfb_encrypt_begin
-.globl padlock_ofb_encrypt
-.type padlock_ofb_encrypt,@function
-.align 16
-padlock_ofb_encrypt:
-.L_padlock_ofb_encrypt_begin:
- pushl %ebp
- pushl %ebx
- pushl %esi
- pushl %edi
- movl 20(%esp),%edi
- movl 24(%esp),%esi
- movl 28(%esp),%edx
- movl 32(%esp),%ecx
- testl $15,%edx
- jnz .L028ofb_abort
- testl $15,%ecx
- jnz .L028ofb_abort
- leal .Lpadlock_saved_context-.L029ofb_pic_point,%eax
- pushfl
- cld
- call _padlock_verify_ctx
-.L029ofb_pic_point:
- leal 16(%edx),%edx
- xorl %eax,%eax
- xorl %ebx,%ebx
- testl $32,(%edx)
- jnz .L030ofb_aligned
- testl $15,%edi
- setz %al
- testl $15,%esi
- setz %bl
- testl %ebx,%eax
- jnz .L030ofb_aligned
- negl %eax
- movl $512,%ebx
- notl %eax
- leal -24(%esp),%ebp
- cmpl %ebx,%ecx
- cmovcl %ecx,%ebx
- andl %ebx,%eax
- movl %ecx,%ebx
- negl %eax
- andl $511,%ebx
- leal (%eax,%ebp,1),%esp
- andl $-16,%esp
- jmp .L031ofb_loop
-.align 16
-.L031ofb_loop:
- movl %edi,(%ebp)
- movl %esi,4(%ebp)
- movl %ecx,8(%ebp)
- movl %ebx,%ecx
- movl %ebx,12(%ebp)
- testl $15,%edi
- cmovnzl %esp,%edi
- testl $15,%esi
- jz .L032ofb_inp_aligned
- shrl $2,%ecx
-.byte 243,165
- subl %ebx,%edi
- movl %ebx,%ecx
- movl %edi,%esi
-.L032ofb_inp_aligned:
- leal -16(%edx),%eax
- leal 16(%edx),%ebx
- shrl $4,%ecx
-.byte 243,15,167,232
- movdqa (%eax),%xmm0
- movdqa %xmm0,-16(%edx)
- movl (%ebp),%edi
- movl 12(%ebp),%ebx
- testl $15,%edi
- jz .L033ofb_out_aligned
- movl %ebx,%ecx
- shrl $2,%ecx
- leal (%esp),%esi
-.byte 243,165
- subl %ebx,%edi
-.L033ofb_out_aligned:
- movl 4(%ebp),%esi
- movl 8(%ebp),%ecx
- addl %ebx,%edi
- addl %ebx,%esi
- subl %ebx,%ecx
- movl $512,%ebx
- jnz .L031ofb_loop
- testl $15,%edi
- jz .L034ofb_done
- movl %ebp,%ecx
- movl %esp,%edi
- subl %esp,%ecx
- xorl %eax,%eax
- shrl $2,%ecx
-.byte 243,171
-.L034ofb_done:
- leal 24(%ebp),%esp
- jmp .L035ofb_exit
-.align 16
-.L030ofb_aligned:
- leal -16(%edx),%eax
- leal 16(%edx),%ebx
- shrl $4,%ecx
-.byte 243,15,167,232
- movdqa (%eax),%xmm0
- movdqa %xmm0,-16(%edx)
-.L035ofb_exit:
- movl $1,%eax
- leal 4(%esp),%esp
-.L028ofb_abort:
- popl %edi
- popl %esi
- popl %ebx
- popl %ebp
- ret
-.size padlock_ofb_encrypt,.-.L_padlock_ofb_encrypt_begin
-.globl padlock_ctr16_encrypt
-.type padlock_ctr16_encrypt,@function
-.align 16
-padlock_ctr16_encrypt:
-.L_padlock_ctr16_encrypt_begin:
- pushl %ebp
- pushl %ebx
- pushl %esi
- pushl %edi
- movl 20(%esp),%edi
- movl 24(%esp),%esi
- movl 28(%esp),%edx
- movl 32(%esp),%ecx
- testl $15,%edx
- jnz .L036ctr16_abort
- testl $15,%ecx
- jnz .L036ctr16_abort
- leal .Lpadlock_saved_context-.L037ctr16_pic_point,%eax
- pushfl
- cld
- call _padlock_verify_ctx
-.L037ctr16_pic_point:
- leal 16(%edx),%edx
- xorl %eax,%eax
- movdqa -16(%edx),%xmm0
- movl $512,%ebx
- notl %eax
- leal -24(%esp),%ebp
- cmpl %ebx,%ecx
- cmovcl %ecx,%ebx
- andl %ebx,%eax
- movl %ecx,%ebx
- negl %eax
- andl $511,%ebx
- leal (%eax,%ebp,1),%esp
- andl $-16,%esp
- jmp .L038ctr16_loop
-.align 16
-.L038ctr16_loop:
- movl %edi,(%ebp)
- movl %esi,4(%ebp)
- movl %ecx,8(%ebp)
- movl %ebx,%ecx
- movl %ebx,12(%ebp)
- pextrw $7,%xmm0,%ecx
- movl $1,%esi
- xorl %edi,%edi
- xchgb %cl,%ch
-.L039ctr16_prepare:
- movdqa %xmm0,(%esp,%edi,1)
- leal (%ecx,%esi,1),%eax
- xchgb %al,%ah
- leal 16(%edi),%edi
- pinsrw $7,%eax,%xmm0
- leal 1(%esi),%esi
- cmpl %ebx,%edi
- jb .L039ctr16_prepare
- leal (%esp),%esi
- leal (%esp),%edi
- movl %ebx,%ecx
- leal -16(%edx),%eax
- leal 16(%edx),%ebx
- shrl $4,%ecx
-.byte 243,15,167,200
- movl (%ebp),%edi
- movl 12(%ebp),%ebx
- movl 4(%ebp),%esi
- xorl %ecx,%ecx
-.L040ctr16_xor:
- movdqu (%esi,%ecx,1),%xmm1
- leal 16(%ecx),%ecx
- pxor -16(%esp,%ecx,1),%xmm1
- movdqu %xmm1,-16(%edi,%ecx,1)
- cmpl %ebx,%ecx
- jb .L040ctr16_xor
- movl 8(%ebp),%ecx
- addl %ebx,%edi
- addl %ebx,%esi
- subl %ebx,%ecx
- movl $512,%ebx
- jnz .L038ctr16_loop
- movdqa %xmm0,-16(%edx)
- pxor %xmm0,%xmm0
- pxor %xmm1,%xmm1
- movl %ebp,%ecx
- movl %esp,%edi
- subl %esp,%ecx
- xorl %eax,%eax
- shrl $2,%ecx
-.byte 243,171
-.L041ctr16_done:
- leal 24(%ebp),%esp
- movl $1,%eax
- leal 4(%esp),%esp
-.L036ctr16_abort:
- popl %edi
- popl %esi
- popl %ebx
- popl %ebp
- ret
-.size padlock_ctr16_encrypt,.-.L_padlock_ctr16_encrypt_begin
.globl padlock_xstore
.type padlock_xstore,@function
.align 16
@@ -736,10 +405,10 @@ _win32_segv_handler:
movl 4(%esp),%edx
movl 12(%esp),%ecx
cmpl $3221225477,(%edx)
- jne .L042ret
+ jne .L020ret
addl $4,184(%ecx)
movl $0,%eax
-.L042ret:
+.L020ret:
ret
.size _win32_segv_handler,.-_win32_segv_handler
.globl padlock_sha1_oneshot
@@ -819,4 +488,3 @@ padlock_sha256:
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif
-
diff --git a/src/benchmark-cipher.c b/src/benchmark-cipher.c
index d43bc0c..534af75 100644
--- a/src/benchmark-cipher.c
+++ b/src/benchmark-cipher.c
@@ -202,13 +202,15 @@ mac_bench (int algo, int size)
free (_key);
}
-void benchmark_cipher (int debug_level)
+void benchmark_cipher (int init, int debug_level)
{
gnutls_global_set_log_function (tls_log_func);
gnutls_global_set_log_level (debug_level);
- gnutls_global_init ();
-
- gnutls_rnd( GNUTLS_RND_NONCE, data, sizeof(data));
+ if (init)
+ {
+ gnutls_global_init ();
+ gnutls_rnd( GNUTLS_RND_NONCE, data, sizeof(data));
+ }
cipher_bench ( GNUTLS_CIPHER_AES_128_GCM, 16, 1);
cipher_mac_bench ( GNUTLS_CIPHER_AES_128_CBC, GNUTLS_MAC_SHA256, 16);
diff --git a/src/benchmark.c b/src/benchmark.c
index a94f44c..229f24b 100644
--- a/src/benchmark.c
+++ b/src/benchmark.c
@@ -117,6 +117,7 @@ void start_benchmark(struct benchmark_st * st)
double stop_benchmark(struct benchmark_st * st, const char* metric)
{
double secs;
+ unsigned long lsecs;
struct timespec stop;
double dspeed, ddata;
char imetric[16];
@@ -132,8 +133,9 @@ double stop_benchmark(struct benchmark_st * st, const char*
metric)
gettime (&stop);
- secs = (stop.tv_sec * 1000 + stop.tv_nsec / (1000 * 1000) -
+ lsecs = (stop.tv_sec * 1000 + stop.tv_nsec / (1000 * 1000) -
(st->start.tv_sec * 1000 + st->start.tv_nsec / (1000 * 1000)));
+ secs = lsecs;
secs /= 1000;
if (metric == NULL)
diff --git a/src/benchmark.h b/src/benchmark.h
index 1485a03..0bf172e 100644
--- a/src/benchmark.h
+++ b/src/benchmark.h
@@ -5,7 +5,7 @@
typedef void (*sighandler_t)(int);
-void benchmark_cipher (int debug_level);
+void benchmark_cipher (int init, int debug_level);
void benchmark_tls (int debug_level);
struct benchmark_st
diff --git a/src/cli-gaa.c b/src/cli-gaa.c
index 7c86e2b..8959237 100644
--- a/src/cli-gaa.c
+++ b/src/cli-gaa.c
@@ -158,6 +158,7 @@ void gaa_help(void)
__gaa_helpsingle('p', "port", "PORT ", "The port to connect to.");
__gaa_helpsingle(0, "insecure", "", "Don't abort program if server
certificate can't be validated.");
__gaa_helpsingle(0, "benchmark-ciphers", "", "Benchmark individual
ciphers.");
+ __gaa_helpsingle(0, "benchmark-soft-ciphers", "", "Benchmark individual
software ciphers.");
__gaa_helpsingle(0, "benchmark-tls", "", "Benchmark ciphers and key
exchange methods in TLS.");
__gaa_helpsingle('l', "list", "", "Print a list of the supported
algorithms and modes.");
__gaa_helpsingle('h', "help", "", "prints this help");
@@ -176,7 +177,7 @@ typedef struct _gaainfo gaainfo;
struct _gaainfo
{
-#line 110 "cli.gaa"
+#line 111 "cli.gaa"
char *rest_args;
#line 99 "cli.gaa"
int insecure;
@@ -290,41 +291,42 @@ static int gaa_error = 0;
#define GAA_MULTIPLE_OPTION 3
#define GAA_REST 0
-#define GAA_NB_OPTION 34
+#define GAA_NB_OPTION 35
#define GAAOPTID_version 1
#define GAAOPTID_help 2
#define GAAOPTID_list 3
#define GAAOPTID_benchmark_tls 4
-#define GAAOPTID_benchmark_ciphers 5
-#define GAAOPTID_insecure 6
-#define GAAOPTID_port 7
-#define GAAOPTID_pskkey 8
-#define GAAOPTID_pskusername 9
-#define GAAOPTID_srppasswd 10
-#define GAAOPTID_srpusername 11
-#define GAAOPTID_x509certfile 12
-#define GAAOPTID_x509keyfile 13
-#define GAAOPTID_pgpsubkey 14
-#define GAAOPTID_pgpcertfile 15
-#define GAAOPTID_pgpkeyring 16
-#define GAAOPTID_pgpkeyfile 17
-#define GAAOPTID_x509crlfile 18
-#define GAAOPTID_x509cafile 19
-#define GAAOPTID_priority 20
-#define GAAOPTID_verbose 21
-#define GAAOPTID_recordsize 22
-#define GAAOPTID_print_cert 23
-#define GAAOPTID_disable_extensions 24
-#define GAAOPTID_fingerprint 25
-#define GAAOPTID_x509fmtder 26
-#define GAAOPTID_crlf 27
-#define GAAOPTID_mtu 28
-#define GAAOPTID_udp 29
-#define GAAOPTID_starttls 30
-#define GAAOPTID_noticket 31
-#define GAAOPTID_rehandshake 32
-#define GAAOPTID_resume 33
-#define GAAOPTID_debug 34
+#define GAAOPTID_benchmark_soft_ciphers 5
+#define GAAOPTID_benchmark_ciphers 6
+#define GAAOPTID_insecure 7
+#define GAAOPTID_port 8
+#define GAAOPTID_pskkey 9
+#define GAAOPTID_pskusername 10
+#define GAAOPTID_srppasswd 11
+#define GAAOPTID_srpusername 12
+#define GAAOPTID_x509certfile 13
+#define GAAOPTID_x509keyfile 14
+#define GAAOPTID_pgpsubkey 15
+#define GAAOPTID_pgpcertfile 16
+#define GAAOPTID_pgpkeyring 17
+#define GAAOPTID_pgpkeyfile 18
+#define GAAOPTID_x509crlfile 19
+#define GAAOPTID_x509cafile 20
+#define GAAOPTID_priority 21
+#define GAAOPTID_verbose 22
+#define GAAOPTID_recordsize 23
+#define GAAOPTID_print_cert 24
+#define GAAOPTID_disable_extensions 25
+#define GAAOPTID_fingerprint 26
+#define GAAOPTID_x509fmtder 27
+#define GAAOPTID_crlf 28
+#define GAAOPTID_mtu 29
+#define GAAOPTID_udp 30
+#define GAAOPTID_starttls 31
+#define GAAOPTID_noticket 32
+#define GAAOPTID_rehandshake 33
+#define GAAOPTID_resume 34
+#define GAAOPTID_debug 35
#line 168 "gaa.skel"
@@ -672,6 +674,7 @@ static int gaa_get_option_num(char *str, int status)
GAA_CHECK1STR("h", GAAOPTID_help);
GAA_CHECK1STR("l", GAAOPTID_list);
GAA_CHECK1STR("", GAAOPTID_benchmark_tls);
+ GAA_CHECK1STR("", GAAOPTID_benchmark_soft_ciphers);
GAA_CHECK1STR("", GAAOPTID_benchmark_ciphers);
GAA_CHECK1STR("", GAAOPTID_insecure);
GAA_CHECK1STR("V", GAAOPTID_verbose);
@@ -693,6 +696,7 @@ static int gaa_get_option_num(char *str, int status)
GAA_CHECKSTR("help", GAAOPTID_help);
GAA_CHECKSTR("list", GAAOPTID_list);
GAA_CHECKSTR("benchmark-tls", GAAOPTID_benchmark_tls);
+ GAA_CHECKSTR("benchmark-soft-ciphers",
GAAOPTID_benchmark_soft_ciphers);
GAA_CHECKSTR("benchmark-ciphers",
GAAOPTID_benchmark_ciphers);
GAA_CHECKSTR("insecure", GAAOPTID_insecure);
GAA_CHECKSTR("port", GAAOPTID_port);
@@ -774,36 +778,43 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo
*gaaval, char *opt_list)
{
case GAAOPTID_version:
OK = 0;
-#line 108 "cli.gaa"
+#line 109 "cli.gaa"
{ cli_version(); exit(0); ;};
return GAA_OK;
break;
case GAAOPTID_help:
OK = 0;
-#line 106 "cli.gaa"
+#line 107 "cli.gaa"
{ gaa_help(); exit(0); ;};
return GAA_OK;
break;
case GAAOPTID_list:
OK = 0;
-#line 105 "cli.gaa"
+#line 106 "cli.gaa"
{ print_list(gaaval->verbose); exit(0); ;};
return GAA_OK;
break;
case GAAOPTID_benchmark_tls:
OK = 0;
-#line 103 "cli.gaa"
+#line 104 "cli.gaa"
{ benchmark_tls(gaaval->debug); exit(0) ;};
return GAA_OK;
break;
+ case GAAOPTID_benchmark_soft_ciphers:
+ OK = 0;
+#line 103 "cli.gaa"
+{ benchmark_cipher(0, gaaval->debug); exit(0) ;};
+
+ return GAA_OK;
+ break;
case GAAOPTID_benchmark_ciphers:
OK = 0;
#line 102 "cli.gaa"
-{ benchmark_cipher(gaaval->debug); exit(0) ;};
+{ benchmark_cipher(1, gaaval->debug); exit(0) ;};
return GAA_OK;
break;
@@ -1065,7 +1076,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo
*gaaval, char *opt_list)
GAA_TESTMOREARGS;
GAA_FILL(GAAREST_tmp.arg1, gaa_getstr, GAAREST_tmp.size1);
gaa_index++;
-#line 111 "cli.gaa"
+#line 112 "cli.gaa"
{ gaaval->rest_args = GAAREST_tmp.arg1; ;};
return GAA_OK;
@@ -1094,7 +1105,7 @@ int gaa(int argc, char **argv, gaainfo *gaaval)
if(inited == 0)
{
-#line 113 "cli.gaa"
+#line 114 "cli.gaa"
{ gaaval->resume=0; gaaval->noticket=0; gaaval->port="443";
gaaval->rest_args=NULL;
gaaval->record_size=0;
gaaval->fingerprint=0; gaaval->pgp_keyring=NULL; gaaval->x509_crlfile =
NULL;
diff --git a/src/cli-gaa.h b/src/cli-gaa.h
index d4a5188..2a44d2d 100644
--- a/src/cli-gaa.h
+++ b/src/cli-gaa.h
@@ -8,7 +8,7 @@ typedef struct _gaainfo gaainfo;
struct _gaainfo
{
-#line 110 "cli.gaa"
+#line 111 "cli.gaa"
char *rest_args;
#line 99 "cli.gaa"
int insecure;
diff --git a/src/cli.gaa b/src/cli.gaa
index 1d1c74f..b06d336 100644
--- a/src/cli.gaa
+++ b/src/cli.gaa
@@ -99,7 +99,8 @@ option (p, port) STR "PORT" { $port = $1 } "The port to
connect to."
#int insecure;
option (insecure) { $insecure = 1 } "Don't abort program if server certificate
can't be validated."
-option ( benchmark-ciphers) { benchmark_cipher($debug); exit(0) } "Benchmark
individual ciphers."
+option ( benchmark-ciphers) { benchmark_cipher(1, $debug); exit(0) }
"Benchmark individual ciphers."
+option ( benchmark-soft-ciphers) { benchmark_cipher(0, $debug); exit(0) }
"Benchmark individual software ciphers."
option ( benchmark-tls) { benchmark_tls($debug); exit(0) } "Benchmark ciphers
and key exchange methods in TLS."
option (l, list) { print_list($verbose); exit(0); } "Print a list of the
supported algorithms and modes."
diff --git a/src/p11common.c b/src/p11common.c
index 0a8cf85..8deda79 100644
--- a/src/p11common.c
+++ b/src/p11common.c
@@ -28,6 +28,8 @@
#include <gnutls/pkcs11.h>
#include <p11common.h>
+#ifdef ENABLE_PKCS11
+
#define MIN(x,y) ((x)<(y))?(x):(y)
#define MAX_CACHE_TRIES 5
@@ -130,3 +132,4 @@ pkcs11_common (void)
}
+#endif
hooks/post-receive
--
GNU gnutls
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] GNU gnutls branch, master, updated. gnutls_3_0_3-38-g6ec8b57,
Nikos Mavrogiannopoulos <=