Classes | Functions | Variables
dsa_test.cc File Reference
#include <openssl/dsa.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <gtest/gtest.h>
#include <openssl/bn.h>
#include <openssl/crypto.h>
#include <openssl/err.h>
#include "../internal.h"
Include dependency graph for dsa_test.cc:

Go to the source code of this file.

Classes

struct  GenerateContext
 

Functions

static int GenerateCallback (int p, int n, BN_GENCB *arg)
 
static bssl::UniquePtr< DSAGetFIPSDSA (void)
 
 TEST (DSATest, AllTests)
 
 TEST (DSATest, InvalidGroup)
 
static int TestGenerate (FILE *out)
 
static bool TestVerify (const uint8_t *sig, size_t sig_len, int expect)
 

Variables

static const uint8_t fips_digest []
 
static const uint8_t fips_g []
 
static const uint8_t fips_p []
 
static const uint8_t fips_q []
 
static const uint8_t fips_sig []
 
static const uint8_t fips_sig_bad_length []
 
static const uint8_t fips_sig_bad_r []
 
static const uint8_t fips_sig_extra []
 
static const uint8_t fips_sig_negative []
 
static const uint8_t fips_x []
 
static const uint8_t fips_y []
 
static const uint8_t seed [20]
 

Function Documentation

◆ GenerateCallback()

static int GenerateCallback ( int  p,
int  n,
BN_GENCB arg 
)
static

Definition at line 194 of file dsa_test.cc.

◆ GetFIPSDSA()

static bssl::UniquePtr<DSA> GetFIPSDSA ( void  )
static

Definition at line 171 of file dsa_test.cc.

◆ TEST() [1/2]

TEST ( DSATest  ,
AllTests   
)

Definition at line 310 of file dsa_test.cc.

◆ TEST() [2/2]

TEST ( DSATest  ,
InvalidGroup   
)

Definition at line 321 of file dsa_test.cc.

◆ TestGenerate()

static int TestGenerate ( FILE *  out)
static

Definition at line 221 of file dsa_test.cc.

◆ TestVerify()

static bool TestVerify ( const uint8_t sig,
size_t  sig_len,
int  expect 
)
static

Definition at line 291 of file dsa_test.cc.

Variable Documentation

◆ fips_digest

const uint8_t fips_digest[]
static
Initial value:
= {
0xa9, 0x99, 0x3e, 0x36, 0x47, 0x06, 0x81, 0x6a, 0xba, 0x3e, 0x25,
0x71, 0x78, 0x50, 0xc2, 0x6c, 0x9c, 0xd0, 0xd8, 0x9d,
}

Definition at line 121 of file dsa_test.cc.

◆ fips_g

const uint8_t fips_g[]
static
Initial value:
= {
0x62, 0x6d, 0x02, 0x78, 0x39, 0xea, 0x0a, 0x13, 0x41, 0x31, 0x63,
0xa5, 0x5b, 0x4c, 0xb5, 0x00, 0x29, 0x9d, 0x55, 0x22, 0x95, 0x6c,
0xef, 0xcb, 0x3b, 0xff, 0x10, 0xf3, 0x99, 0xce, 0x2c, 0x2e, 0x71,
0xcb, 0x9d, 0xe5, 0xfa, 0x24, 0xba, 0xbf, 0x58, 0xe5, 0xb7, 0x95,
0x21, 0x92, 0x5c, 0x9c, 0xc4, 0x2e, 0x9f, 0x6f, 0x46, 0x4b, 0x08,
0x8c, 0xc5, 0x72, 0xaf, 0x53, 0xe6, 0xd7, 0x88, 0x02,
}

Definition at line 98 of file dsa_test.cc.

◆ fips_p

const uint8_t fips_p[]
static
Initial value:
= {
0x8d, 0xf2, 0xa4, 0x94, 0x49, 0x22, 0x76, 0xaa, 0x3d, 0x25, 0x75,
0x9b, 0xb0, 0x68, 0x69, 0xcb, 0xea, 0xc0, 0xd8, 0x3a, 0xfb, 0x8d,
0x0c, 0xf7, 0xcb, 0xb8, 0x32, 0x4f, 0x0d, 0x78, 0x82, 0xe5, 0xd0,
0x76, 0x2f, 0xc5, 0xb7, 0x21, 0x0e, 0xaf, 0xc2, 0xe9, 0xad, 0xac,
0x32, 0xab, 0x7a, 0xac, 0x49, 0x69, 0x3d, 0xfb, 0xf8, 0x37, 0x24,
0xc2, 0xec, 0x07, 0x36, 0xee, 0x31, 0xc8, 0x02, 0x91,
}

Definition at line 84 of file dsa_test.cc.

◆ fips_q

const uint8_t fips_q[]
static
Initial value:
= {
0xc7, 0x73, 0x21, 0x8c, 0x73, 0x7e, 0xc8, 0xee, 0x99, 0x3b, 0x4f,
0x2d, 0xed, 0x30, 0xf4, 0x8e, 0xda, 0xce, 0x91, 0x5f,
}

Definition at line 93 of file dsa_test.cc.

◆ fips_sig

const uint8_t fips_sig[]
static
Initial value:
= {
0x30, 0x2d, 0x02, 0x15, 0x00, 0x8b, 0xac, 0x1a, 0xb6, 0x64, 0x10,
0x43, 0x5c, 0xb7, 0x18, 0x1f, 0x95, 0xb1, 0x6a, 0xb9, 0x7c, 0x92,
0xb3, 0x41, 0xc0, 0x02, 0x14, 0x41, 0xe2, 0x34, 0x5f, 0x1f, 0x56,
0xdf, 0x24, 0x58, 0xf4, 0x26, 0xd1, 0x55, 0xb4, 0xba, 0x2d, 0xb6,
0xdc, 0xd8, 0xc8,
}

