mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-22 16:37:31 +09:00
Replace NSS with Pale Moon's
This commit is contained in:
parent
ff1e5e48bf
commit
8c2e376f94
2870 changed files with 1762232 additions and 1374220 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#define GCM_H 1
|
||||
|
||||
#include "blapii.h"
|
||||
#include "pkcs11t.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef NSS_X86_OR_X64
|
||||
|
|
@ -30,26 +31,8 @@
|
|||
#include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
#ifdef __powerpc64__
|
||||
#include "altivec-types.h"
|
||||
|
||||
/* The ghash freebl test tries to use this in C++, and gcc defines conflict. */
|
||||
#ifdef __cplusplus
|
||||
#undef pixel
|
||||
#undef vector
|
||||
#undef bool
|
||||
#endif
|
||||
|
||||
/*
|
||||
* PPC CRYPTO requires at least gcc 5 or clang. The LE check is purely
|
||||
* because it's only been tested on LE. If you're interested in BE,
|
||||
* please send a patch.
|
||||
*/
|
||||
#if (defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 5)) && \
|
||||
defined(IS_LITTLE_ENDIAN)
|
||||
#define USE_PPC_CRYPTO
|
||||
#endif
|
||||
|
||||
#if defined(__powerpc64__)
|
||||
#include "ppc-crypto.h"
|
||||
#endif
|
||||
|
||||
SEC_BEGIN_PROTOS
|
||||
|
|
@ -78,6 +61,18 @@ SECStatus GCM_DecryptUpdate(GCMContext *gcm, unsigned char *outbuf,
|
|||
unsigned int *outlen, unsigned int maxout,
|
||||
const unsigned char *inbuf, unsigned int inlen,
|
||||
unsigned int blocksize);
|
||||
SECStatus GCM_EncryptAEAD(GCMContext *gcm, unsigned char *outbuf,
|
||||
unsigned int *outlen, unsigned int maxout,
|
||||
const unsigned char *inbuf, unsigned int inlen,
|
||||
void *params, unsigned int paramLen,
|
||||
const unsigned char *aad, unsigned int aadLen,
|
||||
unsigned int blocksize);
|
||||
SECStatus GCM_DecryptAEAD(GCMContext *gcm, unsigned char *outbuf,
|
||||
unsigned int *outlen, unsigned int maxout,
|
||||
const unsigned char *inbuf, unsigned int inlen,
|
||||
void *params, unsigned int paramLen,
|
||||
const unsigned char *aad, unsigned int aadLen,
|
||||
unsigned int blocksize);
|
||||
|
||||
/* These functions are here only so we can test them */
|
||||
#define GCM_HASH_LEN_LEN 8 /* gcm hash defines lengths to be 64 bits */
|
||||
|
|
@ -102,6 +97,15 @@ pre_align struct gcmHashContextStr {
|
|||
gcmHashContext *mem;
|
||||
} post_align;
|
||||
|
||||
typedef struct gcmIVContextStr gcmIVContext;
|
||||
struct gcmIVContextStr {
|
||||
PRUint64 counter;
|
||||
PRUint64 max_count;
|
||||
CK_GENERATOR_FUNCTION ivGen;
|
||||
unsigned int fixedBits;
|
||||
unsigned int ivLen;
|
||||
};
|
||||
|
||||
SECStatus gcmHash_Update(gcmHashContext *ghash, const unsigned char *buf,
|
||||
unsigned int len);
|
||||
SECStatus gcmHash_InitContext(gcmHashContext *ghash, const unsigned char *H,
|
||||
|
|
@ -111,6 +115,11 @@ SECStatus gcmHash_Reset(gcmHashContext *ghash, const unsigned char *AAD,
|
|||
SECStatus gcmHash_Final(gcmHashContext *ghash, unsigned char *outbuf,
|
||||
unsigned int *outlen, unsigned int maxout);
|
||||
|
||||
void gcm_InitIVContext(gcmIVContext *gcmiv);
|
||||
SECStatus gcm_GenerateIV(gcmIVContext *gcmIv, unsigned char *iv,
|
||||
unsigned int ivLen, unsigned int fixedBits,
|
||||
CK_GENERATOR_FUNCTION ivGen);
|
||||
|
||||
SEC_END_PROTOS
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue