mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-27 10:57:34 +09:00
update NSS as-of pm27 rev 7606140ee
This commit is contained in:
parent
eeb44de4a1
commit
8015bb7004
24 changed files with 1005 additions and 1400 deletions
|
|
@ -155,3 +155,30 @@ rijndael_native_encryptBlock(AESContext *cx,
|
|||
m = _mm_aesenclast_si128(m, cx->k.keySchedule[cx->Nr]);
|
||||
_mm_storeu_si128((__m128i *)output, m);
|
||||
}
|
||||
|
||||
void
|
||||
rijndael_native_decryptBlock(AESContext *cx,
|
||||
unsigned char *output,
|
||||
const unsigned char *input)
|
||||
{
|
||||
int i;
|
||||
pre_align __m128i m post_align = _mm_loadu_si128((__m128i *)input);
|
||||
m = _mm_xor_si128(m, cx->k.keySchedule[cx->Nr]);
|
||||
for (i = cx->Nr - 1; i > 0; --i) {
|
||||
m = _mm_aesdec_si128(m, cx->k.keySchedule[i]);
|
||||
}
|
||||
m = _mm_aesdeclast_si128(m, cx->k.keySchedule[0]);
|
||||
_mm_storeu_si128((__m128i *)output, m);
|
||||
}
|
||||
|
||||
// out = a ^ b
|
||||
void
|
||||
native_xorBlock(unsigned char *out,
|
||||
const unsigned char *a,
|
||||
const unsigned char *b)
|
||||
{
|
||||
pre_align __m128i post_align in1 = _mm_loadu_si128((__m128i *)(a));
|
||||
pre_align __m128i post_align in2 = _mm_loadu_si128((__m128i *)(b));
|
||||
in1 = _mm_xor_si128(in1, in2);
|
||||
_mm_storeu_si128((__m128i *)(out), in1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue