summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2024-03-24 06:05:41 +0000
committertb <>2024-03-24 06:05:41 +0000
commita5f3a65ab19c952e8148c2763aa6a6fd84940f19 (patch)
tree74a29713e7a7166b81de9090085f263648b9e5ca /src
parent4d70e5f8abdf3f7acde060b3af5d77e933c52c82 (diff)
downloadopenbsd-a5f3a65ab19c952e8148c2763aa6a6fd84940f19.tar.gz
openbsd-a5f3a65ab19c952e8148c2763aa6a6fd84940f19.tar.bz2
openbsd-a5f3a65ab19c952e8148c2763aa6a6fd84940f19.zip
Bye bye gost, bye, bye turdiness
ok beck
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/ec/ec_curve.c669
-rw-r--r--src/lib/libcrypto/err/err_all.c5
-rw-r--r--src/lib/libcrypto/evp/evp_local.h5
-rw-r--r--src/lib/libcrypto/evp/evp_names.c67
-rw-r--r--src/lib/libcrypto/evp/evp_pbe.c10
5 files changed, 5 insertions, 751 deletions
diff --git a/src/lib/libcrypto/ec/ec_curve.c b/src/lib/libcrypto/ec/ec_curve.c
index 9d19628b3e..dc7779358d 100644
--- a/src/lib/libcrypto/ec/ec_curve.c
+++ b/src/lib/libcrypto/ec/ec_curve.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_curve.c,v 1.42 2023/07/07 13:54:45 beck Exp $ */ 1/* $OpenBSD: ec_curve.c,v 1.43 2024/03/24 06:05:41 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -1790,502 +1790,6 @@ static const struct {
1790 }, 1790 },
1791}; 1791};
1792 1792
1793#ifndef OPENSSL_NO_GOST
1794static const struct {
1795 uint8_t p[32];
1796 uint8_t a[32];
1797 uint8_t b[32];
1798 uint8_t x[32];
1799 uint8_t y[32];
1800 uint8_t order[32];
1801} _EC_GOST_2001_Test = {
1802 .p = {
1803 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1804 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1805 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1806 0x04, 0x31,
1807 },
1808 .a = {
1809 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1810 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1811 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1812 0x00, 0x07,
1813 },
1814 .b = {
1815 0x5f, 0xbf, 0xf4, 0x98, 0xaa, 0x93, 0x8c, 0xe7, 0x39, 0xb8,
1816 0xe0, 0x22, 0xfb, 0xaf, 0xef, 0x40, 0x56, 0x3f, 0x6e, 0x6a,
1817 0x34, 0x72, 0xfc, 0x2a, 0x51, 0x4c, 0x0c, 0xe9, 0xda, 0xe2,
1818 0x3b, 0x7e,
1819 },
1820 .x = {
1821 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1822 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1823 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1824 0x00, 0x02,
1825 },
1826 .y = {
1827 0x08, 0xe2, 0xa8, 0xa0, 0xe6, 0x51, 0x47, 0xd4, 0xbd, 0x63,
1828 0x16, 0x03, 0x0e, 0x16, 0xd1, 0x9c, 0x85, 0xc9, 0x7f, 0x0a,
1829 0x9c, 0xa2, 0x67, 0x12, 0x2b, 0x96, 0xab, 0xbc, 0xea, 0x7e,
1830 0x8f, 0xc8,
1831 },
1832 .order = {
1833 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1834 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x50, 0xfe, 0x8a, 0x18,
1835 0x92, 0x97, 0x61, 0x54, 0xc5, 0x9c, 0xfc, 0x19, 0x3a, 0xcc,
1836 0xf5, 0xb3,
1837 },
1838};
1839
1840static const struct {
1841 uint8_t p[32];
1842 uint8_t a[32];
1843 uint8_t b[32];
1844 uint8_t x[32];
1845 uint8_t y[32];
1846 uint8_t order[32];
1847} _EC_GOST_2001_CryptoPro_A = {
1848 .p = {
1849 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1850 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1851 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1852 0xfd, 0x97,
1853 },
1854 .a = {
1855 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1856 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1857 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1858 0xfd, 0x94,
1859 },
1860 .b = {
1861 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1862 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1863 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1864 0x00, 0xa6,
1865 },
1866 .x = {
1867 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1868 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1869 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1870 0x00, 0x01,
1871 },
1872 .y = {
1873 0x8d, 0x91, 0xe4, 0x71, 0xe0, 0x98, 0x9c, 0xda, 0x27, 0xdf,
1874 0x50, 0x5a, 0x45, 0x3f, 0x2b, 0x76, 0x35, 0x29, 0x4f, 0x2d,
1875 0xdf, 0x23, 0xe3, 0xb1, 0x22, 0xac, 0xc9, 0x9c, 0x9e, 0x9f,
1876 0x1e, 0x14,
1877 },
1878 .order = {
1879 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1880 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6c, 0x61, 0x10, 0x70,
1881 0x99, 0x5a, 0xd1, 0x00, 0x45, 0x84, 0x1b, 0x09, 0xb7, 0x61,
1882 0xb8, 0x93,
1883 },
1884};
1885
1886static const struct {
1887 uint8_t p[32];
1888 uint8_t a[32];
1889 uint8_t b[32];
1890 uint8_t x[32];
1891 uint8_t y[32];
1892 uint8_t order[32];
1893} _EC_GOST_2001_CryptoPro_B = {
1894 .p = {
1895 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1896 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1897 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1898 0x0c, 0x99,
1899 },
1900 .a = {
1901 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1902 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1903 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1904 0x0c, 0x96,
1905 },
1906 .b = {
1907 0x3e, 0x1a, 0xf4, 0x19, 0xa2, 0x69, 0xa5, 0xf8, 0x66, 0xa7,
1908 0xd3, 0xc2, 0x5c, 0x3d, 0xf8, 0x0a, 0xe9, 0x79, 0x25, 0x93,
1909 0x73, 0xff, 0x2b, 0x18, 0x2f, 0x49, 0xd4, 0xce, 0x7e, 0x1b,
1910 0xbc, 0x8b,
1911 },
1912 .x = {
1913 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1914 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1915 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1916 0x00, 0x01,
1917 },
1918 .y = {
1919 0x3f, 0xa8, 0x12, 0x43, 0x59, 0xf9, 0x66, 0x80, 0xb8, 0x3d,
1920 0x1c, 0x3e, 0xb2, 0xc0, 0x70, 0xe5, 0xc5, 0x45, 0xc9, 0x85,
1921 0x8d, 0x03, 0xec, 0xfb, 0x74, 0x4b, 0xf8, 0xd7, 0x17, 0x71,
1922 0x7e, 0xfc,
1923 },
1924 .order = {
1925 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1926 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x5f, 0x70, 0x0c, 0xff,
1927 0xf1, 0xa6, 0x24, 0xe5, 0xe4, 0x97, 0x16, 0x1b, 0xcc, 0x8a,
1928 0x19, 0x8f,
1929 },
1930};
1931
1932static const struct {
1933 uint8_t p[32];
1934 uint8_t a[32];
1935 uint8_t b[32];
1936 uint8_t x[32];
1937 uint8_t y[32];
1938 uint8_t order[32];
1939} _EC_GOST_2001_CryptoPro_C = {
1940 .p = {
1941 0x9b, 0x9f, 0x60, 0x5f, 0x5a, 0x85, 0x81, 0x07, 0xab, 0x1e,
1942 0xc8, 0x5e, 0x6b, 0x41, 0xc8, 0xaa, 0xcf, 0x84, 0x6e, 0x86,
1943 0x78, 0x90, 0x51, 0xd3, 0x79, 0x98, 0xf7, 0xb9, 0x02, 0x2d,
1944 0x75, 0x9b,
1945 },
1946 .a = {
1947 0x9b, 0x9f, 0x60, 0x5f, 0x5a, 0x85, 0x81, 0x07, 0xab, 0x1e,
1948 0xc8, 0x5e, 0x6b, 0x41, 0xc8, 0xaa, 0xcf, 0x84, 0x6e, 0x86,
1949 0x78, 0x90, 0x51, 0xd3, 0x79, 0x98, 0xf7, 0xb9, 0x02, 0x2d,
1950 0x75, 0x98,
1951 },
1952 .b = {
1953 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1954 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1955 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1956 0x80, 0x5a,
1957 },
1958 .x = {
1959 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1960 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1961 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1962 0x00, 0x00,
1963 },
1964 .y = {
1965 0x41, 0xec, 0xe5, 0x57, 0x43, 0x71, 0x1a, 0x8c, 0x3c, 0xbf,
1966 0x37, 0x83, 0xcd, 0x08, 0xc0, 0xee, 0x4d, 0x4d, 0xc4, 0x40,
1967 0xd4, 0x64, 0x1a, 0x8f, 0x36, 0x6e, 0x55, 0x0d, 0xfd, 0xb3,
1968 0xbb, 0x67,
1969 },
1970 .order = {
1971 0x9b, 0x9f, 0x60, 0x5f, 0x5a, 0x85, 0x81, 0x07, 0xab, 0x1e,
1972 0xc8, 0x5e, 0x6b, 0x41, 0xc8, 0xaa, 0x58, 0x2c, 0xa3, 0x51,
1973 0x1e, 0xdd, 0xfb, 0x74, 0xf0, 0x2f, 0x3a, 0x65, 0x98, 0x98,
1974 0x0b, 0xb9,
1975 },
1976};
1977
1978/*
1979 * This curve is defined in two birationally equal forms: canonical and Twisted
1980 * Edwards. We do calculations in canonical (Weierstrass) form.
1981 */
1982static const struct {
1983 uint8_t p[32];
1984 uint8_t a[32];
1985 uint8_t b[32];
1986 uint8_t x[32];
1987 uint8_t y[32];
1988 uint8_t order[32];
1989} _EC_GOST_2012_256_TC26_A = {
1990 .p = {
1991 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1992 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1993 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1994 0xfd, 0x97,
1995 },
1996 .a = {
1997 0xc2, 0x17, 0x3f, 0x15, 0x13, 0x98, 0x16, 0x73, 0xaf, 0x48,
1998 0x92, 0xc2, 0x30, 0x35, 0xa2, 0x7c, 0xe2, 0x5e, 0x20, 0x13,
1999 0xbf, 0x95, 0xaa, 0x33, 0xb2, 0x2c, 0x65, 0x6f, 0x27, 0x7e,
2000 0x73, 0x35,
2001 },
2002 .b = {
2003 0x29, 0x5f, 0x9b, 0xae, 0x74, 0x28, 0xed, 0x9c, 0xcc, 0x20,
2004 0xe7, 0xc3, 0x59, 0xa9, 0xd4, 0x1a, 0x22, 0xfc, 0xcd, 0x91,
2005 0x08, 0xe1, 0x7b, 0xf7, 0xba, 0x93, 0x37, 0xa6, 0xf8, 0xae,
2006 0x95, 0x13,
2007 },
2008 .x = {
2009 0x91, 0xe3, 0x84, 0x43, 0xa5, 0xe8, 0x2c, 0x0d, 0x88, 0x09,
2010 0x23, 0x42, 0x57, 0x12, 0xb2, 0xbb, 0x65, 0x8b, 0x91, 0x96,
2011 0x93, 0x2e, 0x02, 0xc7, 0x8b, 0x25, 0x82, 0xfe, 0x74, 0x2d,
2012 0xaa, 0x28,
2013 },
2014 .y = {
2015 0x32, 0x87, 0x94, 0x23, 0xab, 0x1a, 0x03, 0x75, 0x89, 0x57,
2016 0x86, 0xc4, 0xbb, 0x46, 0xe9, 0x56, 0x5f, 0xde, 0x0b, 0x53,
2017 0x44, 0x76, 0x67, 0x40, 0xaf, 0x26, 0x8a, 0xdb, 0x32, 0x32,
2018 0x2e, 0x5c,
2019 },
2020 .order = {
2021 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2022 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xd8, 0xcd, 0xdf,
2023 0xc8, 0x7b, 0x66, 0x35, 0xc1, 0x15, 0xaf, 0x55, 0x6c, 0x36,
2024 0x0c, 0x67,
2025 },
2026};
2027
2028static const struct {
2029 uint8_t p[64];
2030 uint8_t a[64];
2031 uint8_t b[64];
2032 uint8_t x[64];
2033 uint8_t y[64];
2034 uint8_t order[64];
2035} _EC_GOST_2012_512_Test = {
2036 .p = {
2037 0x45, 0x31, 0xac, 0xd1, 0xfe, 0x00, 0x23, 0xc7, 0x55, 0x0d,
2038 0x26, 0x7b, 0x6b, 0x2f, 0xee, 0x80, 0x92, 0x2b, 0x14, 0xb2,
2039 0xff, 0xb9, 0x0f, 0x04, 0xd4, 0xeb, 0x7c, 0x09, 0xb5, 0xd2,
2040 0xd1, 0x5d, 0xf1, 0xd8, 0x52, 0x74, 0x1a, 0xf4, 0x70, 0x4a,
2041 0x04, 0x58, 0x04, 0x7e, 0x80, 0xe4, 0x54, 0x6d, 0x35, 0xb8,
2042 0x33, 0x6f, 0xac, 0x22, 0x4d, 0xd8, 0x16, 0x64, 0xbb, 0xf5,
2043 0x28, 0xbe, 0x63, 0x73,
2044 },
2045 .a = {
2046 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2047 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2048 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2049 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2050 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2051 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2052 0x00, 0x00, 0x00, 0x07,
2053 },
2054 .b = {
2055 0x1c, 0xff, 0x08, 0x06, 0xa3, 0x11, 0x16, 0xda, 0x29, 0xd8,
2056 0xcf, 0xa5, 0x4e, 0x57, 0xeb, 0x74, 0x8b, 0xc5, 0xf3, 0x77,
2057 0xe4, 0x94, 0x00, 0xfd, 0xd7, 0x88, 0xb6, 0x49, 0xec, 0xa1,
2058 0xac, 0x43, 0x61, 0x83, 0x40, 0x13, 0xb2, 0xad, 0x73, 0x22,
2059 0x48, 0x0a, 0x89, 0xca, 0x58, 0xe0, 0xcf, 0x74, 0xbc, 0x9e,
2060 0x54, 0x0c, 0x2a, 0xdd, 0x68, 0x97, 0xfa, 0xd0, 0xa3, 0x08,
2061 0x4f, 0x30, 0x2a, 0xdc,
2062 },
2063 .x = {
2064 0x24, 0xd1, 0x9c, 0xc6, 0x45, 0x72, 0xee, 0x30, 0xf3, 0x96,
2065 0xbf, 0x6e, 0xbb, 0xfd, 0x7a, 0x6c, 0x52, 0x13, 0xb3, 0xb3,
2066 0xd7, 0x05, 0x7c, 0xc8, 0x25, 0xf9, 0x10, 0x93, 0xa6, 0x8c,
2067 0xd7, 0x62, 0xfd, 0x60, 0x61, 0x12, 0x62, 0xcd, 0x83, 0x8d,
2068 0xc6, 0xb6, 0x0a, 0xa7, 0xee, 0xe8, 0x04, 0xe2, 0x8b, 0xc8,
2069 0x49, 0x97, 0x7f, 0xac, 0x33, 0xb4, 0xb5, 0x30, 0xf1, 0xb1,
2070 0x20, 0x24, 0x8a, 0x9a,
2071 },
2072 .y = {
2073 0x2b, 0xb3, 0x12, 0xa4, 0x3b, 0xd2, 0xce, 0x6e, 0x0d, 0x02,
2074 0x06, 0x13, 0xc8, 0x57, 0xac, 0xdd, 0xcf, 0xbf, 0x06, 0x1e,
2075 0x91, 0xe5, 0xf2, 0xc3, 0xf3, 0x24, 0x47, 0xc2, 0x59, 0xf3,
2076 0x9b, 0x2c, 0x83, 0xab, 0x15, 0x6d, 0x77, 0xf1, 0x49, 0x6b,
2077 0xf7, 0xeb, 0x33, 0x51, 0xe1, 0xee, 0x4e, 0x43, 0xdc, 0x1a,
2078 0x18, 0xb9, 0x1b, 0x24, 0x64, 0x0b, 0x6d, 0xbb, 0x92, 0xcb,
2079 0x1a, 0xdd, 0x37, 0x1e,
2080 },
2081 .order = {
2082 0x45, 0x31, 0xac, 0xd1, 0xfe, 0x00, 0x23, 0xc7, 0x55, 0x0d,
2083 0x26, 0x7b, 0x6b, 0x2f, 0xee, 0x80, 0x92, 0x2b, 0x14, 0xb2,
2084 0xff, 0xb9, 0x0f, 0x04, 0xd4, 0xeb, 0x7c, 0x09, 0xb5, 0xd2,
2085 0xd1, 0x5d, 0xa8, 0x2f, 0x2d, 0x7e, 0xcb, 0x1d, 0xba, 0xc7,
2086 0x19, 0x90, 0x5c, 0x5e, 0xec, 0xc4, 0x23, 0xf1, 0xd8, 0x6e,
2087 0x25, 0xed, 0xbe, 0x23, 0xc5, 0x95, 0xd6, 0x44, 0xaa, 0xf1,
2088 0x87, 0xe6, 0xe6, 0xdf,
2089 },
2090};
2091
2092static const struct {
2093 uint8_t p[64];
2094 uint8_t a[64];
2095 uint8_t b[64];
2096 uint8_t x[64];
2097 uint8_t y[64];
2098 uint8_t order[64];
2099} _EC_GOST_2012_512_TC26_A = {
2100 .p = {
2101 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2102 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2103 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2104 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2105 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2106 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2107 0xff, 0xff, 0xfd, 0xc7,
2108 },
2109 .a = {
2110 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2111 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2112 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2113 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2114 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2115 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2116 0xff, 0xff, 0xfd, 0xc4,
2117 },
2118 .b = {
2119 0xe8, 0xc2, 0x50, 0x5d, 0xed, 0xfc, 0x86, 0xdd, 0xc1, 0xbd,
2120 0x0b, 0x2b, 0x66, 0x67, 0xf1, 0xda, 0x34, 0xb8, 0x25, 0x74,
2121 0x76, 0x1c, 0xb0, 0xe8, 0x79, 0xbd, 0x08, 0x1c, 0xfd, 0x0b,
2122 0x62, 0x65, 0xee, 0x3c, 0xb0, 0x90, 0xf3, 0x0d, 0x27, 0x61,
2123 0x4c, 0xb4, 0x57, 0x40, 0x10, 0xda, 0x90, 0xdd, 0x86, 0x2e,
2124 0xf9, 0xd4, 0xeb, 0xee, 0x47, 0x61, 0x50, 0x31, 0x90, 0x78,
2125 0x5a, 0x71, 0xc7, 0x60,
2126 },
2127 .x = {
2128 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2129 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2130 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2131 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2132 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2133 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2134 0x00, 0x00, 0x00, 0x03,
2135 },
2136 .y = {
2137 0x75, 0x03, 0xcf, 0xe8, 0x7a, 0x83, 0x6a, 0xe3, 0xa6, 0x1b,
2138 0x88, 0x16, 0xe2, 0x54, 0x50, 0xe6, 0xce, 0x5e, 0x1c, 0x93,
2139 0xac, 0xf1, 0xab, 0xc1, 0x77, 0x80, 0x64, 0xfd, 0xcb, 0xef,
2140 0xa9, 0x21, 0xdf, 0x16, 0x26, 0xbe, 0x4f, 0xd0, 0x36, 0xe9,
2141 0x3d, 0x75, 0xe6, 0xa5, 0x0e, 0x3a, 0x41, 0xe9, 0x80, 0x28,
2142 0xfe, 0x5f, 0xc2, 0x35, 0xf5, 0xb8, 0x89, 0xa5, 0x89, 0xcb,
2143 0x52, 0x15, 0xf2, 0xa4,
2144 },
2145 .order = {
2146 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2147 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2148 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2149 0xff, 0xff, 0x27, 0xe6, 0x95, 0x32, 0xf4, 0x8d, 0x89, 0x11,
2150 0x6f, 0xf2, 0x2b, 0x8d, 0x4e, 0x05, 0x60, 0x60, 0x9b, 0x4b,
2151 0x38, 0xab, 0xfa, 0xd2, 0xb8, 0x5d, 0xca, 0xcd, 0xb1, 0x41,
2152 0x1f, 0x10, 0xb2, 0x75,
2153 },
2154};
2155
2156static const struct {
2157 uint8_t p[64];
2158 uint8_t a[64];
2159 uint8_t b[64];
2160 uint8_t x[64];
2161 uint8_t y[64];
2162 uint8_t order[64];
2163} _EC_GOST_2012_512_TC26_B = {
2164 .p = {
2165 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2166 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2167 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2168 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2169 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2170 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2171 0x00, 0x00, 0x00, 0x6f,
2172 },
2173 .a = {
2174 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2175 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2176 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2177 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2178 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2179 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2180 0x00, 0x00, 0x00, 0x6c,
2181 },
2182 .b = {
2183 0x68, 0x7d, 0x1b, 0x45, 0x9d, 0xc8, 0x41, 0x45, 0x7e, 0x3e,
2184 0x06, 0xcf, 0x6f, 0x5e, 0x25, 0x17, 0xb9, 0x7c, 0x7d, 0x61,
2185 0x4a, 0xf1, 0x38, 0xbc, 0xbf, 0x85, 0xdc, 0x80, 0x6c, 0x4b,
2186 0x28, 0x9f, 0x3e, 0x96, 0x5d, 0x2d, 0xb1, 0x41, 0x6d, 0x21,
2187 0x7f, 0x8b, 0x27, 0x6f, 0xad, 0x1a, 0xb6, 0x9c, 0x50, 0xf7,
2188 0x8b, 0xee, 0x1f, 0xa3, 0x10, 0x6e, 0xfb, 0x8c, 0xcb, 0xc7,
2189 0xc5, 0x14, 0x01, 0x16,
2190 },
2191 .x = {
2192 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2193 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2194 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2195 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2196 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2197 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2198 0x00, 0x00, 0x00, 0x02,
2199 },
2200 .y = {
2201 0x1a, 0x8f, 0x7e, 0xda, 0x38, 0x9b, 0x09, 0x4c, 0x2c, 0x07,
2202 0x1e, 0x36, 0x47, 0xa8, 0x94, 0x0f, 0x3c, 0x12, 0x3b, 0x69,
2203 0x75, 0x78, 0xc2, 0x13, 0xbe, 0x6d, 0xd9, 0xe6, 0xc8, 0xec,
2204 0x73, 0x35, 0xdc, 0xb2, 0x28, 0xfd, 0x1e, 0xdf, 0x4a, 0x39,
2205 0x15, 0x2c, 0xbc, 0xaa, 0xf8, 0xc0, 0x39, 0x88, 0x28, 0x04,
2206 0x10, 0x55, 0xf9, 0x4c, 0xee, 0xec, 0x7e, 0x21, 0x34, 0x07,
2207 0x80, 0xfe, 0x41, 0xbd,
2208 },
2209 .order = {
2210 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2211 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2212 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2213 0x00, 0x01, 0x49, 0xa1, 0xec, 0x14, 0x25, 0x65, 0xa5, 0x45,
2214 0xac, 0xfd, 0xb7, 0x7b, 0xd9, 0xd4, 0x0c, 0xfa, 0x8b, 0x99,
2215 0x67, 0x12, 0x10, 0x1b, 0xea, 0x0e, 0xc6, 0x34, 0x6c, 0x54,
2216 0x37, 0x4f, 0x25, 0xbd,
2217 },
2218};
2219
2220/*
2221 * This curve is defined in two birationally equal forms: canonical and Twisted
2222 * Edwards. We do calculations in canonical (Weierstrass) form.
2223 */
2224static const struct {
2225 uint8_t p[64];
2226 uint8_t a[64];
2227 uint8_t b[64];
2228 uint8_t x[64];
2229 uint8_t y[64];
2230 uint8_t order[64];
2231} _EC_GOST_2012_512_TC26_C = {
2232 .p = {
2233 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2234 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2235 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2236 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2237 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2238 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2239 0xff, 0xff, 0xfd, 0xc7,
2240 },
2241 .a = {
2242 0xdc, 0x92, 0x03, 0xe5, 0x14, 0xa7, 0x21, 0x87, 0x54, 0x85,
2243 0xa5, 0x29, 0xd2, 0xc7, 0x22, 0xfb, 0x18, 0x7b, 0xc8, 0x98,
2244 0x0e, 0xb8, 0x66, 0x64, 0x4d, 0xe4, 0x1c, 0x68, 0xe1, 0x43,
2245 0x06, 0x45, 0x46, 0xe8, 0x61, 0xc0, 0xe2, 0xc9, 0xed, 0xd9,
2246 0x2a, 0xde, 0x71, 0xf4, 0x6f, 0xcf, 0x50, 0xff, 0x2a, 0xd9,
2247 0x7f, 0x95, 0x1f, 0xda, 0x9f, 0x2a, 0x2e, 0xb6, 0x54, 0x6f,
2248 0x39, 0x68, 0x9b, 0xd3,
2249 },
2250 .b = {
2251 0xb4, 0xc4, 0xee, 0x28, 0xce, 0xbc, 0x6c, 0x2c, 0x8a, 0xc1,
2252 0x29, 0x52, 0xcf, 0x37, 0xf1, 0x6a, 0xc7, 0xef, 0xb6, 0xa9,
2253 0xf6, 0x9f, 0x4b, 0x57, 0xff, 0xda, 0x2e, 0x4f, 0x0d, 0xe5,
2254 0xad, 0xe0, 0x38, 0xcb, 0xc2, 0xff, 0xf7, 0x19, 0xd2, 0xc1,
2255 0x8d, 0xe0, 0x28, 0x4b, 0x8b, 0xfe, 0xf3, 0xb5, 0x2b, 0x8c,
2256 0xc7, 0xa5, 0xf5, 0xbf, 0x0a, 0x3c, 0x8d, 0x23, 0x19, 0xa5,
2257 0x31, 0x25, 0x57, 0xe1,
2258 },
2259 .x = {
2260 0xe2, 0xe3, 0x1e, 0xdf, 0xc2, 0x3d, 0xe7, 0xbd, 0xeb, 0xe2,
2261 0x41, 0xce, 0x59, 0x3e, 0xf5, 0xde, 0x22, 0x95, 0xb7, 0xa9,
2262 0xcb, 0xae, 0xf0, 0x21, 0xd3, 0x85, 0xf7, 0x07, 0x4c, 0xea,
2263 0x04, 0x3a, 0xa2, 0x72, 0x72, 0xa7, 0xae, 0x60, 0x2b, 0xf2,
2264 0xa7, 0xb9, 0x03, 0x3d, 0xb9, 0xed, 0x36, 0x10, 0xc6, 0xfb,
2265 0x85, 0x48, 0x7e, 0xae, 0x97, 0xaa, 0xc5, 0xbc, 0x79, 0x28,
2266 0xc1, 0x95, 0x01, 0x48,
2267 },
2268 .y = {
2269 0xf5, 0xce, 0x40, 0xd9, 0x5b, 0x5e, 0xb8, 0x99, 0xab, 0xbc,
2270 0xcf, 0xf5, 0x91, 0x1c, 0xb8, 0x57, 0x79, 0x39, 0x80, 0x4d,
2271 0x65, 0x27, 0x37, 0x8b, 0x8c, 0x10, 0x8c, 0x3d, 0x20, 0x90,
2272 0xff, 0x9b, 0xe1, 0x8e, 0x2d, 0x33, 0xe3, 0x02, 0x1e, 0xd2,
2273 0xef, 0x32, 0xd8, 0x58, 0x22, 0x42, 0x3b, 0x63, 0x04, 0xf7,
2274 0x26, 0xaa, 0x85, 0x4b, 0xae, 0x07, 0xd0, 0x39, 0x6e, 0x9a,
2275 0x9a, 0xdd, 0xc4, 0x0f,
2276 },
2277 .order = {
2278 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2279 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2280 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2281 0xff, 0xff, 0xc9, 0x8c, 0xdb, 0xa4, 0x65, 0x06, 0xab, 0x00,
2282 0x4c, 0x33, 0xa9, 0xff, 0x51, 0x47, 0x50, 0x2c, 0xc8, 0xed,
2283 0xa9, 0xe7, 0xa7, 0x69, 0xa1, 0x26, 0x94, 0x62, 0x3c, 0xef,
2284 0x47, 0xf0, 0x23, 0xed,
2285 },
2286};
2287#endif
2288
2289static const struct ec_list_element { 1793static const struct ec_list_element {
2290 const char *comment; 1794 const char *comment;
2291 int nid; 1795 int nid;
@@ -2822,177 +2326,6 @@ static const struct ec_list_element {
2822 .order = _EC_FRP256v1.order, 2326 .order = _EC_FRP256v1.order,
2823 .cofactor = 1, 2327 .cofactor = 1,
2824 }, 2328 },
2825#ifndef OPENSSL_NO_GOST
2826 /* GOST R 34.10-2001 */
2827 {
2828 .comment = "GOST R 34.10-2001 Test Curve",
2829 .nid = NID_id_GostR3410_2001_TestParamSet,
2830 .param_len = sizeof(_EC_GOST_2001_Test.p),
2831 .p = _EC_GOST_2001_Test.p,
2832 .a = _EC_GOST_2001_Test.a,
2833 .b = _EC_GOST_2001_Test.b,
2834 .x = _EC_GOST_2001_Test.x,
2835 .y = _EC_GOST_2001_Test.y,
2836 .order = _EC_GOST_2001_Test.order,
2837 .cofactor = 1,
2838 },
2839 {
2840 .comment = "GOST R 34.10-2001 CryptoPro-A",
2841 .nid = NID_id_GostR3410_2001_CryptoPro_A_ParamSet,
2842 .param_len = sizeof(_EC_GOST_2001_CryptoPro_A.p),
2843 .p = _EC_GOST_2001_CryptoPro_A.p,
2844 .a = _EC_GOST_2001_CryptoPro_A.a,
2845 .b = _EC_GOST_2001_CryptoPro_A.b,
2846 .x = _EC_GOST_2001_CryptoPro_A.x,
2847 .y = _EC_GOST_2001_CryptoPro_A.y,
2848 .order = _EC_GOST_2001_CryptoPro_A.order,
2849 .cofactor = 1,
2850 },
2851 {
2852 .comment = "GOST R 34.10-2001 CryptoPro-B",
2853 .nid = NID_id_GostR3410_2001_CryptoPro_B_ParamSet,
2854 .param_len = sizeof(_EC_GOST_2001_CryptoPro_B.p),
2855 .p = _EC_GOST_2001_CryptoPro_B.p,
2856 .a = _EC_GOST_2001_CryptoPro_B.a,
2857 .b = _EC_GOST_2001_CryptoPro_B.b,
2858 .x = _EC_GOST_2001_CryptoPro_B.x,
2859 .y = _EC_GOST_2001_CryptoPro_B.y,
2860 .order = _EC_GOST_2001_CryptoPro_B.order,
2861 .cofactor = 1,
2862 },
2863 {
2864 .comment = "GOST R 34.10-2001 CryptoPro-C",
2865 .nid = NID_id_GostR3410_2001_CryptoPro_C_ParamSet,
2866 .param_len = sizeof(_EC_GOST_2001_CryptoPro_C.p),
2867 .p = _EC_GOST_2001_CryptoPro_C.p,
2868 .a = _EC_GOST_2001_CryptoPro_C.a,
2869 .b = _EC_GOST_2001_CryptoPro_C.b,
2870 .x = _EC_GOST_2001_CryptoPro_C.x,
2871 .y = _EC_GOST_2001_CryptoPro_C.y,
2872 .order = _EC_GOST_2001_CryptoPro_C.order,
2873 .cofactor = 1,
2874 },
2875 {
2876 .comment = "GOST R 34.10-2001 CryptoPro-XchA",
2877 .nid = NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet,
2878 .param_len = sizeof(_EC_GOST_2001_CryptoPro_A.p),
2879 .p = _EC_GOST_2001_CryptoPro_A.p,
2880 .a = _EC_GOST_2001_CryptoPro_A.a,
2881 .b = _EC_GOST_2001_CryptoPro_A.b,
2882 .x = _EC_GOST_2001_CryptoPro_A.x,
2883 .y = _EC_GOST_2001_CryptoPro_A.y,
2884 .order = _EC_GOST_2001_CryptoPro_A.order,
2885 .cofactor = 1,
2886 },
2887 {
2888 .comment = "GOST R 34.10-2001 CryptoPro-XchB",
2889 .nid = NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet,
2890 .param_len = sizeof(_EC_GOST_2001_CryptoPro_C.p),
2891 .p = _EC_GOST_2001_CryptoPro_C.p,
2892 .a = _EC_GOST_2001_CryptoPro_C.a,
2893 .b = _EC_GOST_2001_CryptoPro_C.b,
2894 .x = _EC_GOST_2001_CryptoPro_C.x,
2895 .y = _EC_GOST_2001_CryptoPro_C.y,
2896 .order = _EC_GOST_2001_CryptoPro_C.order,
2897 .cofactor = 1,
2898 },
2899 {
2900 .comment = "GOST R 34.10-2012 256 TC26-A",
2901 .nid = NID_id_tc26_gost_3410_12_256_paramSetA,
2902 .param_len = sizeof(_EC_GOST_2012_256_TC26_A.p),
2903 .p = _EC_GOST_2012_256_TC26_A.p,
2904 .a = _EC_GOST_2012_256_TC26_A.a,
2905 .b = _EC_GOST_2012_256_TC26_A.b,
2906 .x = _EC_GOST_2012_256_TC26_A.x,
2907 .y = _EC_GOST_2012_256_TC26_A.y,
2908 .order = _EC_GOST_2012_256_TC26_A.order,
2909 .cofactor = 4,
2910 },
2911 {
2912 .comment = "GOST R 34.10-2012 256 TC26-B",
2913 .nid = NID_id_tc26_gost_3410_12_256_paramSetB,
2914 .param_len = sizeof(_EC_GOST_2001_CryptoPro_A.p),
2915 .p = _EC_GOST_2001_CryptoPro_A.p,
2916 .a = _EC_GOST_2001_CryptoPro_A.a,
2917 .b = _EC_GOST_2001_CryptoPro_A.b,
2918 .x = _EC_GOST_2001_CryptoPro_A.x,
2919 .y = _EC_GOST_2001_CryptoPro_A.y,
2920 .order = _EC_GOST_2001_CryptoPro_A.order,
2921 .cofactor = 1,
2922 },
2923 {
2924 .comment = "GOST R 34.10-2012 256 TC26-C",
2925 .nid = NID_id_tc26_gost_3410_12_256_paramSetC,
2926 .param_len = sizeof(_EC_GOST_2001_CryptoPro_B.p),
2927 .p = _EC_GOST_2001_CryptoPro_B.p,
2928 .a = _EC_GOST_2001_CryptoPro_B.a,
2929 .b = _EC_GOST_2001_CryptoPro_B.b,
2930 .x = _EC_GOST_2001_CryptoPro_B.x,
2931 .y = _EC_GOST_2001_CryptoPro_B.y,
2932 .order = _EC_GOST_2001_CryptoPro_B.order,
2933 .cofactor = 1,
2934 },
2935 {
2936 .comment = "GOST R 34.10-2012 256 TC26-D",
2937 .nid = NID_id_tc26_gost_3410_12_256_paramSetD,
2938 .param_len = sizeof(_EC_GOST_2001_CryptoPro_C.p),
2939 .p = _EC_GOST_2001_CryptoPro_C.p,
2940 .a = _EC_GOST_2001_CryptoPro_C.a,
2941 .b = _EC_GOST_2001_CryptoPro_C.b,
2942 .x = _EC_GOST_2001_CryptoPro_C.x,
2943 .y = _EC_GOST_2001_CryptoPro_C.y,
2944 .order = _EC_GOST_2001_CryptoPro_C.order,
2945 .cofactor = 1,
2946 },
2947 {
2948 .comment = "GOST R 34.10-2012 512 Test Curve",
2949 .nid = NID_id_tc26_gost_3410_12_512_paramSetTest,
2950 .param_len = sizeof(_EC_GOST_2012_512_Test.p),
2951 .p = _EC_GOST_2012_512_Test.p,
2952 .a = _EC_GOST_2012_512_Test.a,
2953 .b = _EC_GOST_2012_512_Test.b,
2954 .x = _EC_GOST_2012_512_Test.x,
2955 .y = _EC_GOST_2012_512_Test.y,
2956 .order = _EC_GOST_2012_512_Test.order,
2957 .cofactor = 1,
2958 },
2959 {
2960 .comment = "GOST R 34.10-2012 512 TC26-A",
2961 .nid = NID_id_tc26_gost_3410_12_512_paramSetA,
2962 .param_len = sizeof(_EC_GOST_2012_512_TC26_A.p),
2963 .p = _EC_GOST_2012_512_TC26_A.p,
2964 .a = _EC_GOST_2012_512_TC26_A.a,
2965 .b = _EC_GOST_2012_512_TC26_A.b,
2966 .x = _EC_GOST_2012_512_TC26_A.x,
2967 .y = _EC_GOST_2012_512_TC26_A.y,
2968 .order = _EC_GOST_2012_512_TC26_A.order,
2969 .cofactor = 1,
2970 },
2971 {
2972 .comment = "GOST R 34.10-2012 512 TC26-B",
2973 .nid = NID_id_tc26_gost_3410_12_512_paramSetB,
2974 .param_len = sizeof(_EC_GOST_2012_512_TC26_B.p),
2975 .p = _EC_GOST_2012_512_TC26_B.p,
2976 .a = _EC_GOST_2012_512_TC26_B.a,
2977 .b = _EC_GOST_2012_512_TC26_B.b,
2978 .x = _EC_GOST_2012_512_TC26_B.x,
2979 .y = _EC_GOST_2012_512_TC26_B.y,
2980 .order = _EC_GOST_2012_512_TC26_B.order,
2981 .cofactor = 1,
2982 },
2983 {
2984 .comment = "GOST R 34.10-2012 512 TC26-C",
2985 .nid = NID_id_tc26_gost_3410_12_512_paramSetC,
2986 .param_len = sizeof(_EC_GOST_2012_512_TC26_C.p),
2987 .p = _EC_GOST_2012_512_TC26_C.p,
2988 .a = _EC_GOST_2012_512_TC26_C.a,
2989 .b = _EC_GOST_2012_512_TC26_C.b,
2990 .x = _EC_GOST_2012_512_TC26_C.x,
2991 .y = _EC_GOST_2012_512_TC26_C.y,
2992 .order = _EC_GOST_2012_512_TC26_C.order,
2993 .cofactor = 4,
2994 },
2995#endif
2996}; 2329};
2997 2330
2998#define CURVE_LIST_LENGTH (sizeof(curve_list) / sizeof(curve_list[0])) 2331#define CURVE_LIST_LENGTH (sizeof(curve_list) / sizeof(curve_list[0]))
diff --git a/src/lib/libcrypto/err/err_all.c b/src/lib/libcrypto/err/err_all.c
index 56276abb0d..ea6c0af409 100644
--- a/src/lib/libcrypto/err/err_all.c
+++ b/src/lib/libcrypto/err/err_all.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: err_all.c,v 1.34 2024/03/02 13:39:28 tb Exp $ */ 1/* $OpenBSD: err_all.c,v 1.35 2024/03/24 06:05:41 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -125,9 +125,6 @@ ERR_load_crypto_strings_internal(void)
125 ERR_load_EC_strings(); 125 ERR_load_EC_strings();
126#endif 126#endif
127 ERR_load_EVP_strings(); 127 ERR_load_EVP_strings();
128#ifndef OPENSSL_NO_GOST
129 ERR_load_GOST_strings();
130#endif
131 ERR_load_KDF_strings(); 128 ERR_load_KDF_strings();
132 ERR_load_OBJ_strings(); 129 ERR_load_OBJ_strings();
133 ERR_load_OCSP_strings(); 130 ERR_load_OCSP_strings();
diff --git a/src/lib/libcrypto/evp/evp_local.h b/src/lib/libcrypto/evp/evp_local.h
index dad2cec81e..d0335931e5 100644
--- a/src/lib/libcrypto/evp/evp_local.h
+++ b/src/lib/libcrypto/evp/evp_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_local.h,v 1.19 2024/03/02 10:20:27 tb Exp $ */ 1/* $OpenBSD: evp_local.h,v 1.20 2024/03/24 06:05:41 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -173,9 +173,6 @@ struct evp_pkey_st {
173 struct ec_key_st *ec; /* ECC */ 173 struct ec_key_st *ec; /* ECC */
174 struct ecx_key_st *ecx; /* ECX */ 174 struct ecx_key_st *ecx; /* ECX */
175#endif 175#endif
176#ifndef OPENSSL_NO_GOST
177 struct gost_key_st *gost; /* GOST */
178#endif
179 } pkey; 176 } pkey;
180 int save_parameters; 177 int save_parameters;
181 STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ 178 STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
diff --git a/src/lib/libcrypto/evp/evp_names.c b/src/lib/libcrypto/evp/evp_names.c
index 2936c36622..83c2f53840 100644
--- a/src/lib/libcrypto/evp/evp_names.c
+++ b/src/lib/libcrypto/evp/evp_names.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_names.c,v 1.12 2024/03/02 10:13:13 tb Exp $ */ 1/* $OpenBSD: evp_names.c,v 1.13 2024/03/24 06:05:41 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2023 Theo Buehler <tb@openbsd.org> 3 * Copyright (c) 2023 Theo Buehler <tb@openbsd.org>
4 * 4 *
@@ -415,13 +415,6 @@ static const struct cipher_name cipher_names[] = {
415 }, 415 },
416#endif /* OPENSSL_NO_DES */ 416#endif /* OPENSSL_NO_DES */
417 417
418#ifndef OPENSSL_NO_GOST
419 {
420 .name = LN_id_Gost28147_89,
421 .cipher = EVP_gost2814789_cfb64,
422 },
423#endif /* OPENSSL_NO_GOST */
424
425#ifndef OPENSSL_NO_IDEA 418#ifndef OPENSSL_NO_IDEA
426 { 419 {
427 .name = "IDEA", 420 .name = "IDEA",
@@ -917,21 +910,6 @@ static const struct cipher_name cipher_names[] = {
917 }, 910 },
918#endif /* OPENSSL_NO_DES */ 911#endif /* OPENSSL_NO_DES */
919 912
920#ifndef OPENSSL_NO_GOST
921 {
922 .name = SN_id_Gost28147_89,
923 .cipher = EVP_gost2814789_cfb64,
924 },
925 {
926 .name = SN_gost89_cnt,
927 .cipher = EVP_gost2814789_cnt,
928 },
929 {
930 .name = SN_gost89_ecb,
931 .cipher = EVP_gost2814789_ecb,
932 },
933#endif /* OPENSSL_NO_GOST */
934
935#ifndef OPENSSL_NO_AES 913#ifndef OPENSSL_NO_AES
936 { 914 {
937 .name = SN_aes_128_ccm, 915 .name = SN_aes_128_ccm,
@@ -1087,24 +1065,6 @@ static const struct digest_name digest_names[] = {
1087 .alias = SN_sha1, 1065 .alias = SN_sha1,
1088 }, 1066 },
1089#endif 1067#endif
1090#ifndef OPENSSL_NO_GOST
1091 {
1092 .name = LN_id_Gost28147_89_MAC,
1093 .digest = EVP_gost2814789imit,
1094 },
1095 {
1096 .name = LN_id_tc26_gost3411_2012_512,
1097 .digest = EVP_streebog512,
1098 },
1099 {
1100 .name = LN_id_tc26_gost3411_2012_256,
1101 .digest = EVP_streebog256,
1102 },
1103 {
1104 .name = LN_id_GostR3411_94,
1105 .digest = EVP_gostr341194,
1106 },
1107#endif /* OPENSSL_NO_GOST */
1108 1068
1109#ifndef OPENSSL_NO_MD4 1069#ifndef OPENSSL_NO_MD4
1110 { 1070 {
@@ -1356,13 +1316,6 @@ static const struct digest_name digest_names[] = {
1356 }, 1316 },
1357#endif /* OPENSSL_NO_SHA256 && OPENSSL_NO_EC */ 1317#endif /* OPENSSL_NO_SHA256 && OPENSSL_NO_EC */
1358 1318
1359#ifndef OPENSSL_NO_GOST
1360 {
1361 .name = SN_id_Gost28147_89_MAC,
1362 .digest = EVP_gost2814789imit,
1363 },
1364#endif /* OPENSSL_NO_GOST */
1365
1366#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_SHA256) 1319#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_SHA256)
1367 { 1320 {
1368 .name = SN_dsa_with_SHA224, 1321 .name = SN_dsa_with_SHA224,
@@ -1492,13 +1445,6 @@ static const struct digest_name digest_names[] = {
1492 }, 1445 },
1493#endif 1446#endif
1494 1447
1495#ifndef OPENSSL_NO_GOST
1496 {
1497 .name = SN_id_GostR3411_94,
1498 .digest = EVP_gostr341194,
1499 },
1500#endif /* OPENSSL_NO_GOST */
1501
1502#ifndef OPENSSL_NO_RIPEMD 1448#ifndef OPENSSL_NO_RIPEMD
1503 { 1449 {
1504 .name = "ripemd", 1450 .name = "ripemd",
@@ -1661,17 +1607,6 @@ static const struct digest_name digest_names[] = {
1661 }, 1607 },
1662#endif /* OPENSSL_NO_SHA1 */ 1608#endif /* OPENSSL_NO_SHA1 */
1663 1609
1664#ifndef OPENSSL_NO_GOST
1665 {
1666 .name = SN_id_tc26_gost3411_2012_256,
1667 .digest = EVP_streebog256,
1668 },
1669 {
1670 .name = SN_id_tc26_gost3411_2012_512,
1671 .digest = EVP_streebog512,
1672 },
1673#endif /* OPENSSL_NO_GOST */
1674
1675#ifndef OPENSSL_NO_WHIRLPOOL 1610#ifndef OPENSSL_NO_WHIRLPOOL
1676 { 1611 {
1677 .name = SN_whirlpool, 1612 .name = SN_whirlpool,
diff --git a/src/lib/libcrypto/evp/evp_pbe.c b/src/lib/libcrypto/evp/evp_pbe.c
index 532c924a9e..9ac914b9e3 100644
--- a/src/lib/libcrypto/evp/evp_pbe.c
+++ b/src/lib/libcrypto/evp/evp_pbe.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_pbe.c,v 1.46 2024/03/02 10:20:27 tb Exp $ */ 1/* $OpenBSD: evp_pbe.c,v 1.47 2024/03/24 06:05:41 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -494,14 +494,6 @@ md_nid_from_prf_nid(int nid)
494 return NID_sha3_384; 494 return NID_sha3_384;
495 case NID_hmac_sha3_512: 495 case NID_hmac_sha3_512:
496 return NID_sha3_512; 496 return NID_sha3_512;
497#ifndef OPENSSL_NO_GOST
498 case NID_id_HMACGostR3411_94:
499 return NID_id_GostR3411_94;
500 case NID_id_tc26_hmac_gost_3411_12_256:
501 return NID_id_tc26_gost3411_2012_256;
502 case NID_id_tc26_hmac_gost_3411_12_512:
503 return NID_id_tc26_gost3411_2012_512;
504#endif
505 default: 497 default:
506 return NID_undef; 498 return NID_undef;
507 } 499 }