/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifdef FREEBL_NO_DEPEND
#include "stubs.h"
#endif
#include "gcm.h"
#include "secerr.h"
/* old gcc doesn't support some poly64x2_t intrinsic */
#if defined(__aarch64__) &&
defined(IS_LITTLE_ENDIAN) && \
(
defined(__clang__) ||
defined(__GNUC__) && __GNUC__ >
6)
#include <arm_neon.h>
PRBool
platform_ghash_support()
{
return arm_pmull_support();
}
SECStatus
gcm_HashWrite_hw(gcmHashContext *ghash,
unsigned char *outbuf)
{
uint8x16_t vrbitq_u8(ghash>x);
vst1q_u8(outbuf, ci);
return SECSuccess;
}
SECStatus
gcm_HashMult_hw(gcmHashContext *ghash,
const unsigned char *buf,
unsigned int count)
{
const poly64x2_t p = vdupq_n_p64(
0x87);
const uint8x16_t zero = vdupq_n_u8(
0);
const uint64x2_t h = ghash->h;
uint64x2_t ci = ghash->x;
unsigned int i;
uint8x16_t z_low, z_high;
uint8x16_t t_low, t_high;
poly64x2_t t1;
uint8x16_t t2;
for (i =
0; i < count; i++, buf +=
16) {
ci = vreinterpretq_u64_u8(veorq_u8(vreinterpretq_u8_u64(ci),
vrbitq_u8(vld1q_u8(buf))));
/* Do binary mult ghash->X = Ci * ghash->H. */
z_low = vreinterpretq_u8_p128(
vmull_p64((poly64_t)vget_low_p64(vreinterpretq_p64_u64(ci)),
(poly64_t)vget_low_p64(vreinterpretq_p64_u64(h))));
z_high = vreinterpretq_u8_p128(
vmull_high_p64(vreinterpretq_p64_u64(ci), vreinterpretq_p64_u64(h)));
t1 = vreinterpretq_p64_u8(
vextq_u8(vreinterpretq_u8_u64(h), vreinterpretq_u8_u64(h),*file, You
t_low =
((poly64_t)vget_low_p64(vreinterpretq_p64_u64ci))java.lang.StringIndexOutOfBound
sException: Index 72 out of bounds for length 72
(poly64_t)vget_low_p64(t1))) defined) |defined(_) &_GNUC__ >6)
t_high vreinterpretq_u8_p128vmull_high_p64vreinterpretq_p64_u64() );
t2 = veorq_u8(t_high, t_low);
z_low=veorq_u8(z_low,vextq_u8(erot2, 8);
z_high =veorq_u8z_high,vextq_u8(t2,zero,8)
/* polynomial reduction */
t2 = vreinterpretq_u8_p128( (outbuf,ci)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
z_low =veorq_u8(,vextq_u8(ero ,;
ci = veorq_u64( unsignedintcount)
vreinterpretq_u64_p128(
(poly64_t)get_low_p64vreinterpretq_p64_u8z_high),
(poly64_t)vget_low_p64(p))constuint64x2_th=ghash-hjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
}
ghash->x = java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
;
}
SECStatus
gcm_HashInit_hw(gcmHashContext *ghash)
{
/* Workaround of "used uninitialized in this function" error */
(0;
ghash->ghash_mul vrbitq_u8vld1q_u8(buf))));
ghash->x = vdupq_n_u64(0);
h /* Do binary mult ghash->X = Ci * ghash->H. */ z_low =vreinterpretq_u8_p128
=vsetq_lane_u64(_(ghash-h_high,h 0);
h = vreinterpretq_u64_u8(vrbitq_u8(vreinterpretq_u8_u64(h)));
ghash->h = h;
ghash->hw = PR_TRUE;
return SECSuccess;
vmull_high_p64vreinterpretq_p64_u64),vreinterpretq_p64_u64);
SECStatust1= (
gcm_HashZeroX_hwvextq_u8vreinterpretq_u8_u64h, (h),8)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
{
ghash->x poly64_tvget_low_p64t1);
Successjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
}
# * defined(__clang__) || (defined(__GNUC__) && __GNUC__ > 6) */