TianoCore EDK2 master
Loading...
Searching...
No Matches
CryptEc.c
Go to the documentation of this file.
1
9#include "InternalCryptLib.h"
10#include <openssl/objects.h>
11#include <openssl/bn.h>
12#include <openssl/ec.h>
13
14// =====================================================================================
15// Basic Elliptic Curve Primitives
16// =====================================================================================
17
28INT32
30 IN UINTN CryptoNid
31 )
32{
33 INT32 Nid;
34
35 switch (CryptoNid) {
36 case CRYPTO_NID_SECP256R1:
37 Nid = NID_X9_62_prime256v1;
38 break;
39 case CRYPTO_NID_SECP384R1:
40 Nid = NID_secp384r1;
41 break;
42 case CRYPTO_NID_SECP521R1:
43 Nid = NID_secp521r1;
44 break;
45 case CRYPTO_NID_BRAINPOOLP512R1:
46 Nid = NID_brainpoolP512r1;
47 break;
48 default:
49 return -1;
50 }
51
52 return Nid;
53}
54
66VOID *
67EFIAPI
69 IN UINTN CryptoNid
70 )
71{
72 INT32 Nid;
73
74 Nid = CryptoNidToOpensslNid (CryptoNid);
75
76 if (Nid < 0) {
77 return NULL;
78 }
79
80 return EC_GROUP_new_by_curve_name (Nid);
81}
82
98BOOLEAN
99EFIAPI
101 IN CONST VOID *EcGroup,
102 OUT VOID *BnPrime,
103 OUT VOID *BnA,
104 OUT VOID *BnB,
105 IN VOID *BnCtx
106 )
107{
108 return (BOOLEAN)EC_GROUP_get_curve (EcGroup, BnPrime, BnA, BnB, BnCtx);
109}
110
123BOOLEAN
124EFIAPI
126 IN VOID *EcGroup,
127 OUT VOID *BnOrder
128 )
129{
130 return (BOOLEAN)EC_GROUP_get_order (EcGroup, BnOrder, NULL);
131}
132
138VOID
139EFIAPI
141 IN VOID *EcGroup
142 )
143{
144 EC_GROUP_free (EcGroup);
145}
146
156VOID *
157EFIAPI
159 IN CONST VOID *EcGroup
160 )
161{
162 return EC_POINT_new (EcGroup);
163}
164
171VOID
172EFIAPI
174 IN VOID *EcPoint,
175 IN BOOLEAN Clear
176 )
177{
178 if (Clear) {
179 EC_POINT_clear_free (EcPoint);
180 } else {
181 EC_POINT_free (EcPoint);
182 }
183}
184
200BOOLEAN
201EFIAPI
203 IN CONST VOID *EcGroup,
204 IN CONST VOID *EcPoint,
205 OUT VOID *BnX,
206 OUT VOID *BnY,
207 IN VOID *BnCtx
208 )
209{
210 return (BOOLEAN)EC_POINT_get_affine_coordinates (EcGroup, EcPoint, BnX, BnY, BnCtx);
211}
212
225BOOLEAN
226EFIAPI
228 IN CONST VOID *EcGroup,
229 IN VOID *EcPoint,
230 IN CONST VOID *BnX,
231 IN CONST VOID *BnY,
232 IN VOID *BnCtx
233 )
234{
235 return (BOOLEAN)EC_POINT_set_affine_coordinates (EcGroup, EcPoint, BnX, BnY, BnCtx);
236}
237
251BOOLEAN
252EFIAPI
254 IN CONST VOID *EcGroup,
255 OUT VOID *EcPointResult,
256 IN CONST VOID *EcPointA,
257 IN CONST VOID *EcPointB,
258 IN VOID *BnCtx
259 )
260{
261 return (BOOLEAN)EC_POINT_add (EcGroup, EcPointResult, EcPointA, EcPointB, BnCtx);
262}
263
277BOOLEAN
278EFIAPI
280 IN CONST VOID *EcGroup,
281 OUT VOID *EcPointResult,
282 IN CONST VOID *EcPoint,
283 IN CONST VOID *BnPScalar,
284 IN VOID *BnCtx
285 )
286{
287 return (BOOLEAN)EC_POINT_mul (EcGroup, EcPointResult, NULL, EcPoint, BnPScalar, BnCtx);
288}
289
300BOOLEAN
301EFIAPI
303 IN CONST VOID *EcGroup,
304 IN OUT VOID *EcPoint,
305 IN VOID *BnCtx
306 )
307{
308 return (BOOLEAN)EC_POINT_invert (EcGroup, EcPoint, BnCtx);
309}
310
321BOOLEAN
322EFIAPI
324 IN CONST VOID *EcGroup,
325 IN CONST VOID *EcPoint,
326 IN VOID *BnCtx
327 )
328{
329 return EC_POINT_is_on_curve (EcGroup, EcPoint, BnCtx) == 1;
330}
331
341BOOLEAN
342EFIAPI
344 IN CONST VOID *EcGroup,
345 IN CONST VOID *EcPoint
346 )
347{
348 return EC_POINT_is_at_infinity (EcGroup, EcPoint) == 1;
349}
350
362BOOLEAN
363EFIAPI
365 IN CONST VOID *EcGroup,
366 IN CONST VOID *EcPointA,
367 IN CONST VOID *EcPointB,
368 IN VOID *BnCtx
369 )
370{
371 return EC_POINT_cmp (EcGroup, EcPointA, EcPointB, BnCtx) == 0;
372}
373
391BOOLEAN
392EFIAPI
394 IN CONST VOID *EcGroup,
395 IN VOID *EcPoint,
396 IN CONST VOID *BnX,
397 IN UINT8 YBit,
398 IN VOID *BnCtx
399 )
400{
401 return (BOOLEAN)EC_POINT_set_compressed_coordinates (EcGroup, EcPoint, BnX, YBit, BnCtx);
402}
403
404// =====================================================================================
405// Elliptic Curve Diffie Hellman Primitives
406// =====================================================================================
407
417VOID *
418EFIAPI
420 IN UINTN Nid
421 )
422{
423 INT32 OpenSslNid;
424
425 OpenSslNid = CryptoNidToOpensslNid (Nid);
426 if (OpenSslNid < 0) {
427 return NULL;
428 }
429
430 return (VOID *)EC_KEY_new_by_curve_name (OpenSslNid);
431}
432
438VOID
439EFIAPI
441 IN VOID *EcContext
442 )
443{
444 EC_KEY_free ((EC_KEY *)EcContext);
445}
446
473BOOLEAN
474EFIAPI
476 IN OUT VOID *EcContext,
477 OUT UINT8 *PublicKey,
478 IN OUT UINTN *PublicKeySize
479 )
480{
481 EC_KEY *EcKey;
482 CONST EC_GROUP *Group;
483 CONST EC_POINT *EcPoint;
484 BOOLEAN RetVal;
485 BIGNUM *BnX;
486 BIGNUM *BnY;
487 UINTN HalfSize;
488 INTN XSize;
489 INTN YSize;
490
491 if ((EcContext == NULL) || (PublicKeySize == NULL)) {
492 return FALSE;
493 }
494
495 if ((PublicKey == NULL) && (*PublicKeySize != 0)) {
496 return FALSE;
497 }
498
499 EcKey = (EC_KEY *)EcContext;
500 Group = EC_KEY_get0_group (EcKey);
501 HalfSize = (EC_GROUP_get_degree (Group) + 7) / 8;
502
503 // Assume RAND_seed was called
504 if (EC_KEY_generate_key (EcKey) != 1) {
505 return FALSE;
506 }
507
508 if (*PublicKeySize < HalfSize * 2) {
509 *PublicKeySize = HalfSize * 2;
510 return FALSE;
511 }
512
513 *PublicKeySize = HalfSize * 2;
514
515 EcPoint = EC_KEY_get0_public_key (EcKey);
516 if (EcPoint == NULL) {
517 return FALSE;
518 }
519
520 RetVal = FALSE;
521 BnX = BN_new ();
522 BnY = BN_new ();
523 if ((BnX == NULL) || (BnY == NULL)) {
524 goto fail;
525 }
526
527 if (EC_POINT_get_affine_coordinates (Group, EcPoint, BnX, BnY, NULL) != 1) {
528 goto fail;
529 }
530
531 XSize = BN_num_bytes (BnX);
532 YSize = BN_num_bytes (BnY);
533 if ((XSize <= 0) || (YSize <= 0)) {
534 goto fail;
535 }
536
537 ASSERT ((UINTN)XSize <= HalfSize && (UINTN)YSize <= HalfSize);
538
539 ZeroMem (PublicKey, *PublicKeySize);
540 BN_bn2bin (BnX, &PublicKey[0 + HalfSize - XSize]);
541 BN_bn2bin (BnY, &PublicKey[HalfSize + HalfSize - YSize]);
542
543 RetVal = TRUE;
544
545fail:
546 BN_free (BnX);
547 BN_free (BnY);
548 return RetVal;
549}
550
565BOOLEAN
566EFIAPI
568 IN OUT VOID *EcContext,
569 OUT UINT8 *PublicKey,
570 IN OUT UINTN *PublicKeySize
571 )
572{
573 EC_KEY *EcKey;
574 CONST EC_GROUP *Group;
575 CONST EC_POINT *EcPoint;
576 BIGNUM *BnX;
577 BIGNUM *BnY;
578 UINTN HalfSize;
579 INTN XSize;
580 INTN YSize;
581 BOOLEAN RetVal;
582
583 if ((EcContext == NULL) || (PublicKeySize == NULL)) {
584 return FALSE;
585 }
586
587 if ((PublicKey == NULL) && (*PublicKeySize != 0)) {
588 return FALSE;
589 }
590
591 EcKey = (EC_KEY *)EcContext;
592 Group = EC_KEY_get0_group (EcKey);
593 HalfSize = (EC_GROUP_get_degree (Group) + 7) / 8;
594 if (*PublicKeySize < HalfSize * 2) {
595 *PublicKeySize = HalfSize * 2;
596 return FALSE;
597 }
598
599 *PublicKeySize = HalfSize * 2;
600
601 EcPoint = EC_KEY_get0_public_key (EcKey);
602 if (EcPoint == NULL) {
603 return FALSE;
604 }
605
606 RetVal = FALSE;
607 BnX = BN_new ();
608 BnY = BN_new ();
609 if ((BnX == NULL) || (BnY == NULL)) {
610 goto fail;
611 }
612
613 if (EC_POINT_get_affine_coordinates (Group, EcPoint, BnX, BnY, NULL) != 1) {
614 goto fail;
615 }
616
617 XSize = BN_num_bytes (BnX);
618 YSize = BN_num_bytes (BnY);
619 if ((XSize <= 0) || (YSize <= 0)) {
620 goto fail;
621 }
622
623 ASSERT ((UINTN)XSize <= HalfSize && (UINTN)YSize <= HalfSize);
624
625 if (PublicKey != NULL) {
626 ZeroMem (PublicKey, *PublicKeySize);
627 BN_bn2bin (BnX, &PublicKey[0 + HalfSize - XSize]);
628 BN_bn2bin (BnY, &PublicKey[HalfSize + HalfSize - YSize]);
629 }
630
631 RetVal = TRUE;
632
633fail:
634 BN_free (BnX);
635 BN_free (BnY);
636 return RetVal;
637}
638
665BOOLEAN
666EFIAPI
668 IN OUT VOID *EcContext,
669 IN CONST UINT8 *PeerPublic,
670 IN UINTN PeerPublicSize,
671 IN CONST INT32 *CompressFlag,
672 OUT UINT8 *Key,
673 IN OUT UINTN *KeySize
674 )
675{
676 EC_KEY *EcKey;
677 EC_KEY *PeerEcKey;
678 CONST EC_GROUP *Group;
679 BOOLEAN RetVal;
680 BIGNUM *BnX;
681 BIGNUM *BnY;
682 EC_POINT *Point;
683 INT32 OpenSslNid;
684 UINTN HalfSize;
685
686 if ((EcContext == NULL) || (PeerPublic == NULL) || (KeySize == NULL)) {
687 return FALSE;
688 }
689
690 if ((Key == NULL) && (*KeySize != 0)) {
691 return FALSE;
692 }
693
694 if (PeerPublicSize > INT_MAX) {
695 return FALSE;
696 }
697
698 EcKey = (EC_KEY *)EcContext;
699 Group = EC_KEY_get0_group (EcKey);
700 HalfSize = (EC_GROUP_get_degree (Group) + 7) / 8;
701 if ((CompressFlag == NULL) && (PeerPublicSize != HalfSize * 2)) {
702 return FALSE;
703 }
704
705 if ((CompressFlag != NULL) && (PeerPublicSize != HalfSize)) {
706 return FALSE;
707 }
708
709 if (*KeySize < HalfSize) {
710 *KeySize = HalfSize;
711 return FALSE;
712 }
713
714 *KeySize = HalfSize;
715
716 RetVal = FALSE;
717 Point = NULL;
718 BnX = BN_bin2bn (PeerPublic, (INT32)HalfSize, NULL);
719 BnY = NULL;
720 Point = EC_POINT_new (Group);
721 PeerEcKey = NULL;
722 if ((BnX == NULL) || (Point == NULL)) {
723 goto fail;
724 }
725
726 if (CompressFlag == NULL) {
727 BnY = BN_bin2bn (PeerPublic + HalfSize, (INT32)HalfSize, NULL);
728 if (BnY == NULL) {
729 goto fail;
730 }
731
732 if (EC_POINT_set_affine_coordinates (Group, Point, BnX, BnY, NULL) != 1) {
733 goto fail;
734 }
735 } else {
736 if (EC_POINT_set_compressed_coordinates (Group, Point, BnX, *CompressFlag, NULL) != 1) {
737 goto fail;
738 }
739 }
740
741 // Validate NIST ECDH public key
742 OpenSslNid = EC_GROUP_get_curve_name (Group);
743 PeerEcKey = EC_KEY_new_by_curve_name (OpenSslNid);
744 if (PeerEcKey == NULL) {
745 goto fail;
746 }
747
748 if (EC_KEY_set_public_key (PeerEcKey, Point) != 1) {
749 goto fail;
750 }
751
752 if (EC_KEY_check_key (PeerEcKey) != 1) {
753 goto fail;
754 }
755
756 if (ECDH_compute_key (Key, *KeySize, Point, EcKey, NULL) <= 0) {
757 goto fail;
758 }
759
760 RetVal = TRUE;
761
762fail:
763 BN_free (BnX);
764 BN_free (BnY);
765 EC_POINT_free (Point);
766 EC_KEY_free (PeerEcKey);
767 return RetVal;
768}
769
799BOOLEAN
800EFIAPI
802 IN VOID *EcContext,
803 IN UINTN HashNid,
804 IN CONST UINT8 *MessageHash,
805 IN UINTN HashSize,
806 OUT UINT8 *Signature,
807 IN OUT UINTN *SigSize
808 )
809{
810 EC_KEY *EcKey;
811 ECDSA_SIG *EcDsaSig;
812 INT32 OpenSslNid;
813 UINT8 HalfSize;
814 BIGNUM *R;
815 BIGNUM *S;
816 INTN RSize;
817 INTN SSize;
818
819 if ((EcContext == NULL) || (MessageHash == NULL)) {
820 return FALSE;
821 }
822
823 if (Signature == NULL) {
824 return FALSE;
825 }
826
827 EcKey = (EC_KEY *)EcContext;
828 OpenSslNid = EC_GROUP_get_curve_name (EC_KEY_get0_group (EcKey));
829 switch (OpenSslNid) {
830 case NID_X9_62_prime256v1:
831 HalfSize = 32;
832 break;
833 case NID_secp384r1:
834 HalfSize = 48;
835 break;
836 case NID_secp521r1:
837 HalfSize = 66;
838 break;
839 case NID_brainpoolP512r1:
840 HalfSize = 64;
841 break;
842 default:
843 return FALSE;
844 }
845
846 if (*SigSize < (UINTN)(HalfSize * 2)) {
847 *SigSize = HalfSize * 2;
848 return FALSE;
849 }
850
851 *SigSize = HalfSize * 2;
852 ZeroMem (Signature, *SigSize);
853
854 switch (HashNid) {
855 case CRYPTO_NID_SHA256:
856 if (HashSize != SHA256_DIGEST_SIZE) {
857 return FALSE;
858 }
859
860 break;
861
862 case CRYPTO_NID_SHA384:
863 if (HashSize != SHA384_DIGEST_SIZE) {
864 return FALSE;
865 }
866
867 break;
868
869 case CRYPTO_NID_SHA512:
870 if (HashSize != SHA512_DIGEST_SIZE) {
871 return FALSE;
872 }
873
874 break;
875
876 default:
877 return FALSE;
878 }
879
880 EcDsaSig = ECDSA_do_sign (
881 MessageHash,
882 (UINT32)HashSize,
883 (EC_KEY *)EcContext
884 );
885 if (EcDsaSig == NULL) {
886 return FALSE;
887 }
888
889 ECDSA_SIG_get0 (EcDsaSig, (CONST BIGNUM **)&R, (CONST BIGNUM **)&S);
890
891 RSize = BN_num_bytes (R);
892 SSize = BN_num_bytes (S);
893 if ((RSize <= 0) || (SSize <= 0)) {
894 ECDSA_SIG_free (EcDsaSig);
895 return FALSE;
896 }
897
898 ASSERT ((UINTN)RSize <= HalfSize && (UINTN)SSize <= HalfSize);
899
900 BN_bn2bin (R, &Signature[0 + HalfSize - RSize]);
901 BN_bn2bin (S, &Signature[HalfSize + HalfSize - SSize]);
902
903 ECDSA_SIG_free (EcDsaSig);
904
905 return TRUE;
906}
907
931BOOLEAN
932EFIAPI
934 IN VOID *EcContext,
935 IN UINTN HashNid,
936 IN CONST UINT8 *MessageHash,
937 IN UINTN HashSize,
938 IN CONST UINT8 *Signature,
939 IN UINTN SigSize
940 )
941{
942 INT32 Result;
943 EC_KEY *EcKey;
944 ECDSA_SIG *EcDsaSig;
945 INT32 OpenSslNid;
946 UINT8 HalfSize;
947 BIGNUM *R;
948 BIGNUM *S;
949
950 if ((EcContext == NULL) || (MessageHash == NULL) || (Signature == NULL)) {
951 return FALSE;
952 }
953
954 if ((SigSize > INT_MAX) || (SigSize == 0)) {
955 return FALSE;
956 }
957
958 EcKey = (EC_KEY *)EcContext;
959 OpenSslNid = EC_GROUP_get_curve_name (EC_KEY_get0_group (EcKey));
960 switch (OpenSslNid) {
961 case NID_X9_62_prime256v1:
962 HalfSize = 32;
963 break;
964 case NID_secp384r1:
965 HalfSize = 48;
966 break;
967 case NID_secp521r1:
968 HalfSize = 66;
969 break;
970 case NID_brainpoolP512r1:
971 HalfSize = 64;
972 break;
973 default:
974 return FALSE;
975 }
976
977 if (SigSize != (UINTN)(HalfSize * 2)) {
978 return FALSE;
979 }
980
981 switch (HashNid) {
982 case CRYPTO_NID_SHA256:
983 if (HashSize != SHA256_DIGEST_SIZE) {
984 return FALSE;
985 }
986
987 break;
988
989 case CRYPTO_NID_SHA384:
990 if (HashSize != SHA384_DIGEST_SIZE) {
991 return FALSE;
992 }
993
994 break;
995
996 case CRYPTO_NID_SHA512:
997 if (HashSize != SHA512_DIGEST_SIZE) {
998 return FALSE;
999 }
1000
1001 break;
1002
1003 default:
1004 return FALSE;
1005 }
1006
1007 EcDsaSig = ECDSA_SIG_new ();
1008 if (EcDsaSig == NULL) {
1009 ECDSA_SIG_free (EcDsaSig);
1010 return FALSE;
1011 }
1012
1013 R = BN_bin2bn (Signature, (UINT32)HalfSize, NULL);
1014 S = BN_bin2bn (Signature + HalfSize, (UINT32)HalfSize, NULL);
1015 if ((R == NULL) || (S == NULL)) {
1016 ECDSA_SIG_free (EcDsaSig);
1017 return FALSE;
1018 }
1019
1020 ECDSA_SIG_set0 (EcDsaSig, R, S);
1021
1022 Result = ECDSA_do_verify (
1023 MessageHash,
1024 (UINT32)HashSize,
1025 EcDsaSig,
1026 (EC_KEY *)EcContext
1027 );
1028
1029 ECDSA_SIG_free (EcDsaSig);
1030
1031 return (Result == 1);
1032}
UINT64 UINTN
INT64 INTN
#define SHA512_DIGEST_SIZE
Definition: BaseCryptLib.h:54
#define SHA256_DIGEST_SIZE
Definition: BaseCryptLib.h:44
#define SHA384_DIGEST_SIZE
Definition: BaseCryptLib.h:49
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
BOOLEAN EFIAPI EcPointInvert(IN CONST VOID *EcGroup, IN OUT VOID *EcPoint, IN VOID *BnCtx)
Definition: CryptEc.c:302
BOOLEAN EFIAPI EcPointSetCompressedCoordinates(IN CONST VOID *EcGroup, IN VOID *EcPoint, IN CONST VOID *BnX, IN UINT8 YBit, IN VOID *BnCtx)
Definition: CryptEc.c:393
BOOLEAN EFIAPI EcPointMul(IN CONST VOID *EcGroup, OUT VOID *EcPointResult, IN CONST VOID *EcPoint, IN CONST VOID *BnPScalar, IN VOID *BnCtx)
Definition: CryptEc.c:279
BOOLEAN EFIAPI EcPointAdd(IN CONST VOID *EcGroup, OUT VOID *EcPointResult, IN CONST VOID *EcPointA, IN CONST VOID *EcPointB, IN VOID *BnCtx)
Definition: CryptEc.c:253
BOOLEAN EFIAPI EcGenerateKey(IN OUT VOID *EcContext, OUT UINT8 *PublicKey, IN OUT UINTN *PublicKeySize)
Definition: CryptEc.c:475
BOOLEAN EFIAPI EcPointIsOnCurve(IN CONST VOID *EcGroup, IN CONST VOID *EcPoint, IN VOID *BnCtx)
Definition: CryptEc.c:323
BOOLEAN EFIAPI EcPointIsAtInfinity(IN CONST VOID *EcGroup, IN CONST VOID *EcPoint)
Definition: CryptEc.c:343
BOOLEAN EFIAPI EcGetPubKey(IN OUT VOID *EcContext, OUT UINT8 *PublicKey, IN OUT UINTN *PublicKeySize)
Definition: CryptEc.c:567
BOOLEAN EFIAPI EcDsaSign(IN VOID *EcContext, IN UINTN HashNid, IN CONST UINT8 *MessageHash, IN UINTN HashSize, OUT UINT8 *Signature, IN OUT UINTN *SigSize)
Definition: CryptEc.c:801
VOID *EFIAPI EcNewByNid(IN UINTN Nid)
Definition: CryptEc.c:419
VOID *EFIAPI EcPointInit(IN CONST VOID *EcGroup)
Definition: CryptEc.c:158
VOID *EFIAPI EcGroupInit(IN UINTN CryptoNid)
Definition: CryptEc.c:68
BOOLEAN EFIAPI EcPointEqual(IN CONST VOID *EcGroup, IN CONST VOID *EcPointA, IN CONST VOID *EcPointB, IN VOID *BnCtx)
Definition: CryptEc.c:364
BOOLEAN EFIAPI EcGroupGetCurve(IN CONST VOID *EcGroup, OUT VOID *BnPrime, OUT VOID *BnA, OUT VOID *BnB, IN VOID *BnCtx)
Definition: CryptEc.c:100
VOID EFIAPI EcPointDeInit(IN VOID *EcPoint, IN BOOLEAN Clear)
Definition: CryptEc.c:173
BOOLEAN EFIAPI EcDsaVerify(IN VOID *EcContext, IN UINTN HashNid, IN CONST UINT8 *MessageHash, IN UINTN HashSize, IN CONST UINT8 *Signature, IN UINTN SigSize)
Definition: CryptEc.c:933
STATIC INT32 CryptoNidToOpensslNid(IN UINTN CryptoNid)
Definition: CryptEc.c:29
BOOLEAN EFIAPI EcGroupGetOrder(IN VOID *EcGroup, OUT VOID *BnOrder)
Definition: CryptEc.c:125
BOOLEAN EFIAPI EcDhComputeKey(IN OUT VOID *EcContext, IN CONST UINT8 *PeerPublic, IN UINTN PeerPublicSize, IN CONST INT32 *CompressFlag, OUT UINT8 *Key, IN OUT UINTN *KeySize)
Definition: CryptEc.c:667
VOID EFIAPI EcGroupFree(IN VOID *EcGroup)
Definition: CryptEc.c:140
BOOLEAN EFIAPI EcPointGetAffineCoordinates(IN CONST VOID *EcGroup, IN CONST VOID *EcPoint, OUT VOID *BnX, OUT VOID *BnY, IN VOID *BnCtx)
Definition: CryptEc.c:202
BOOLEAN EFIAPI EcPointSetAffineCoordinates(IN CONST VOID *EcGroup, IN VOID *EcPoint, IN CONST VOID *BnX, IN CONST VOID *BnY, IN VOID *BnCtx)
Definition: CryptEc.c:227
VOID EFIAPI EcFree(IN VOID *EcContext)
Definition: CryptEc.c:440
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define STATIC
Definition: Base.h:264
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284