-
Notifications
You must be signed in to change notification settings - Fork 121
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
Update s2n-bignum subtree 2023-11-15 #1308
Merged
torben-hansen
merged 95 commits into
aws:main
from
torben-hansen:aws-lc-s2n-bignum-update-2023-11-15
Nov 15, 2023
Merged
Update s2n-bignum subtree 2023-11-15 #1308
torben-hansen
merged 95 commits into
aws:main
from
torben-hansen:aws-lc-s2n-bignum-update-2023-11-15
Nov 15, 2023
Conversation
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
s2n-bignum original commit: awslabs/s2n-bignum@4c8f40e
No labels on the same line as an instruction, and all instructions with initial 8 spaces. Also tweak a couple of instances in the testing code where "bignum_copy" was used inside a reference function. s2n-bignum original commit: awslabs/s2n-bignum@6d2bf13
The x86 ABI on Windows differs from the "standard" one used on Linux, Mac OS etc. For our purposes the relevant differences are that RDI and RSI are callee-saved (need to be preserved if modified), and that the input arguments are in different places. Integer return values are still in RAX. Here are the conventions for the first 6 integer arguments (the maximum that s2n-bignum functions rely on so far): Argument number Standard Windows 1 RDI RCX 2 RSI RDX 3 RDX R8 4 RCX R9 5 R8 [RSP+40] 6 R9 [RSP+48] Here we add a wrapper round each s2n-bignum function that optionally (controlled by the WINDOWS_ABI variable in preprocessing) makes the function compatible with the Windows ABI. This is done in a simplistic way simply by pushing the extra callee-saved registers (RSI and RDI), shuffling arguments (only the ones actually used by that function), performing the same computation in exactly the original way, and finally popping back the extra registers. The Makefile currently selects this WINDOWS_ABI mode when `uname -s` gives "CYGWIN_NT-10.0", as on the main test platform, but this can be configured. s2n-bignum original commit: awslabs/s2n-bignum@8ac4010
s2n-bignum original commit: awslabs/s2n-bignum@c6081d4
WIndows ABI code and proofs s2n-bignum original commit: awslabs/s2n-bignum@3908e3d
s2n-bignum original commit: awslabs/s2n-bignum@cb5f2a9
s2n-bignum original commit: awslabs/s2n-bignum@e864876
s2n-bignum original commit: awslabs/s2n-bignum@f96fbcd
s2n-bignum original commit: awslabs/s2n-bignum@3d6a774
s2n-bignum original commit: awslabs/s2n-bignum@7685298
s2n-bignum original commit: awslabs/s2n-bignum@02b7710
s2n-bignum original commit: awslabs/s2n-bignum@0fd68eb
Symbol macros s2n-bignum original commit: awslabs/s2n-bignum@6ce13ca
s2n-bignum original commit: awslabs/s2n-bignum@60e0181
s2n-bignum original commit: awslabs/s2n-bignum@5df0154
s2n-bignum original commit: awslabs/s2n-bignum@e5d0f81
Several files missing .text directive s2n-bignum original commit: awslabs/s2n-bignum@2530c31
s2n-bignum original commit: awslabs/s2n-bignum@6d75592
Improvements to ARM small Karatsuba muls s2n-bignum original commit: awslabs/s2n-bignum@5162347
s2n-bignum original commit: awslabs/s2n-bignum@47fdb11
curve25519 Montgomery ladder step s2n-bignum original commit: awslabs/s2n-bignum@82c3d61
s2n-bignum original commit: awslabs/s2n-bignum@43e602a
A point doubling function, point addition function, and point mixed addition function for the P-384 curve, all using Jacobian coordinates in a Montgomery representation, with input nondegeneracy assumed. Once again, the addition and mixed addition functions offer only marginal efficiency gains over just calling a sequence of basic field operations, but the doubling has some beneficial mathematically equivalent short-cutting of the intermediate modular reductions. s2n-bignum original commit: awslabs/s2n-bignum@df8e913
s2n-bignum original commit: awslabs/s2n-bignum@57a43a3
The same trio of a point doubling function, point addition function and point mixed addition function, this time for the P-521 curve, all using Jacobian coordinates, with input nondegeneracy assumed. s2n-bignum original commit: awslabs/s2n-bignum@047c0b1
s2n-bignum original commit: awslabs/s2n-bignum@de11577
Basic point operations for the Weierstrass curves s2n-bignum original commit: awslabs/s2n-bignum@44003b0
s2n-bignum original commit: awslabs/s2n-bignum@466316a
s2n-bignum original commit: awslabs/s2n-bignum@799802f
s2n-bignum original commit: awslabs/s2n-bignum@58983f7
s2n-bignum original commit: awslabs/s2n-bignum@d185d63
s2n-bignum original commit: awslabs/s2n-bignum@04f64a0
s2n-bignum original commit: awslabs/s2n-bignum@047e403
Adding support for SHA256 and SHA512 intrinsics s2n-bignum original commit: awslabs/s2n-bignum@e6024ae
s2n-bignum original commit: awslabs/s2n-bignum@c7dbd1f
s2n-bignum original commit: awslabs/s2n-bignum@367283c
s2n-bignum original commit: awslabs/s2n-bignum@b2bf71c
s2n-bignum original commit: awslabs/s2n-bignum@74d34c3
This implements the point compression encoding to a byte array from https://datatracker.ietf.org/doc/html/rfc8032#section-5.1.2 as function "edwards25519_encode". It assumes the input is a point (x,y) on the edwards25519 curve, with coordinates reduced mod p_25519 = 2^255 - 19, and does not check any of that. s2n-bignum original commit: awslabs/s2n-bignum@67430be
s2n-bignum original commit: awslabs/s2n-bignum@b49b4f9
This implements point decoding from a 256-bit little-endian byte sequence to a point (x,y) on the edwards25519 curve as specified in https://datatracker.ietf.org/doc/html/rfc8032#section-5.1.3 The function returns 0 for success and 1 for failure, the latter meaning that the input is not the encoding of any edwards25519 point. s2n-bignum original commit: awslabs/s2n-bignum@97f7493
The function bignum_mod_n25519 performs reduction of an input of any size (k digits) modulo the order of the curve25519/edwards25519 basepoint, n_25519 = 2^252 + 27742317777372353535851937790883648493. It generalizes bignum_mod_n25519_4, which is the special case of 4-digit (256-bit) inputs. s2n-bignum original commit: awslabs/s2n-bignum@e23fd30
s2n-bignum original commit: awslabs/s2n-bignum@2c8e273
This replaces the inlined variant of "bignum_modinv" with code from "bignum_inv_p25519" in all "curve25519_" functions returning an affine point and hence using modular inverse. There are also a few consequential changes related to the slightly different amount of temporary storage needed by this function. s2n-bignum original commit: awslabs/s2n-bignum@777d574
s2n-bignum original commit: awslabs/s2n-bignum@8d4c2e4
…ck_no Document that x25519 function does not implement zero-check s2n-bignum original commit: awslabs/s2n-bignum@5c4b15a
s2n-bignum original commit: awslabs/s2n-bignum@73ec55a
This replaces the inlined variant of "bignum_modinv" with code from "bignum_inv_p25519" in all "edwards25519_scalarmul*" functions. Again, there are consequential changes related to the slightly different amount of temporary storage needed by bignum_inv_p25519. s2n-bignum original commit: awslabs/s2n-bignum@7e7b18e
Ed25519 support and related updates s2n-bignum original commit: awslabs/s2n-bignum@db8409d
s2n-bignum original commit: awslabs/s2n-bignum@58a6bdf
Add BFM, BIC, FCSEL, INS, SUB, TRN1, TRN2, USHR, ZIP2 to ARM model s2n-bignum original commit: awslabs/s2n-bignum@f1caaf1
skmcgrail
approved these changes
Nov 15, 2023
justsmth
approved these changes
Nov 15, 2023
nebeid
approved these changes
Nov 15, 2023
justsmth
pushed a commit
to justsmth/aws-lc
that referenced
this pull request
Nov 16, 2023
…te-2023-11-15 Update s2n-bignum subtree 2023-11-15
justsmth
pushed a commit
to justsmth/aws-lc
that referenced
this pull request
Nov 16, 2023
…te-2023-11-15 Update s2n-bignum subtree 2023-11-15
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of changes:
(2023-11-15) Pull in the latest changes from s2n-bignum:
The commands in the internal Quip document was used, with PATHS_TO_KEEP defined as follows:
Call-outs:
Had to resolve a number of conflicts in the merge step in the existing x25519 files... Solely took "theirs".
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.