Definition at line 127 of file dsa_test.cc.

◆ fips_sig_bad_length

const uint8_t fips_sig_bad_length[]
static
Initial value:
= {
0x30, 0x81, 0x2d, 0x02, 0x15, 0x00, 0x8b, 0xac, 0x1a, 0xb6, 0x64,
0x10, 0x43, 0x5c, 0xb7, 0x18, 0x1f, 0x95, 0xb1, 0x6a, 0xb9, 0x7c,
0x92, 0xb3, 0x41, 0xc0, 0x02, 0x14, 0x41, 0xe2, 0x34, 0x5f, 0x1f,
0x56, 0xdf, 0x24, 0x58, 0xf4, 0x26, 0xd1, 0x55, 0xb4, 0xba, 0x2d,
0xb6, 0xdc, 0xd8, 0xc8, 0x00,
}

Definition at line 154 of file dsa_test.cc.

◆ fips_sig_bad_r

const uint8_t fips_sig_bad_r[]
static
Initial value:
= {
0x30, 0x2d, 0x02, 0x15, 0x00, 0x8c, 0xac, 0x1a, 0xb6, 0x64, 0x10,
0x43, 0x5c, 0xb7, 0x18, 0x1f, 0x95, 0xb1, 0x6a, 0xb9, 0x7c, 0x92,
0xb3, 0x41, 0xc0, 0x02, 0x14, 0x41, 0xe2, 0x34, 0x5f, 0x1f, 0x56,
0xdf, 0x24, 0x58, 0xf4, 0x26, 0xd1, 0x55, 0xb4, 0xba, 0x2d, 0xb6,
0xdc, 0xd8, 0xc8,
}

Definition at line 163 of file dsa_test.cc.

◆ fips_sig_extra

const uint8_t fips_sig_extra[]
static
Initial value:
= {
0x30, 0x2d, 0x02, 0x15, 0x00, 0x8b, 0xac, 0x1a, 0xb6, 0x64, 0x10,
0x43, 0x5c, 0xb7, 0x18, 0x1f, 0x95, 0xb1, 0x6a, 0xb9, 0x7c, 0x92,
0xb3, 0x41, 0xc0, 0x02, 0x14, 0x41, 0xe2, 0x34, 0x5f, 0x1f, 0x56,
0xdf, 0x24, 0x58, 0xf4, 0x26, 0xd1, 0x55, 0xb4, 0xba, 0x2d, 0xb6,
0xdc, 0xd8, 0xc8, 0x00,
}

Definition at line 145 of file dsa_test.cc.

◆ fips_sig_negative

const uint8_t fips_sig_negative[]
static
Initial value:
= {
0x30, 0x2c, 0x02, 0x14, 0x8b, 0xac, 0x1a, 0xb6, 0x64, 0x10, 0x43,
0x5c, 0xb7, 0x18, 0x1f, 0x95, 0xb1, 0x6a, 0xb9, 0x7c, 0x92, 0xb3,
0x41, 0xc0, 0x02, 0x14, 0x41, 0xe2, 0x34, 0x5f, 0x1f, 0x56, 0xdf,
0x24, 0x58, 0xf4, 0x26, 0xd1, 0x55, 0xb4, 0xba, 0x2d, 0xb6, 0xdc,
0xd8, 0xc8,
}

Definition at line 136 of file dsa_test.cc.

◆ fips_x

const uint8_t fips_x[]
static
Initial value:
= {
0x20, 0x70, 0xb3, 0x22, 0x3d, 0xba, 0x37, 0x2f, 0xde, 0x1c, 0x0f,
0xfc, 0x7b, 0x2e, 0x3b, 0x49, 0x8b, 0x26, 0x06, 0x14,
}

Definition at line 107 of file dsa_test.cc.

◆ fips_y

const uint8_t fips_y[]
static
Initial value:
= {
0x19, 0x13, 0x18, 0x71, 0xd7, 0x5b, 0x16, 0x12, 0xa8, 0x19, 0xf2,
0x9d, 0x78, 0xd1, 0xb0, 0xd7, 0x34, 0x6f, 0x7a, 0xa7, 0x7b, 0xb6,
0x2a, 0x85, 0x9b, 0xfd, 0x6c, 0x56, 0x75, 0xda, 0x9d, 0x21, 0x2d,
0x3a, 0x36, 0xef, 0x16, 0x72, 0xef, 0x66, 0x0b, 0x8c, 0x7c, 0x25,
0x5c, 0xc0, 0xec, 0x74, 0x85, 0x8f, 0xba, 0x33, 0xf4, 0x4c, 0x06,
0x69, 0x96, 0x30, 0xa7, 0x6b, 0x03, 0x0e, 0xe3, 0x33,
}

Definition at line 112 of file dsa_test.cc.

◆ seed

const uint8_t seed[20]
static
Initial value:
= {
0xd5, 0x01, 0x4e, 0x4b, 0x60, 0xef, 0x2b, 0xa8, 0xb6, 0x21, 0x1b,
0x40, 0x62, 0xba, 0x32, 0x24, 0xe0, 0x42, 0x7d, 0xd3,
}

Definition at line 79 of file dsa_test.cc.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:11