X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/80e2389990082500d76eb566d4946be3e786c3ef..d8f41ccd20de16f8ebe2ccc84d47bf1cb2b26bbb:/Security/libsecurity_cryptkit/lib/CurveParamDocs/ellproj.h diff --git a/Security/libsecurity_cryptkit/lib/CurveParamDocs/ellproj.h b/Security/libsecurity_cryptkit/lib/CurveParamDocs/ellproj.h new file mode 100644 index 00000000..8f134144 --- /dev/null +++ b/Security/libsecurity_cryptkit/lib/CurveParamDocs/ellproj.h @@ -0,0 +1,59 @@ +/************************************************************** + * + * ellproj.h + * + * Header file for ellproj.c + * + * Updates: + * 3 Apr 98 REC - Creation + * + * c. 1998 Perfectly Scientific, Inc. + * All Rights Reserved. + * + * + *************************************************************/ + +/* definitions */ + +typedef struct /* This is how to define a projective point. */ +{ + giant x; + giant y; + giant z; +} point_struct_proj; + +typedef point_struct_proj *point_proj; + +point_proj /* Allocates a new projective point. */ +new_point_proj(int shorts); + +void /* Frees point. */ +free_point_proj(point_proj pt); + +void /* Copies point to point. */ +ptop_proj(point_proj pt1, point_proj pt2); + +void /* Initialization. */ +init_ell_proj(int shorts); + +void /* Point doubling. */ +ell_double_proj(point_proj pt, giant a, giant p); + +void /* Point addition. */ +ell_add_proj(point_proj pt0, point_proj pt1, giant a, giant p); + +void /* Point negation. */ +ell_neg_proj(point_proj pt, giant p); + +void /* Point subtraction. */ +ell_sub_proj(point_proj pt0, point_proj pt1, giant a, giant p); + +void /* General elliptic mul. */ +ell_mul_proj(point_proj pt0, point_proj pt1, giant k, giant a, giant p); + +void /* Generate normalized point (X, Y, 1) from given (x,y,z). */ +normalize_proj(point_proj pt, giant p); + +void /* Find a point (x, y, 1) on the curve. */ +find_point_proj(point_proj pt, giant seed, giant a, giant b, giant p); +