~ubuntu-branches/ubuntu/utopic/libcrypto++/utopic-security

« back to all changes in this revision

Viewing changes to salsa.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2011-06-04 20:15:34 UTC
  • mfrom: (6.1.8 sid)
  • Revision ID: james.westby@ubuntu.com-20110604201534-g81uxdxxcxy95nhj
Tags: 5.6.1-5
* New maintainer (closes: #628935).
* salsa.patch from upstream to fix testcase FTBFS (closes: #628298).

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
        if (HasSSE2())
123
123
        {
124
124
        #if CRYPTOPP_BOOL_X64
125
 
                #define REG_output                      %4
126
 
                #define REG_input                       %1
 
125
                #define REG_output                      %1
 
126
                #define REG_input                       %0
127
127
                #define REG_iterationCount      %2
128
 
                #define REG_state                       %3
129
 
                #define REG_rounds                      %0
 
128
                #define REG_state                       %4              /* constant */
 
129
                #define REG_rounds                      %3              /* constant */
130
130
                #define REG_roundsLeft          eax
131
131
                #define REG_temp32                      edx
132
132
                #define REG_temp                        rdx
133
 
                #define SSE2_WORKSPACE          %5
 
133
                #define SSE2_WORKSPACE          %5              /* constant */
134
134
 
135
 
                FixedSizeAlignedSecBlock<byte, 32*16> workspace;
 
135
                CRYPTOPP_ALIGN_DATA(16) byte workspace[16*32];
136
136
        #else
137
137
                #define REG_output                      edi
138
138
                #define REG_input                       eax
457
457
#ifdef __GNUC__
458
458
                AS_POP_IF86(    bx)
459
459
                ".att_syntax prefix;"
460
 
                        : 
461
460
        #if CRYPTOPP_BOOL_X64
462
 
                        : "r" (m_rounds), "r" (input), "r" (iterationCount), "r" (m_state.data()), "r" (output), "r" (workspace.m_ptr)
463
 
                        : "%eax", "%edx", "memory", "cc", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "%xmm8", "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15"
 
461
                        : "+r" (input), "+r" (output), "+r" (iterationCount)
 
462
                        : "r" (m_rounds), "r" (m_state.m_ptr), "r" (workspace)
 
463
                        : "%eax", "%rdx", "memory", "cc", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "%xmm8", "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15"
464
464
        #else
465
 
                        : "d" (m_rounds), "a" (input), "c" (iterationCount), "S" (m_state.data()), "D" (output)
 
465
                        : "+a" (input), "+D" (output), "+c" (iterationCount)
 
466
                        : "d" (m_rounds), "S" (m_state.m_ptr)
466
467
                        : "memory", "cc"
467
468
        #endif
468
469
                );