comparison ecc.c @ 1739:13d834efc376 fuzz

merge from main
author Matt Johnston <matt@ucc.asn.au>
date Thu, 15 Oct 2020 19:55:15 +0800
parents 1051e4eea25a
children
comparison
equal deleted inserted replaced
1562:768ebf737aa0 1739:13d834efc376
164 } 164 }
165 165
166 key = new_ecc_key(); 166 key = new_ecc_key();
167 key->dp = curve->dp; 167 key->dp = curve->dp;
168 168
169 if (mp_read_unsigned_bin(key->pubkey.x, buf_getptr(buf, size), size) != MP_OKAY) { 169 if (mp_from_ubin(key->pubkey.x, buf_getptr(buf, size), size) != MP_OKAY) {
170 TRACE(("failed to read x")) 170 TRACE(("failed to read x"))
171 goto out; 171 goto out;
172 } 172 }
173 buf_incrpos(buf, size); 173 buf_incrpos(buf, size);
174 174
175 if (mp_read_unsigned_bin(key->pubkey.y, buf_getptr(buf, size), size) != MP_OKAY) { 175 if (mp_from_ubin(key->pubkey.y, buf_getptr(buf, size), size) != MP_OKAY) {
176 TRACE(("failed to read y")) 176 TRACE(("failed to read y"))
177 goto out; 177 goto out;
178 } 178 }
179 buf_incrpos(buf, size); 179 buf_incrpos(buf, size);
180 180