-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gcm #1908
Closed
+1,546
−198
Closed
Gcm #1908
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e5e13ae
core: arm64: add mov_imm assembly macro
jenswi-linaro b367de3
core: io.h: add {get,put}_be{16,32,64}()
jenswi-linaro fdd3aa8
core: import GHASH acceleration routines
jenswi-linaro 80427c4
LTC: add GHASH acceleration
jenswi-linaro 993a8c6
hikey{,960}: CFG_HWSUPP_PMULL=y
jenswi-linaro f73a51e
plat-vexpress: Juno: CFG_HWSUPP_PMULL=y
jenswi-linaro 053918a
core: add temporary CFG_LTC_CRYPTO_GCM
jenswi-linaro f3ddbfd
core: crypto: add new AES-GCM implementation
jenswi-linaro 56db818
core: ltc: remove redundant aes-gcm implementation
jenswi-linaro a865014
core: arm: crypto: fix AES-GCM counter increase
jenswi-linaro b1538e9
core: crypto: merge aes-gcm.h and aes-gcm_ext.h
jenswi-linaro 7d9fabe
[review] LTC: add GHASH acceleration
jenswi-linaro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright (c) 2017, Linaro Limited | ||
* All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
*/ | ||
|
||
#include <crypto/ghash-ce-core.h> | ||
#include <io.h> | ||
#include <tomcrypt_arm_neon.h> | ||
#include <tomcrypt.h> | ||
#include <utee_defines.h> | ||
|
||
/** | ||
GCM multiply by H | ||
@param gcm The GCM state which holds the H value | ||
@param I The value to multiply H by | ||
*/ | ||
void gcm_mult_h(gcm_state *gcm, unsigned char *I) | ||
{ | ||
struct tomcrypt_arm_neon_state state; | ||
const uint8_t zeroes[TEE_AES_BLOCK_SIZE] = { 0 }; | ||
uint64_t k[2]; | ||
uint64_t a; | ||
uint64_t b; | ||
uint64_t dg[2]; | ||
|
||
b = get_be64(gcm->H); | ||
a = get_be64(gcm->H + 8); | ||
|
||
k[0] = (a << 1) | (b >> 63); | ||
k[1] = (b << 1) | (a >> 63); | ||
if (b >> 63) | ||
k[1] ^= 0xc200000000000000UL; | ||
|
||
dg[1] = get_be64(I); | ||
dg[0] = get_be64(I + 8); | ||
|
||
tomcrypt_arm_neon_enable(&state); | ||
#ifdef CFG_HWSUPP_PMULL | ||
pmull_ghash_update_p64(1, dg, zeroes, k, NULL); | ||
#else | ||
pmull_ghash_update_p8(1, dg, zeroes, k, NULL); | ||
#endif | ||
tomcrypt_arm_neon_disable(&state); | ||
|
||
put_be64(I, dg[1]); | ||
put_be64(I + 8, dg[0]); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong place? (should be
#else gcm_mult_h.c
, notgcm_gf_mult.c
)